Skip to content

datonli/django-mysql-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django and MySQL on Docker

Installation for dev

  1. Copy .env.dev.exemple to .env.dev and edit values.
DEBUG=1
SECRET_KEY=generate-key-here    # CHANGE THIS
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 0.0.0.0 [::1]      
DATABASE=mysql
SQL_ENGINE=django.db.backends.mysql
SQL_PORT=3306
SQL_DATABASE=mydb               # name of the database
SQL_ROOT_PASSWORD=rootpassword  # CHANGE THIS
SQL_USER=myuser                 # do not use 'root'
SQL_PASSWORD=myuserpassword     # CHANGE THIS
SQL_HOST=db
  1. Run docker compose --env-file .env.dev up --build

  2. Create superuser : docker exec -it django-web python manage.py createsuperuser

  3. Visit http://localhost:8000 or http://localhost:8000/admin

About

A ready to use Django & MySQL database on Docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.8%
  • Dockerfile 12.3%
  • Shell 5.9%