bdd181425b
Docker Compose project with automated Playwright benchmarks comparing django-liveview 2.2.0 against Phoenix LiveView 1.0 across 6 scenarios.
64 lines
1.5 KiB
Python
64 lines
1.5 KiB
Python
import os
|
|
import dj_database_url
|
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
SECRET_KEY = os.environ.get("SECRET_KEY", "dev-insecure-key")
|
|
DEBUG = os.environ.get("DEBUG", "true").lower() == "true"
|
|
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "localhost,127.0.0.1").split(",")
|
|
|
|
INSTALLED_APPS = [
|
|
"django.contrib.contenttypes",
|
|
"django.contrib.staticfiles",
|
|
"channels",
|
|
"liveview",
|
|
"app",
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
"django.middleware.security.SecurityMiddleware",
|
|
"django.middleware.common.CommonMiddleware",
|
|
]
|
|
|
|
ROOT_URLCONF = "config.urls"
|
|
|
|
TEMPLATES = [
|
|
{
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
"DIRS": [os.path.join(BASE_DIR, "templates")],
|
|
"APP_DIRS": True,
|
|
"OPTIONS": {
|
|
"context_processors": [
|
|
"django.template.context_processors.request",
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
ASGI_APPLICATION = "config.asgi.application"
|
|
|
|
DATABASES = {
|
|
"default": dj_database_url.config(
|
|
default="postgresql://benchmark:benchmark@localhost/django_benchmark",
|
|
conn_max_age=600,
|
|
)
|
|
}
|
|
|
|
CHANNEL_LAYERS = {
|
|
"default": {
|
|
"BACKEND": "channels_redis.core.RedisChannelLayer",
|
|
"CONFIG": {
|
|
"hosts": [os.environ.get("REDIS_URL", "redis://localhost:6379/0")],
|
|
},
|
|
}
|
|
}
|
|
|
|
STATIC_URL = "/static/"
|
|
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
|
|
|
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
|
|
LANGUAGE_CODE = "en-us"
|
|
TIME_ZONE = "UTC"
|
|
USE_TZ = True
|