This is the simplest configuration for developers to start with.
- Run
docker-compose run --rm django ./manage.py migrate
- Run
docker-compose run --rm django ./manage.py createsuperuser
and follow the prompts to create your own user
- Run
docker-compose up
- When finished, use
Ctrl+C
Occasionally, new package dependencies or schema changes will necessitate maintenance. To non-destructively update your development stack at any time:
- Run
docker-compose pull
- Run
docker-compose build
- Run
docker-compose run --rm django ./manage.py migrate
This configuration still uses Docker to run attached services in the background, but allows developers to run the Python code on their native system.
- Run
docker-compose -f ./docker-compose.yml up -d
- Install Python 3.8
- Install
psycopg2
build prerequisites - Create and activate a new Python virtualenv
- Run
pip install -e .
- Run
source ./dev/source-native-env.sh
- Run
./manage.py migrate
- Run
./manage.py createsuperuser
and follow the prompts to create your own user
- Run (in separate windows) both:
./manage.py runserver
celery worker --app dandi.celery --loglevel info --without-heartbeat
- When finished, run
docker-compose stop
dandiarchive
is another application and will need to be setup and run separately.
- Login to the
dandiarchive
Girder client using thepublish
admin account. If you followed the README it will be located athttp://localhost:8080/
.- NOTE: the username of the Girder admin account used here must be
publish
for publishing to work properly. If an admin account with that username doesn't exist, it must be created.
- NOTE: the username of the Girder admin account used here must be
- Navigate to account settings, click on the 'API keys' tab, and generate an API key.
- Save this API key and the Girder client URL in environment variables named
DJANGO_DANDI_GIRDER_API_KEY
andDJANGO_DANDI_GIRDER_API_URL
. - Run
dandi-publish
as described above.
NOTE: dandiarchive
also needs to be configured to connect to dandi-publish
. See its README for instructions.
Tox is required to execute all tests.
It may be installed with pip install tox
.
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 checks.tox -e type
: Run only the type checks.tox -e test
: Run only the unit tests.
To automatically reformat all code to comply with
some (but not all) of the style checks, run tox -e format
.
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
.