1
0

Done some landing manipulations

This commit is contained in:
user
2018-01-05 15:34:01 +03:00
parent 64b5f39d41
commit fa7cb01c11
7 changed files with 13 additions and 4 deletions

4
.gitignore vendored
View File

@@ -55,6 +55,6 @@ docs/_build/
.idea/ .idea/
db.sqlite3 db.sqlite3
migrations/* app/migrations/*
!migrations/__init__.py !app/migrations/__init__.py
venv/ venv/

View File

@@ -1,3 +1,8 @@
from django.contrib import admin from django.contrib import admin
from django.contrib import admin
from app.models import Setting
# Register your models here. # Register your models here.
admin.site.register(Setting)

View File

@@ -5,9 +5,9 @@ from django.conf import settings
def get_setting(name, language=settings.LANGUAGE_CODE[:2]): def get_setting(name, language=settings.LANGUAGE_CODE[:2]):
try: try:
return Setting.objects.filter(name=name, language=language)[0].get().string return Setting.objects.filter(name=name, language=language)[0].string
except IndexError: except IndexError:
try: try:
return Setting.objects.filter(name=name)[0].get().string return Setting.objects.filter(name=name)[0].string
except IndexError: except IndexError:
return '<p class="error">Oops, setting {0} with language {1} not found!</p>'.format(name, language) return '<p class="error">Oops, setting {0} with language {1} not found!</p>'.format(name, language)

View File

@@ -12,4 +12,5 @@ def home(request):
'title': _('Home'), 'title': _('Home'),
'app_name': settings.APP_NAME, 'app_name': settings.APP_NAME,
'app_description_text': get_setting('app_description_text'), 'app_description_text': get_setting('app_description_text'),
'app_mainpage_html': get_setting('app_mainpage_html'),
}) })

0
manage.py Normal file → Executable file
View File

View File

@@ -4,6 +4,8 @@
body { body {
background-color: black; background-color: black;
color: lime; color: lime;
max-width: 800px;
margin: auto;
} }
::selection { ::selection {
color: black; color: black;

View File

@@ -9,4 +9,5 @@
</div> </div>
<br/> <br/>
<hr/> <hr/>
{{ app_mainpage_html|safe }}
{% endblock %} {% endblock %}