Lors du développement, Docker doit être actif et une instance de développement doit être active (voir section dédiée).

Create a new app

mkdir apps/new-app
docker-compose exec web python startapp new-app apps/new-app

Add in file in INSTALLED_APPS.

Composition of a Django application

A Django application is mainly composed:

  • A file which will be the functions that will allow to send data to web pages

  • Template files: which will receive data and display them. These files are in HTML format

  • A file which gathers all the addresses of the application to make the templates accessible from a web browser

  • A file to write all the unit and functional test functions

  • A file which contains the definition of the database tables (which will be translated into SQL in our case)

  • An file to add a data table in the Django administration page

Make migrations in database

docker-compose exec web python makemigrations
docker-compose exec web python migrate