diff --git a/cookbook/templates/base.html b/cookbook/templates/base.html
index 6e5a3d2e1..0fd405d51 100644
--- a/cookbook/templates/base.html
+++ b/cookbook/templates/base.html
@@ -118,7 +118,7 @@
{% if user.is_authenticated %}
- -
+
-
{% trans 'History' %}
{% if user.is_superuser %}
+
+ {% trans 'System' %}
{% trans 'Admin' %}
{% endif %}
diff --git a/cookbook/templates/system.html b/cookbook/templates/system.html
new file mode 100644
index 000000000..22ec003a1
--- /dev/null
+++ b/cookbook/templates/system.html
@@ -0,0 +1,66 @@
+{% extends "base.html" %}
+{% load static %}
+{% load i18n %}
+
+{% block title %}{% trans "Cookbook Setup" %}{% endblock %}
+
+{% block extra_head %}
+ {{ form.media }}
+{% endblock %}
+
+{% block content %}
+
+
{% trans 'System Information' %}
+
+ {% blocktrans %}
+ Django Recipes is an open source free software application. It can be found on GitHub.
+ Changelogs can be found here.
+ {% endblocktrans %}
+
+
+
+
+ {% trans 'Media Serving' %} {% if gunicorn_media %}
+ {% trans 'Warning' %}{% else %}{% trans 'Ok' %}{% endif %}
+ {% if gunicorn_media %}
+ {% blocktrans %}Serving media files directly using gunicorn/python is not recommend!
+ Please follow the steps described
+ here to update
+ your installation.
+ {% endblocktrans %}
+ {% else %}
+ {% trans 'Everything is fine!' %}
+ {% endif %}
+
+
+
+ {% trans 'Debug Mode' %} {% if debug %}
+ {% trans 'Warning' %}{% else %}{% trans 'Ok' %}{% endif %}
+ {% if debug %}
+ {% blocktrans %}
+ This application is still running in debug mode. This is most likely not needed. Turn of debug mode by
+ setting
+ DEBUG=0 int the .env configuration file.
+ {% endblocktrans %}
+ {% else %}
+ {% trans 'Everything is fine!' %}
+ {% endif %}
+
+
+
+ {% trans 'Database' %} {% if postgres %}
+ {% trans 'Info' %}{% else %}{% trans 'Ok' %}{% endif %}
+ {% if postgres %}
+ {% blocktrans %}
+ This application is not running with a Postgres database backend. This is ok but not recommended as some
+ features only work with postgres databases.
+ {% endblocktrans %}
+ {% else %}
+ {% trans 'Everything is fine!' %}
+ {% endif %}
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/cookbook/urls.py b/cookbook/urls.py
index e1124759c..50e247280 100644
--- a/cookbook/urls.py
+++ b/cookbook/urls.py
@@ -9,6 +9,7 @@ from cookbook.helper import dal
urlpatterns = [
path('', views.index, name='index'),
path('setup/', views.setup, name='view_setup'),
+ path('system/', views.system, name='view_system'),
path('search/', views.search, name='view_search'),
path('books/', views.books, name='view_books'),
path('plan/', views.meal_plan, name='view_plan'),
diff --git a/cookbook/views/views.py b/cookbook/views/views.py
index 88db8c07b..9f3766e47 100644
--- a/cookbook/views/views.py
+++ b/cookbook/views/views.py
@@ -264,6 +264,12 @@ def history(request):
return render(request, 'history.html', {'view_log': view_log, 'cook_log': cook_log})
+@group_required('admin')
+def system(request):
+ postgres = False if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql_psycopg2' else True
+ return render(request, 'system.html', {'gunicorn_media': settings.GUNICORN_MEDIA, 'debug': settings.DEBUG, 'postgres': postgres})
+
+
def setup(request):
if User.objects.count() > 0 or 'django.contrib.auth.backends.RemoteUserBackend' in settings.AUTHENTICATION_BACKENDS:
messages.add_message(request, messages.ERROR, _('The setup page can only be used to create the first user! If you have forgotten your superuser credentials please consult the django documentation on how to reset passwords.'))