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=
|
VIRTUAL_HOST=
|
||||||
LETSENCRYPT_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
|
\.idea/recipes\.iml
|
||||||
|
|
||||||
recipes/settings\.py
|
|
||||||
|
|
||||||
# Deployment
|
# Deployment
|
||||||
|
|
||||||
\.env
|
\.env
|
||||||
\.env\.secret
|
|
||||||
staticfiles/
|
staticfiles/
|
||||||
|
@ -2,11 +2,11 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
db_recipes:
|
db_recipes:
|
||||||
restart: always
|
restart: always
|
||||||
image: "postgres:10.3-alpine"
|
image: "postgres:11-alpine"
|
||||||
volumes:
|
volumes:
|
||||||
- /usr/src/recipes/postgresql:/var/lib/postgresql/data
|
- ./postgresql:/var/lib/postgresql/data
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env.secret
|
- ./.env
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
restart: always
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env.secret
|
- ./.env
|
||||||
command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi"
|
command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/Recipes
|
- .:/Recipes
|
||||||
@ -33,8 +33,8 @@ services:
|
|||||||
- ./staticfiles:/static
|
- ./staticfiles:/static
|
||||||
- ./mediafiles:/media
|
- ./mediafiles:/media
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
- nginx-proxy
|
- nginx-proxy
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
@ -11,19 +11,18 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
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
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
||||||
|
|
||||||
# Get vars from .env files
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
SECRET_KEY = os.getenv('SECRET_KEY')
|
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 []
|
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"
|
LOGOUT_REDIRECT_URL = "index"
|
||||||
|
|
||||||
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
CRISPY_TEMPLATE_PACK = 'bootstrap4'
|
||||||
|
DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html'
|
||||||
|
|
||||||
MESSAGE_TAGS = {
|
MESSAGE_TAGS = {
|
||||||
messages.ERROR: 'danger'
|
messages.ERROR: 'danger'
|
||||||
@ -87,15 +87,14 @@ WSGI_APPLICATION = 'recipes.wsgi.application'
|
|||||||
|
|
||||||
# Database
|
# Database
|
||||||
# Load settings from env files
|
# Load settings from env files
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'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'),
|
'HOST': os.getenv('POSTGRES_HOST'),
|
||||||
'PORT': os.getenv('POSTGRES_PORT'),
|
'PORT': os.getenv('POSTGRES_PORT'),
|
||||||
'USER': os.getenv('POSTGRES_USER'),
|
'USER': os.getenv('POSTGRES_USER'),
|
||||||
'PASSWORD': os.getenv('POSTGRES_PASSWORD'),
|
'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'
|
LANGUAGE_CODE = 'DE-de'
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = 'Europe/Berlin'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user