[project] start with minimal project
mainly, so we have a `manage.py` script
This commit is contained in:
parent
28f7db8b72
commit
3603d26f1e
4 changed files with 66 additions and 0 deletions
0
src/dx/__init__.py
Normal file
0
src/dx/__init__.py
Normal file
47
src/dx/settings.py
Normal file
47
src/dx/settings.py
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
from pathlib import Path
|
||||||
|
from configurations import Configuration
|
||||||
|
|
||||||
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
|
class Base(Configuration):
|
||||||
|
DEBUG = False
|
||||||
|
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||||
|
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
"dx",
|
||||||
|
]
|
||||||
|
|
||||||
|
ROOT_URLCONF = "dx.urls"
|
||||||
|
|
||||||
|
SECRET_KEY = "django-insecure-cbgvn=orgh$&6l-w91pp2=(b#hjwe1z&ijwiafgt(py1lq5i85"
|
||||||
|
|
||||||
|
TEMPLATES = [
|
||||||
|
{
|
||||||
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
|
"DIRS": [BASE_DIR / "templates"],
|
||||||
|
"APP_DIRS": True,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
USE_TZ = True
|
||||||
|
|
||||||
|
|
||||||
|
class Dev(Base):
|
||||||
|
# Dangerous: disable host header validation
|
||||||
|
ALLOWED_HOSTS = ["*"]
|
||||||
|
|
||||||
|
DATABASES = {
|
||||||
|
"default": {
|
||||||
|
"ENGINE": "django.db.backends.sqlite3",
|
||||||
|
"NAME": "db.sqlite3",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG = True
|
||||||
|
|
||||||
|
INSTALLED_APPS = Base.INSTALLED_APPS + ["django_extensions"]
|
||||||
|
|
||||||
|
|
||||||
|
class Local(Dev):
|
||||||
|
pass
|
1
src/dx/urls.py
Normal file
1
src/dx/urls.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
urlpatterns = []
|
18
src/manage.py
Executable file
18
src/manage.py
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
"""Django's command-line utility for administrative tasks."""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dx.settings")
|
||||||
|
os.environ.setdefault("DJANGO_CONFIGURATION", "Base")
|
||||||
|
|
||||||
|
from configurations.management import execute_from_command_line
|
||||||
|
|
||||||
|
execute_from_command_line(sys.argv)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in a new issue