ucam-department-of-psychiatry / crate

Create and use de-identified research databases. Preprocess, extract text, anonymise/de-identify, link, apply natural language processing, query for research, manage consent for contact.
GNU General Public License v3.0
19 stars 7 forks source link

Initial development of anonymisation API using Django REST Framework #66

Closed martinburchell closed 2 years ago

martinburchell commented 2 years ago

To try it out:

then:

crate_anon_web_create_private_settings
crate_anon_web_django_manage migrate
crate_anon_web_django_manage createsuperuser
crate_anon_web_django_manage runserver --insecure

then:

API documentation is at http://localhost:8000/schema/doc/

The API documentation also gets shoehorned into the Sphinx docs as an included piece of HTML

RudolfCardinal commented 2 years ago

Looks very good! One minor thing: if you browse to the API test area and click "Options", you see a very nice display, but it offers "POST". Does that ever work? I thought OPTIONS was read-only, so should we remove this button (if that's possible)?

RudolfCardinal commented 2 years ago

It wasn't picking up settings.CRATE for me, so I've added an explicit import of the CRATE object (from private_settings.py) in settings.py. Also changed relative to absolute import (OK?). Good to go from my perspective if you're happy -- thank you!

martinburchell commented 2 years ago

Looks very good! One minor thing: if you browse to the API test area and click "Options", you see a very nice display, but it offers "POST". Does that ever work? I thought OPTIONS was read-only, so should we remove this button (if that's possible)?

The page allows you to send either an OPTIONS request or a POST request. You see the response from the most recent request at the top of the page. To send an OPTIONS request there is just the button. The form with the POST button is for the POST request.

There was a bug that meant that if you hit the OPTIONS button, the JSON editors would not be be loaded into the subsequent page due to a JavaScript error. Now fixed.