Provides usefull data for terra projects.
On Ubuntu, do not use the system packages, which are too old.
- docker-ce: https://docs.docker.com/install/linux/docker-ce/ubuntu/
- docker-compose:
sudo pip3 install docker-compose
Create a docker.env file and edit the django settings
cp docker.env.dist docker.env
cp src/project/settings/local.py.dist src/project/settings/local.py
Add ALLOWED_HOSTS = ['*']
in local settings.
After setted the django settings and docker.env, to run with docker, just type :
$ docker-compose up
docker-compose run --rm django /code/venv/bin/python3.6 ./manage.py migrate
docker-compose run --rm django /code/venv/bin/python3.6 ./manage.py createsuperuser
In project/settings/local.py
, you could overrides permissions for REST framework, just uncomment these lines:
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ()
}
After setted the netrc and docker.env, to run with docker, just type :
$ docker-compose start
To have pdb support launch django container with
docker-compose run --rm --service-ports django
Run
pytest