Generate the certs for JWT ./scripts/generate_jwt_certs.sh
Execute the migration in your DB python manage.py migrate
Load the demo data python manage.py loaddata georga/fixtures/*
Start the server python manage.py runserver
You can login under /admin/ with the superadmin user [email protected]
and georga
Further current testusers are (use password georga
for all accounts):
- Registered helpers
- Organization admins
- Project admins
- Operation admin
-
Unpin versions in
requirements.txt
-
Upgrade pip packages
docker compose run --rm --service-ports server bash
pip install --upgrade -r requirements.txt
-
Test/Fix startup
./scripts/startup.sh
-
Run/Fix tests
./manage.py test
-
Pin new versions in
requirements.txt
Run django tests:
./manage.py test
./manage.py test --verbosity 2 --failfast --timing --keepdb --parallel auto
./manage.py test --verbosity 2 --keepdb --pdb
docker compose run --rm --service-ports server bash
> apt-get update && apt-get install -y graphviz graphviz-dev
> pip install django-extensions pygraphviz
> vi settings.py
INSTALLED_APPS = [
[...]
'django_extensions',
]
> ./manage.py graph_models -a \
-X Mixin*,Abstract*,Group,Permission,ContentType,Session,LogEntry,Site \
-o georga-uml.png
When you open http://localhost:8000/graphql you will be presented with GraphiQL an in-browser GraphQL client. In GraphiQL you find the api docs in the top right corner.
mutation {
tokenAuth(email:"[email protected]", password:"georga") {
payload
refreshExpiresIn
token
}
}
To query data from the server you need to send an Header including your JWT with each request you make.
In GraphiQL you can archive this by setting in the bottom left under Request Headers
this:
{
"Authorization": "JWT <YOUR_TOKEN>"
}
And then execute the query:
query {
listPersons {
edges {
node {
email
}
}
}
}
For initial contents and/or demodata in the database, the yaml-files in folder fixtures can be used.
Load the demo data python manage.py loaddata georga/fixtures/*
For getting the password hash for a users' password, e.g. to insert it into demodata in fixtures/005_person.yaml
the following custom management command can be used:
python manage.py get_pw_hash passwordstring
Note: GraphiQL does not support subscriptions. Use another desktop client like Altair or Playground instead.
subscription {
testSubscription() {
event
}
}
To test push messages, use the testSubscription mutation:
mutation {
testSubscription(message="message") {
response
}
}
Relay is a specification to provide a consistent interface for global identification and pagination. See also graphene python docs.
In all graphql requests, the id field is masked by the relay global ID,
which is a base64 coded string <model>:<uuid>
.