first phase of the project management dashboard
This commit is contained in:
+18
-4
@@ -1,27 +1,41 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
SECRET_KEY = "django-insecure-local-design-showcase-only"
|
||||
DEBUG = True
|
||||
ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
|
||||
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', 'django-insecure-local-development-only')
|
||||
DEBUG = os.environ.get('DJANGO_DEBUG', '1') == '1'
|
||||
ALLOWED_HOSTS = os.environ.get('DJANGO_ALLOWED_HOSTS', 'localhost,127.0.0.1').split(',')
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages',
|
||||
"django.contrib.contenttypes",
|
||||
"django.contrib.staticfiles",
|
||||
"core",
|
||||
'projects',
|
||||
]
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
]
|
||||
ROOT_URLCONF = "config.urls"
|
||||
TEMPLATES = [{
|
||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||
"DIRS": [],
|
||||
"APP_DIRS": True,
|
||||
"OPTIONS": {"context_processors": ["django.template.context_processors.request"]},
|
||||
"OPTIONS": {"context_processors": ['django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'projects.context_processors.navigation']},
|
||||
}]
|
||||
WSGI_APPLICATION = "config.wsgi.application"
|
||||
ASGI_APPLICATION = "config.asgi.application"
|
||||
STATIC_URL = "static/"
|
||||
STATICFILES_DIRS = [BASE_DIR / "dist"] if (BASE_DIR / "dist").exists() else []
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3'}}
|
||||
LOGIN_URL = 'login'
|
||||
LOGIN_REDIRECT_URL = 'projects:list'
|
||||
LOGOUT_REDIRECT_URL = 'login'
|
||||
CSRF_COOKIE_SECURE = not DEBUG
|
||||
SESSION_COOKIE_SECURE = not DEBUG
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||
+8
-1
@@ -1,7 +1,14 @@
|
||||
from django.urls import path
|
||||
from django.urls import path, include
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.contrib import admin
|
||||
from core import views
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('accounts/login/', auth_views.LoginView.as_view(template_name='projects/login.html'), name='login'),
|
||||
path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'),
|
||||
path('accounts/password/change/', auth_views.PasswordChangeView.as_view(template_name='projects/form.html', success_url='/projects/profile/'), name='password_change'),
|
||||
path('projects/', include('projects.urls')),
|
||||
path("", views.today, name="today"),
|
||||
path("health/", views.health, name="health"),
|
||||
path("energy/", views.energy, name="energy"),
|
||||
|
||||
Reference in New Issue
Block a user