68 lines
1.9 KiB
Python
68 lines
1.9 KiB
Python
import os
|
|
from pathlib import Path
|
|
from dotenv import load_dotenv
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
load_dotenv(BASE_DIR / ".env")
|
|
|
|
SECRET_KEY = os.getenv("SECRET_KEY", "django-insecure-dev-only-change-me")
|
|
DEBUG = os.getenv("DEBUG", "true").lower() in ("1", "true", "yes")
|
|
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "*").split(",")
|
|
TEMPLATES = [
|
|
{
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
"DIRS": [],
|
|
"APP_DIRS": True,
|
|
"OPTIONS": {
|
|
"context_processors": [
|
|
"django.template.context_processors.request",
|
|
"django.contrib.auth.context_processors.auth",
|
|
"django.contrib.messages.context_processors.messages",
|
|
],
|
|
},
|
|
},
|
|
]
|
|
MIDDLEWARE = [
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
|
]
|
|
INSTALLED_APPS = [
|
|
"django.contrib.admin",
|
|
"django.contrib.contenttypes",
|
|
"django.contrib.auth",
|
|
"django.contrib.sessions",
|
|
"django.contrib.messages",
|
|
"rest_framework",
|
|
"rest_framework.authtoken",
|
|
"requirements",
|
|
"submissions",
|
|
]
|
|
DATABASES = {
|
|
"default": {
|
|
"ENGINE": "django.db.backends.sqlite3",
|
|
"NAME": ":memory:",
|
|
}
|
|
}
|
|
LLM_MODE = "default"
|
|
LLM_BASE_URL = ""
|
|
LLM_API_KEY = "sk-test"
|
|
LLM_MODEL = "test-model"
|
|
MAX_UPLOAD_SIZE_MB = 200
|
|
STABILITY_BASE_DURATION = 30
|
|
STABILITY_RAMPUP_DURATION = 60
|
|
STABILITY_CONCURRENCY = 20
|
|
WORKSPACE_DIR = Path(__file__).parent / "workspace"
|
|
ROOT_URLCONF = "ojplatform.urls"
|
|
REST_FRAMEWORK = {
|
|
"DEFAULT_AUTHENTICATION_CLASSES": [
|
|
"rest_framework.authentication.SessionAuthentication",
|
|
"rest_framework.authentication.TokenAuthentication",
|
|
],
|
|
"DEFAULT_PERMISSION_CLASSES": [
|
|
"rest_framework.permissions.IsAuthenticated",
|
|
],
|
|
}
|
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
USE_TZ = True
|