some cleanup
This commit is contained in:
parent
11b26e79f5
commit
8b2ac3b68c
@ -1,8 +0,0 @@
|
||||
DEBUG=1
|
||||
ALLOWED_HOSTS=*
|
||||
SECRET_KEY=
|
||||
POSTGRES_HOST=db_recipes
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_USER=djangodb
|
||||
POSTGRES_PASSWORD=
|
||||
POSTGRES_DB=djangodb
|
@ -1,3 +1,12 @@
|
||||
VIRTUAL_HOST=
|
||||
LETSENCRYPT_HOST=
|
||||
LETSENCRYPT_EMAIL=
|
||||
LETSENCRYPT_EMAIL=
|
||||
|
||||
DEBUG=1
|
||||
ALLOWED_HOSTS=*
|
||||
SECRET_KEY=
|
||||
POSTGRES_HOST=db_recipes
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_USER=djangodb
|
||||
POSTGRES_PASSWORD=
|
||||
POSTGRES_DB=djangodb
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -73,10 +73,7 @@ venv/
|
||||
|
||||
\.idea/recipes\.iml
|
||||
|
||||
recipes/settings\.py
|
||||
|
||||
# Deployment
|
||||
|
||||
\.env
|
||||
\.env\.secret
|
||||
staticfiles/
|
||||
|
@ -2,11 +2,11 @@ version: "3"
|
||||
services:
|
||||
db_recipes:
|
||||
restart: always
|
||||
image: "postgres:10.3-alpine"
|
||||
image: "postgres:11-alpine"
|
||||
volumes:
|
||||
- /usr/src/recipes/postgresql:/var/lib/postgresql/data
|
||||
- ./postgresql:/var/lib/postgresql/data
|
||||
env_file:
|
||||
- ./.env.secret
|
||||
- ./.env
|
||||
networks:
|
||||
- default
|
||||
|
||||
@ -14,7 +14,7 @@ services:
|
||||
build: .
|
||||
restart: always
|
||||
env_file:
|
||||
- ./.env.secret
|
||||
- ./.env
|
||||
command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi"
|
||||
volumes:
|
||||
- .:/Recipes
|
||||
@ -33,8 +33,8 @@ services:
|
||||
- ./staticfiles:/static
|
||||
- ./mediafiles:/media
|
||||
networks:
|
||||
- default
|
||||
- nginx-proxy
|
||||
- default
|
||||
- nginx-proxy
|
||||
|
||||
networks:
|
||||
default:
|
||||
|
@ -11,19 +11,18 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
|
||||
"""
|
||||
import os
|
||||
from django.contrib import messages
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
||||
|
||||
# Get vars from .env files
|
||||
SECRET_KEY = os.getenv('SECRET_KEY')
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
DEBUG = bool(int(os.getenv('DEBUG', False)))
|
||||
# Get vars from .env files
|
||||
SECRET_KEY = os.getenv('SECRET_KEY') if os.getenv('SECRET_KEY') else '728f4t5438rz0748fa89esf9e'
|
||||
|
||||
DEBUG = bool(int(os.getenv('DEBUG', True)))
|
||||
|
||||
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS').split(',') if os.getenv('ALLOWED_HOSTS') else []
|
||||
|
||||
@ -31,6 +30,7 @@ LOGIN_REDIRECT_URL = "index"
|
||||
LOGOUT_REDIRECT_URL = "index"
|
||||
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
||||
DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html'
|
||||
|
||||
MESSAGE_TAGS = {
|
||||
messages.ERROR: 'danger'
|
||||
@ -87,15 +87,14 @@ WSGI_APPLICATION = 'recipes.wsgi.application'
|
||||
|
||||
# Database
|
||||
# Load settings from env files
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'ENGINE': os.getenv('DB_ENGINE') if os.getenv('DB_ENGINE') else 'django.db.backends.sqlite3',
|
||||
'HOST': os.getenv('POSTGRES_HOST'),
|
||||
'PORT': os.getenv('POSTGRES_PORT'),
|
||||
'USER': os.getenv('POSTGRES_USER'),
|
||||
'PASSWORD': os.getenv('POSTGRES_PASSWORD'),
|
||||
'NAME': os.getenv('POSTGRES_DB'),
|
||||
'NAME': os.getenv('POSTGRES_DB') if os.getenv('POSTGRES_DB') else 'db.sqlite3',
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +121,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
|
||||
LANGUAGE_CODE = 'DE-de'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
TIME_ZONE = 'Europe/Berlin'
|
||||
|
||||
USE_I18N = True
|
||||
|
Loading…
Reference in New Issue
Block a user