This is the simplest configuration for developers to start with.
docker-compose run --rm django ./manage.py migratedocker-compose run --rm django ./manage.py createsuperuser
and follow the prompts to create your own userdocker-compose upCtrl+COccasionally, new package dependencies or schema changes will necessitate maintenance. To non-destructively update your development stack at any time:
docker-compose pulldocker-compose builddocker-compose run --rm django ./manage.py migrateThis configuration still uses Docker to run attached services in the background, but allows developers to run Python code on their native system.
docker-compose -f ./docker-compose.yml up -dpsycopg2 build prerequisitespip install -e .[dev]source ./dev/source-native-env.sh./manage.py migrate./manage.py createsuperuser and follow the prompts to create your own userdocker-compose -f ./docker-compose.yml up -d is still activesource ./dev/source-native-env.sh./manage.py runserversource ./dev/source-native-env.shcelery worker --app dandi.celery --loglevel info --without-heartbeatdocker-compose stopAttached services may be exposed to the host system via alternative ports. Developers who work on multiple software projects concurrently may find this helpful to avoid port conflicts.
To do so, before running any docker-compose commands, set any of the environment variables:
DOCKER_POSTGRES_PORTDOCKER_RABBITMQ_PORTDOCKER_MINIO_PORTThe Django server must be informed about the changes:
DJANGO_MINIO_STORAGE_MEDIA_URL, using the port from DOCKER_MINIO_PORT.DJANGO_DATABASE_URL, using the port from DOCKER_POSTGRES_PORTDJANGO_CELERY_BROKER_URL, using the port from DOCKER_RABBITMQ_PORTDJANGO_MINIO_STORAGE_ENDPOINT, using the port from DOCKER_MINIO_PORTSince most of Django's environment variables contain additional content, use the values from
the appropriate dev/.env.docker-compose* file as a baseline for overrides.
tox is used to execute all tests.
tox is installed automatically with the dev package extra.
When running the "Develop with Docker" configuration, all tox commands must be run as
docker-compose run --rm django tox; extra arguments may also be appended to this form.
Run tox to launch the full test suite.
Individual test environments may be selectively run. This also allows additional options to be be added. Useful sub-commands include:
tox -e lint: Run only the style checkstox -e type: Run only the type checkstox -e test: Run only the pytest-driven testsTo automatically reformat all code to comply with
some (but not all) of the style checks, run tox -e format.
dandiarchivedandiarchive is another application and will need to be setup and run separately.
dandiarchive Girder client using the publish admin account. If
you followed the README it will be located at http://localhost:8080/.
publish for publishing to work properly. If an admin account with that username doesn't exist, it must be created.DJANGO_DANDI_GIRDER_API_KEY
and DJANGO_DANDI_GIRDER_API_URL.dandi-publish as described above.NOTE: dandiarchive also needs to be configured to connect to dandi-publish. See its README for instructions.
Read-only API endpoints (i.e. GET, HEAD) do not require any
authentication. All other endpoints require token authentication
to call.
Visit the URL /admin/authtoken/token/add/ with a web browser, logging
in with the credentials entered during the createsuperuser setup step.
Select your user from the drop-down, and click SAVE. Copy the token value
from the KEY column in the token listing.
In API endpoint calls, add the Authorization HTTP header with a value of
Token <token_value>. For example, for a token 1234, include the header:
Authorization: Token 1234.
Content type
Image
Digest
Size
138.6 MB
Last updated
about 6 years ago
docker pull dandiarchive/dandiarchive-publish