Add favicons and secret settings import.
This commit is contained in:
parent
d71bed2a3c
commit
cd8f6354fe
2
.gitignore
vendored
2
.gitignore
vendored
@ -13,3 +13,5 @@ postgres_data/*
|
|||||||
static_volume/*
|
static_volume/*
|
||||||
|
|
||||||
!**/.gitkeep
|
!**/.gitkeep
|
||||||
|
|
||||||
|
secrets.json
|
||||||
|
BIN
app/blog/static/blog/images/favicon/android-chrome-192x192.png
Normal file
BIN
app/blog/static/blog/images/favicon/android-chrome-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
BIN
app/blog/static/blog/images/favicon/android-chrome-512x512.png
Normal file
BIN
app/blog/static/blog/images/favicon/android-chrome-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
app/blog/static/blog/images/favicon/apple-touch-icon.png
Normal file
BIN
app/blog/static/blog/images/favicon/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.4 KiB |
BIN
app/blog/static/blog/images/favicon/favicon-16x16.png
Normal file
BIN
app/blog/static/blog/images/favicon/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 467 B |
BIN
app/blog/static/blog/images/favicon/favicon-32x32.png
Normal file
BIN
app/blog/static/blog/images/favicon/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 938 B |
BIN
app/blog/static/blog/images/favicon/favicon.ico
Normal file
BIN
app/blog/static/blog/images/favicon/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
1
app/blog/static/blog/images/favicon/site.webmanifest
Normal file
1
app/blog/static/blog/images/favicon/site.webmanifest
Normal file
@ -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"}
|
@ -24,6 +24,10 @@ Also all needes JavaScript and CSS is laoded here.-->
|
|||||||
{% else %}
|
{% else %}
|
||||||
<title>Bundesdata</title>
|
<title>Bundesdata</title>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="{% static "blog/images/favicon/apple-touch-icon.png" %}">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="{% static "blog/images/favicon/favicon-32x32.png" %}">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="{% static "blog/images/favicon/favicon-16x16.png" %}">
|
||||||
|
<link rel="manifest" href="{% static "blog/images/favicon/site.webmanifest" %}>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="blue-grey lighten-5">
|
<body class="blue-grey lighten-5">
|
||||||
|
@ -10,23 +10,43 @@ For the full list of settings and their values, see
|
|||||||
https://docs.djangoproject.com/en/2.1/ref/settings/
|
https://docs.djangoproject.com/en/2.1/ref/settings/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
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
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# 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!
|
# This is just some random genearted key to test the App. If you want to set up
|
||||||
SECRET_KEY = '=7n(1!he%todz-)jo))$upf0(vor9v9ke5rn&fli%6l562!_=0'
|
# 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!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
|
ALLOWED_HOSTS = ["127.0.0.1", "localhost", ]
|
||||||
|
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
@ -82,13 +102,15 @@ WSGI_APPLICATION = 'bundesdata_app.wsgi.application'
|
|||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
|
# 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 = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
'NAME': 'databaseName',
|
'NAME': 'databaseName',
|
||||||
'USER': 'databaseUserName',
|
'USER': get_secret("DB_USER"),
|
||||||
'PASSWORD': 'totalSecurePassword',
|
'PASSWORD': get_secret("DB_PASSWORD"),
|
||||||
'HOST': 'db',
|
'HOST': 'db',
|
||||||
'PORT': '5432',
|
'PORT': '5432',
|
||||||
}
|
}
|
||||||
|
5
app/secrets_example.json
Normal file
5
app/secrets_example.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"SECRET_KEY": "=7n(1!he%todz-)jo))$upf0(vor9v9ke5rn&fli%6l562!_=0",
|
||||||
|
"DB_PASSWORD": "v3ry53cr3t"
|
||||||
|
"DB_USER": "bundesdata_app_user"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user