Coderr Django Backend Project - DA
Django backend for Coderr Frontend.
- Python 3.10+ (project used 3.13 on this machine)
- Git
- Windows (commands below use Windows CMD / PowerShell)
Start with Cloning the repo, then...
-
Create and activate virtualenv
- CMD:
python -m venv .venv .venv\Scripts\activate - PowerShell:
python -m venv .venv .venv\Scripts\Activate.ps1
- CMD:
-
Install dependencies
pip install -r requirements.txtIf requirements.txt is missing, install the basics:
pip install django djangorestframework djangorestframework-authtoken pytest pytest-django -
Configure optional settings environment (you can run the Project without these setting, default values given in settings.py will be used then.)
set DJANGO_SETTINGS_MODULE=core.settings -
Database migrations
python manage.py migrate -
Create superuser
python manage.py createsuperuser -
Run development server
python manage.py runserver
- Ensure pytest-django is installed and pytest.ini contains:
[pytest] DJANGO_SETTINGS_MODULE = core.settings python_files = tests.py test_*.py *_tests.py - Run tests:
pytest -q
- REST framework uses TokenAuthentication by default (see core/settings.py).
- For production set DEBUG=False, configure ALLOWED_HOSTS and a proper SECRET_KEY.
- Collect static files for production:
python manage.py collectstatic --noinput