Django REST Framework backend for the Coderr training project at Developer Akademie.
This repository contains the backend only. Development is in progress.
- Django project configuration in
core - SQLite database
- Environment-based settings
- DRF token authentication configured
- CORS configured for the local frontend
- Django administration
- Basic user profile model
- Five automated profile model tests
Registration, login and the remaining business API endpoints are not implemented yet.
- Python 3.14
- Git
- Windows CMD for the commands below
Development currently uses Python 3.14.3.
Exact package versions are listed in requirements.txt.
Download or clone this backend repository and open CMD in its root
directory, which contains manage.py.
Create and activate a virtual environment:
python -m venv .venv
.venv\Scripts\activate.batInstall the dependencies:
python -m pip install -r requirements.txt
python -m pip checkCreate your local environment file:
copy .env.example .envRun this copy command only when setting up a new environment.
Do not overwrite an existing .env containing your local settings.
Generate a secret key:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"Copy the generated value into DJANGO_SECRET_KEY in .env.
Keep the surrounding single quotes and never commit the real key.
The environment variables are:
| Variable | Purpose |
|---|---|
DJANGO_SECRET_KEY |
Secret key used by Django |
DJANGO_DEBUG |
Local debugging; use True for development |
DJANGO_ALLOWED_HOSTS |
Comma-separated backend hostnames |
DJANGO_CORS_ALLOWED_ORIGINS |
Comma-separated frontend origins |
Check the configuration and apply migrations:
python manage.py check
python manage.py migrateCreate a local administrator:
python manage.py createsuperuserStart the development server:
python manage.py runserverOpen the administration interface:
The development server is intended for local development only.
The provided frontend is maintained separately:
https://github.com/Developer-Akademie-Backendkurs/project.Coderr
The current local frontend origin is:
http://127.0.0.1:5500
CORS applies to paths beginning with /api/.
The origin must match the browser address, including protocol, hostname
and port. Do not include a page path such as /index.html.
CORS configuration alone does not implement API endpoints. Full frontend integration is still pending.
Run all tests:
python manage.py testRun the accounts tests with detailed output:
python manage.py test accounts_app --verbosity 2Django creates a separate test database. These tests do not modify the local development database or its administrator account.
The current model tests cover:
- Linking a customer profile to its user
- An initially empty profile upload timestamp
- Empty strings for optional profile text fields
- At most one profile per user
- Deleting a user's profile with that user while preserving other accounts
Postman collection and environment files are available in postman/.
Import both JSON files and select the Coderr Local environment.
The initial collection contains two CORS preflight requests with ten automated checks. Both requests passed in a local collection run. Business API tests will be added as the endpoints are implemented.
See postman/README.md for setup and execution instructions.
accounts_app/
api/
migrations/
admin.py
apps.py
models.py
tests.py
views.py
core/
settings.py
urls.py
asgi.py
wsgi.py
manage.py
requirements.txt
.env.example
.gitignore
API implementations will be placed inside each app's api directory.
The generated accounts_app/views.py is currently unused.
The following remain local and must not be committed:
.env.venv/db.sqlite3and its temporary files- Uploaded files in
media/ - Collected static files in
staticfiles/
Migration files and requirements.txt belong in version control.
Media paths are configured, but profile image uploads and development media serving are not implemented yet.