Skip to content
Public template

About

This is intended to be used as a template repository for django projects running with docker and docker-compose

Resources

Stars

4 stars

Watchers

2 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

docker-django

This is intended to be used as a template repository for django projects running with docker and docker-compose


Building & commands

Your first step is start building your project with the following line

docker-compose run web django-admin startproject djangoexample .

Database settings change to your select DB

Go to your settings.py inside the project folder created in previous steps and modify it accordingly your database settings. Here an example:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'django',
        'USER': 'userdjango',
        'PASSWORD': 'passworddjango',
        'HOST': 'db',
        'PORT': 3306,
    }
}

then create your own pages with

docker-compose run web python manage.py startapp polls

Alwys remember to run the migrate command

docker-compose run web python manage.py migrate

If you want to create a new super user

docker-compose run web python manage.py createsuperuser

and finally just docker-compose up

docker-compose up

About

This is intended to be used as a template repository for django projects running with docker and docker-compose

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages