Add pylint to CI, production CD

This commit is contained in:
2021-05-29 07:30:22 -07:00
parent 8a6df6ac1f
commit abd1965285
11 changed files with 183 additions and 271 deletions

View File

@@ -15,8 +15,6 @@ from pathlib import Path
from dotenv import load_dotenv
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
@@ -29,7 +27,7 @@ load_dotenv()
SECRET_KEY = os.getenv('ACTRL_SECRET_KEY', 'empty')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(int(os.getenv('ACTRL_DEBUG', '1')))
DEBUG = bool(int(os.getenv('ACTRL_DEBUG', '0')))
ALLOWED_HOSTS = [
'127.0.0.1',
@@ -94,13 +92,24 @@ WSGI_APPLICATION = 'access_controller.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db' / 'zd_db.sqlite3'
if DEBUG:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db' / 'zd_db.sqlite3'
}
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('ACTRL_DB_NAME'),
'USER': os.getenv('ACTRL_DB_USER'),
'PASSWORD': os.getenv('ACTRL_DB_PASSWORD'),
'HOST': os.getenv('ACTRL_DB_HOST'),
'PORT': os.getenv('ACTRL_DB_PORT'),
}
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
@@ -137,7 +146,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticroot')
STATIC_ROOT = BASE_DIR / 'build' / 'webserver' / 'static'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]