Closed simonw closed 2 months ago
Tried this out and it's pretty nice. Here's the settings.py
for the tests in that branch:
import djp
SECRET_KEY = "django-insecure-test-key"
DEBUG = True
ALLOWED_HOSTS = ["*"]
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
]
MIDDLEWARE = []
ROOT_URLCONF = "tests.test_project.urls"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
}
]
USE_TZ = True
djp.settings(globals())
Currently you have to do this:
That
djp.settings(globals())
line at the end could automatically do the things that thedjp.installed_apps()
and djp.middleware()` lines do.User would still need to modify
urls.py
but simplifying setup in this way would help avoid accidental misconfiguration and make things easier.