django-init
is a Django 3 starting template that allows you to kickstart a project without setup hassle and complexity, while maintaining a best practice project structure with up to date dependencies.
- Django 3 (
Django>=3.0
) - Python (
python:3.8-slim
) - MariaDB server/client (
mariadb:10.5-focal
) sqlite3
(default, see settings.py)netcat
as a dependency ofwait-for
requirements.txt
- Custom default User (Django 3 implementation)
- .env file support (https://github.com/joke2k/django-environ)
- The username is the email address (How do you like this?)
- Preconfigured settings for SMTP, MySQL, sqlite3, caching, ...
- i18n enabled and substituted
datetime.now()
bytimezone.now()
- "hello world" view and template
This template is preconfigured to work with docker-compose
out of the box (see docker-compose.yml).
For best performance, the executed code is mounted host authoritive (cached
) while the MySQL data files are mounted container authoritive (delegated
).
$ git clone https://github.com/flowl/django-init
$ cd django-init/
$ make build
Copy the .env.dist
file to .env
and set a random token for SECRET_KEY
.
Apply initial migrations:
$ make migrate
Create a superuser and the cache table:
$ make cachetable
$ make superuser
Start:
$ make start
$ make log
Visit http://localhost:8070
.
If you have traefik
installed, you can also go to http://djangoinit.localhost
straight.
The admin url is http://djangoinit.localhost/en/admin/
Please edit apps/Application/settings.py
and
.env
respectively:
SECRET_KEY
,AUTH_PASSWORD_VALIDATORS
DEBUG
,ALLOWED_HOSTS
DATABASES
(MySQL container and sqlite3)CACHES
(using MySQL)EMAIL_BACKEND
and SMTP settings
See the Makefile
for available commands.
https://github.com/flowl/django-init
Maintained by Daniel Wendler.
Distributed under the MIT License.