0

I would like to accept DOIs in a Django form so that when a user inputs their DOI (a DOI to a publication, for example), I can generate a link that will allow users to access the actual url. The DOI is a field in my model and I need to resolve the DOI name to 1) make sure it is a valid DOI (i.e. it exists) and 2)generate the url for users.

Can someone suggest how to go about doing this? I've looked at doi.org and crossref.org, as they do what I'm trying to do (enter a DOI, find it, and resolve it), but I don't know how to "call" that from my Django app.

plact
  • 99
  • 1
  • 7
  • Oh gosh, I'm sorry @DanielRoseman. I should have been more explicit. DOI == digital object identifier – plact Apr 11 '15 at 17:03

1 Answers1

0

You'll have to create a custom model field, see here, OR just use a char field with custom validators. The latter seems like the easier option.

ubadub
  • 3,571
  • 21
  • 32
  • Thank you @ubadub . I was planning to do custom validation but wasn't sure if there was a specific python library (I'm looking at urllib) or some other way to handle DOIs. So, last thing, is it "worth" it/sensible to make a get request to the APIs of doi.org or crossref.org? I've never done anything like this so I'm not sure. – plact Apr 11 '15 at 17:00
  • @plact I am not sure what those APIs provide, but if they allow you to verify the authenticity of a doi, that would seem to be a sensible course of action. – ubadub Apr 12 '15 at 08:50