This example project demos integration between Graphene, Django and MongoEngine.
First you'll need to get the source of the project. Do this by cloning the whole Graphene repository:
# Get the example project code
git clone [email protected]:abawchen/graphene-mongo.git
cd graphene-mongo/examples/django_mongoengine
Create a virtual environment.
# Create a virtualenv in which we can install the dependencies
virtualenv env
source env/bin/activate
Now we can install our dependencies:
pip install -r requirements.txt
Run the following command:
python manage.py migrate
Setup a mongodb connection and create a database. See the mongoengine connection details in the settings.py file
Start the server:
python manage.py runserver
Now head on over to http://127.0.0.1:8000/graphql and run some queries!
For tests run:
pytest -v