This is a django starter template for fast developing!
This repository is a minimal Django starter template that includes all the basic tools and settings to start fast the developing of a new Django project.
Includes:
- Django project (
core/) ready for user - Support for environment variables with
django-environ - Development tools:
- Black → formatting
- isort → sort imports
- flake8 → linting
- pytest + pytest-django → testing
- mypy → optional type checking
- ipython → debugging shell
- Makefile commands for:
- format code (
make format) - lint (
make lint) - run tests (
make tests) - type check (
make typecheck) - showmigrations (
make show) - run Django server (
make run) - migrate (
make migrate) - Django shell (
make shell)
- format code (
git clone https://github.com/gethgr/django-starter.git myprojectcd myprojectThis project requires Python 3.12.x, includes a .python-version file with 3.12.0 version set.
- Option A: Set Python version (using pyenv, Recommended)
If you use pyenv, make sure the required Python version is installed. Verify Python version, if installed continue to step 3:
python --versionOtherwise install it using:
pyenv install 3.12.0- Option B: Without pyenv
Make sure you have Python 3.12.x installed on your system. Verify Python version
python --versionIf multiple Python versions are installed, tell Poetry which one to use:
poetry env use python3.12poetry installcp .env.example .env.dev (or your preferred name)-Edit .env and set your project specific values:
- SECRET_KEY -> set you own secret key
- DEBUG -> True for development
- ALLOWED_HOSTS -> e.g. 127.0.0.1
- DATABASE_URL -> optional, if using PostgreSQL, othewise SQLite is used by default for development
This starter template requires PostgreSQL for production. Make sure you have PostgreSQL installed and running.
- The main project folder is core
- You can rename it if desired
- All tools (mypy, black, isort, flake8) will still work if core/ remains the root app