[PYTHON] Django + Docker command

Introduction

In this article, I've summarized the commands used in Django + Docker development.

startproject This is the command to start the project.

terminal


#Build and start at the same time
#-The d option means to start in the background
$ docker-compose up -d --build

terminal


$ docker-compose run web django-admin.py startproject project name.

runserver-like command

Django's runserver-like command.

terminal


#At the very beginning, type this in and build
$ docker-compose up --build

terminal


$ docker-compose up

Erase all Torima

It will stop the container and delete the image on the network and volume as well.

terminal


$ docker-compose down --rmi all --volumes

Make an app

This is the command for creating a new app.

terminal


$ docker-compose run --rm web django-admin startapp app name

migration

terminal


$ docker-compose run --rm web python3 manage.py makemigrations

My Great

terminal


$ docker-compose run --rm web python3 manage.py migrate

Create user

You will need it to log in to the management screen.

terminal


$ docker-compose run --rm web python3 manage.py createsuperuser

Get rid of old networks

terminal


$ docker system prune -a

Stop container

terminal


$ docker-compose down -v

Finally

I will add it in the future, so I hope it will be helpful.

Recommended Posts

Django + Docker command
Docker command summary
Django command completion settings
Django
Docker + Django + React environment construction
[Learning memo] Django command summary
[Note] [For myself] Django command
Deploy a Django application with Docker
Completion of docker command on Linux
[Django] Command to output QuerySet to csv
Django Management Command Duplicate Launch Decorator
Command list such as Docker / Kubernetes
django update
Django note 4
Linux command # 4
Django memorandum
Linux command # 3
django search
Django installation
Command memorandum
Django Summary
nkf command
Docker installation
vim command
Django # 2 (template)
Django Note 5
Django hands-on
Touch django
django notes
Django basics
sed command
Django Shoho
Django defaults
Linux command # 5
grep command
command memo
Django Glossary
top command
Django search
Install Django
Command memorandum
Command memo
Django: References
Django Note 1
Django note 3
mv command
Django note 2
seq command
Django startup
Django notes
Django NullCharField
Build Django + NGINX + PostgreSQL development environment with Docker
Make Django's environment Docker (Docker + Django + Gunicorn + nginx) Part 2
In Django, display batch (command) results sequentially in HTML
How to reflect ImageField in Django + Docker (pillow)
[Python] Build a Django development environment with Docker
Make Django's environment Docker (Docker + Django + Gunicorn + nginx) Part 3