This is designed to test out various components we might use for a redesign of FAIRsharing to use Python 3, Django 2 and GraphQL rather than REST. To set this up:
- Create a virtualenv with Python 3 (e.g.
virtualenv --python=python3 prototype
) and activate it. - Install the various packages with
pip install -r requirements.txt
. - Create a postgres database, put the configuration in secrets.py, and then run
manage.py migrate
. You may also need to runmakemigrations
andmigrate
again to add the model(s) in models.py. - Create some models for testing with
python manage.py loadtestdata fairsharing.FairsharingRecord:5
. - Create an admin user with
manage.py createsuperuser
.
Here's a tutorial:
http://docs.graphene-python.org/projects/django/en/latest/tutorial-plain/
And another:
https://github.com/mbrochh/django-graphql-apollo-react-demo
Lots, for example:
- Proper user authorisation.
- Fix this so it actually works (e.g. tests).