Commit 258968ca authored by rexxnor's avatar rexxnor

cleared db, removed secret, added genscript and unprivileged report view

parent 94cf427a
......@@ -107,3 +107,4 @@ Session.vim
.netrwhist
*~
*.png
secret.txt
......@@ -21,5 +21,7 @@ urlpatterns = [
url(r'^error/$', views.error),
url(r'^priceentry/$', views.priceentry),
url(r'^checkbal/$', views.checkbal),
path('periodreport/<int:report_id>/',
views.PeriodReport.as_view()),
# archives which are probably unnecessary as already viewable in admin
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
#!/bin/bash
# This generates a secret key file
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 64 > secret.txt
......@@ -15,17 +15,13 @@ import os
# 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/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'kbk!)(9r^(521*(lqce4=o80vg^16uzl%+0y_+@)7hfnm@b2-z'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['10.0.0.186', 'localhost', '127.0.0.1', '147.87.16.57']
ALLOWED_HOSTS = ['10.20.20.3', 'localhost', '127.0.0.1', '147.87.16.57']
# Application definition
......@@ -133,6 +129,17 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'prepaid/static/')
# Security Stuff
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
CSRF_COOKIE_SECURE = True
X_FRAME_OPTIONS = "DENY"
# Needs to have TLS enabled for this!!
# SESSION_COOKIE_SECURE = True
# Secret key generated by gen_safe_secret.sh
with open(os.path.join(BASE_DIR, 'prepaidmatewebsite/secret.txt')) as f:
SECRET_KEY = f.read().strip()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment