add form of selection

This commit is contained in:
Alejandro Diaz 2023-09-12 15:51:16 -06:00
parent 6d138ed9b7
commit 93be13ccd1
12 changed files with 92 additions and 13 deletions

View file

@ -77,7 +77,7 @@ WSGI_APPLICATION = 'homemanager.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'NAME': '/tmp/db.sqlite3',
}
}
@ -117,6 +117,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = 'static/'
STATIC_ROOT = '/tmp/static'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

View file

@ -18,7 +18,6 @@ from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('main.urls')),
path("accounts/", include("django.contrib.auth.urls")),
]

View file

@ -8,9 +8,19 @@ https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from pathlib import Path
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'homemanager.settings')
data = Path("/tmp/db.sqlite3")
if not data.is_file():
from django.core.management import call_command
os.environ.setdefault('DJANGO_SUPERUSER_PASSWORD', 'password')
call_command("migrate --noinput")
call_command("collectstatic --noinput")
call_command("createsuperuser --noinput --username adp --email a@a.com")
call_command("createsuperuser --noinput --username fabian --email b@a.com")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()