diff --git a/.gitignore b/.gitignore index 81564fd..dc4957a 100755 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ postgres_data/* static_volume/* !**/.gitkeep + +secrets.json diff --git a/app/blog/static/blog/images/favicon/android-chrome-192x192.png b/app/blog/static/blog/images/favicon/android-chrome-192x192.png new file mode 100644 index 0000000..a2a04fb Binary files /dev/null and b/app/blog/static/blog/images/favicon/android-chrome-192x192.png differ diff --git a/app/blog/static/blog/images/favicon/android-chrome-512x512.png b/app/blog/static/blog/images/favicon/android-chrome-512x512.png new file mode 100644 index 0000000..0879944 Binary files /dev/null and b/app/blog/static/blog/images/favicon/android-chrome-512x512.png differ diff --git a/app/blog/static/blog/images/favicon/apple-touch-icon.png b/app/blog/static/blog/images/favicon/apple-touch-icon.png new file mode 100644 index 0000000..539260e Binary files /dev/null and b/app/blog/static/blog/images/favicon/apple-touch-icon.png differ diff --git a/app/blog/static/blog/images/favicon/favicon-16x16.png b/app/blog/static/blog/images/favicon/favicon-16x16.png new file mode 100644 index 0000000..92211f0 Binary files /dev/null and b/app/blog/static/blog/images/favicon/favicon-16x16.png differ diff --git a/app/blog/static/blog/images/favicon/favicon-32x32.png b/app/blog/static/blog/images/favicon/favicon-32x32.png new file mode 100644 index 0000000..033fab4 Binary files /dev/null and b/app/blog/static/blog/images/favicon/favicon-32x32.png differ diff --git a/app/blog/static/blog/images/favicon/favicon.ico b/app/blog/static/blog/images/favicon/favicon.ico new file mode 100644 index 0000000..3d370b1 Binary files /dev/null and b/app/blog/static/blog/images/favicon/favicon.ico differ diff --git a/app/blog/static/blog/images/favicon/site.webmanifest b/app/blog/static/blog/images/favicon/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/app/blog/static/blog/images/favicon/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file diff --git a/app/blog/templates/blog/base.html b/app/blog/templates/blog/base.html index cb87017..915df5c 100755 --- a/app/blog/templates/blog/base.html +++ b/app/blog/templates/blog/base.html @@ -24,6 +24,10 @@ Also all needes JavaScript and CSS is laoded here.--> {% else %} Bundesdata {% endif %} + + + + diff --git a/app/bundesdata_app/settings.py b/app/bundesdata_app/settings.py index dce17b0..039b935 100755 --- a/app/bundesdata_app/settings.py +++ b/app/bundesdata_app/settings.py @@ -10,23 +10,43 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ +import json import os +from django.core.exceptions import ImproperlyConfigured + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +# Loads json files with secrets. Follow this example to create your own secrets +# file with SECRET_KEY and other information. +# Example https://stackoverflow.com/a/42077576 +with open(os.path.join(BASE_DIR, 'secrets.json')) as secrets_file: + secrets = json.load(secrets_file) + + +def get_secret(setting, secrets=secrets): + """Get secret setting or fail with ImproperlyConfigured""" + try: + return secrets[setting] + except KeyError: + raise ImproperlyConfigured("Set the {} setting".format(setting)) + + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -# This is just some random genearted key to test the App. If you want to set up your own running public version of this app replace this key with an new one that you will keep secret! -SECRET_KEY = '=7n(1!he%todz-)jo))$upf0(vor9v9ke5rn&fli%6l562!_=0' +# This is just some random genearted key to test the App. If you want to set up +# your own running public version of this app replace this key with an new one +# that you will keep secret! +SECRET_KEY = get_secret("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ["127.0.0.1", "localhost"] +ALLOWED_HOSTS = ["127.0.0.1", "localhost", ] # Application definition @@ -82,13 +102,15 @@ WSGI_APPLICATION = 'bundesdata_app.wsgi.application' # Database # https://docs.djangoproject.com/en/2.1/ref/settings/#databases -# Changes NAME, USER and PASSWORD details before deploying your own public version of this app. +# Change NAME, USER and PASSWORD details before deploying your own public +# version of this app. Or use your onw secrets.json file. Explanation found can +# be foudn here: https://stackoverflow.com/a/42077576 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'databaseName', - 'USER': 'databaseUserName', - 'PASSWORD': 'totalSecurePassword', + 'USER': get_secret("DB_USER"), + 'PASSWORD': get_secret("DB_PASSWORD"), 'HOST': 'db', 'PORT': '5432', } diff --git a/app/secrets_example.json b/app/secrets_example.json new file mode 100644 index 0000000..6ac0e48 --- /dev/null +++ b/app/secrets_example.json @@ -0,0 +1,5 @@ +{ + "SECRET_KEY": "=7n(1!he%todz-)jo))$upf0(vor9v9ke5rn&fli%6l562!_=0", + "DB_PASSWORD": "v3ry53cr3t" + "DB_USER": "bundesdata_app_user" +}