This project is a template for a Django application that can be used as a base for new projects. It includes basic configurations and sample files to facilitate a quick start.
- Python 3.8 or higher
- Poetry for dependency management
- Virtual environment (optional, but recommended)
- Django 5.0.6 or higher
- Create a new directory for your project and navigate to it:
mkdir myproject cd myproject
- Set up your project using the copied template URL:
Replace
django-admin startproject project_name . --template https://github.com/AdamWiercioch95/django_template/archive/refs/heads/template.zip
project_name
with the desired name for your project.
- Use Poetry to install the project dependencies:
poetry install
- Open your project in your preferred code editor.
- Navigate to the
env
directory and create a.env
file based on the.env-default
file:cp env/.env-default env/.env
- Edit the
env/.env
file to fit your environment (e.g., database settings, API keys, etc.).
- Open the
pytest.ini
file and replace{{ project_name }}
with your project name:For example, if your project name is[pytest] DJANGO_SETTINGS_MODULE = {{ project_name }}.settings
myproject
, it should be:[pytest] DJANGO_SETTINGS_MODULE = myproject.settings
- To run the Django development server, use:
poetry run python manage.py runserver
- To run tests, use:
poetry run pytest