deployment

This commit is contained in:
gw3000 2023-07-12 11:52:48 +02:00
parent 75765d85db
commit 5fa3dfdafb
4 changed files with 23 additions and 12 deletions

View file

@ -11,8 +11,12 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
"""
import os
import environ
from pathlib import Path
env = environ.Env()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@ -24,10 +28,12 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = ")g-j2v+*dvjtnz)q-3+*y7*lq$el$im8p^wr@2v$g^u99quq50"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# DEBUG = True
DEBUG = env('DEBUG')
ALLOWED_HOSTS = []
# ALLOWED_HOSTS = []
ALLOWED_HOSTS = env('DJANGO_ALLOWED_HOSTS', default=[])
# Application definition
@ -65,6 +71,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
@ -108,12 +115,13 @@ DATABASES = {
"default": {
# "ENGINE": "django.db.backends.sqlite3",
# "NAME": BASE_DIR / "db.sqlite3",
"ENGINE": "django.db.backends.postgresql",
"NAME": "django_traefik",
"USER": "django_traefik",
"PASSWORD": "django_traefik",
"HOST": "db",
"PORT": "5432",
# "ENGINE": "django.db.backends.postgresql",
# "NAME": "django_traefik",
# "USER": "django_traefik",
# "PASSWORD": "django_traefik",
# "HOST": "db",
# "PORT": "5432",
'default': env.db(),
}
}
@ -158,6 +166,7 @@ USE_TZ = True
STATIC_URL = "static/"
STATICFILES_DIRS = [BASE_DIR / "static"]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

View file

@ -1,10 +1,12 @@
Django>=4.2
django-environ>=0.9
crispy-bootstrap5>=0.6
django-allauth>=0.50
django-bootstrap-datepicker-plus>=4.0
django-bootstrap-modal-forms>=2
django-crispy-forms>=1
django-jazzmin>=2.6.0
environ>=1
gunicorn>=20.1
names>=0.3.0
psycopg2-binary>=2.9