Erste Datenstruktur angelegt. CSV-Import vorbereitet.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
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'
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from rest_framework.authtoken.views import obtain_auth_token
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
|
||||
# API Endpunkte
|
||||
path('api/v1/auth/', include([
|
||||
# Hier kommen später unsere Login/Register Viewsets hin
|
||||
path('token/', obtain_auth_token, name='api-token'),
|
||||
])),
|
||||
|
||||
path('api/v1/accounts/', include('accounts.urls')),
|
||||
path('api/v1/tournaments/', include('tournaments.urls')),
|
||||
]
|
||||
o
|
||||
|
||||
Reference in New Issue
Block a user