Files
SchulSchachTV/config/settings.py
T

73 lines
1.8 KiB
Python

import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
# --- Security & Core ---
SECRET_KEY = 'dein_geheimer_schluessel_fuer_dev'
DEBUG = True # Im Produktivbetrieb auf False setzen!
ALLOWED_HOSTS = ['*']
# --- App Configuration ---
INSTALLED_APPS = [
# Standard Django
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# REST Framework & Tools
'rest_framework',
'django_filters',
# Unsere eigenen Apps
'accounts',
'tournaments',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
]
ROOT_URLCONF = 'config.urls'
# --- Database (SQLite) ---
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# --- Custom User Model (WICHTIG: Vorerstes Migration setzen!) ---
AUTH_USER_MODEL = 'accounts.User'
# --- REST Framework Settings ---
REST_FRAMEWORK = {
# Offene Sichtbarkeit (wie gewünscht)
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.AllowAny',
],
# Pagination für Übersichten (z.B. Spielertabelle)
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 20,
}
# --- Internationalization / Locale ---
LANGUAGE_CODE = 'de-de'
TIME_ZONE = 'Europe/Berlin'
USE_I18N = True
USE_TZ = True
STATIC_URL = 'static/'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'