Django project structure

Django project structure

Explorer

  • .venv…, not committed
  • .git…
  • .gitignore
  • .python-version
  • .editorconfig
  • pyproject.toml
  • uv.lock
  • README.md
  • manage.py
  • db.sqlite3, not committed
  • .vscodenew
  • settings.jsonnew
  • extensions.jsonnew
  • launch.jsonnew
  • .devcontainernew
  • devcontainer.jsonnew
  • config
  • __init__.py
  • urls.py
  • api.pynew
  • logging.pynew
  • asgi.py
  • wsgi.py
  • accounts
  • __init__.py
  • admin.py
  • apps.py
  • models.py
  • urls.pynew
  • api.pynew
  • catalognew
  • __init__.pynew
  • admin.pynew
  • apps.pynew
  • models.pynew
  • selectors.pynew
  • serializers.pynew
  • api.pynew
  • orders
  • __init__.py
  • admin.py
  • apps.py
  • models.py
  • views.py
  • urls.py
  • forms.pynew
  • services.pynew
  • selectors.pynew
  • exceptions.pynew
  • permissions.pynew
  • tasks.pynew
  • serializers.pynew
  • api.pynew
  • corenew
  • __init__.pynew
  • apps.pynew
  • models.pynew
  • middleware.pynew
  • exceptions.pynew
  • pagination.pynew
  • templatesnew
  • base.htmlnew
  • staticnew
  • media…new, not committed
  • htmlcov…new, not committed
  • conftest.pynew
  • .envnew, not committed
  • .env.examplenew
  • compose.yamlnew
  • justfilenew
  • .pre-commit-config.yamlnew
  • AGENTS.mdnew
  • CLAUDE.mdnew
  1. # Create the project folder and add Django with uv

    uv init shop && cd shop && uv add django
  2. # Generate the config package and manage.py in the current folder

    uv run django-admin startproject config .
  3. # Create the custom user app before the first migrate

    uv run python manage.py startapp accounts
  4. # Create your first feature apps

    uv run python manage.py startapp catalog && uv run python manage.py startapp orders
  5. # Create the database tables and start the dev server

    uv run python manage.py makemigrations && uv run python manage.py migrate && uv run python manage.py runserver
  6. # Add the API, settings, tasks and test tools as the app grows

    uv add djangorestframework drf-spectacular django-environ django-tasks-db "psycopg[binary]" && uv add --dev pytest pytest-django factory-boy ruff mypy django-stubs