- Python 3.10 (optional, development should be done in the provided Docker environment)
- Docker Desktop (or Docker Compose)
Note: update the environment variables in env folder before running the following commands:
cd <project-folder>
docker-compose build
docker-compose up # or "docker-compose up -d" to run in detached modeGo to http://localhost:8081
If you don't have a DigitalOcean account yet, create one using my referral link.
- Create a Domain and add an
A recordpointing to your Droplet. - Inside your Droplet, create an SSL certificate:
certbot --nginx -d <domain>- Edit the nginx configuration (usually /etc/nginx/sites-available/default) and update the
location /block just below the domain created by certbot (look forserver_name <domain>; # managed by Certbot):
location / {
proxy_pass http://127.0.0.1:8081$request_uri;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}
- Reload nginx:
service nginx reloadTo scale up, add --scale web=N parameter. For example:
docker-compose up --scale web=3poetry run python manage.py makemessages -l <language_code>
# edit and translate locale/<language_code>/LC_MESSAGES/django.poGo in the web container by doing
docker exec -it combio_web bash
You can then run the following commands.
python manage.py tailwind start- starts the tailwind watcher, which recompiles the css file on every changepython manage.py collectstatic --no-input- creates the static files, necessary to update the css file used by the templates
python manage.py loaddummydata- loads dummy test data
python manage.py search_index --rebuild- rebuilds the elasticsearch index
python manage.py createsuperuser- creates a super user, necessary to access the admin area at /admin
Use the Makefile included for running different development tasks:
make install- installs the packages needed for development.make build- build application.make start- start application.make format- runsautoflake,isortandblackfor fixing coding style.make lint- runsautoflake,isort,black,flake8andmypychecks.make test- run unit tests.make migrations- generate migration scripts, if applicable.make migrate- run migrations, if applicable.make superuser- create superuser.make messages- update messages.make compilemessages- compile messages.make dumpdata- backup data.make loaddata- load data from backup.

