From 72e6acbd92bfb99e274e190edb4ef742a157cbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9lita=20Makanda?= Date: Sat, 11 May 2024 02:18:15 +0200 Subject: [PATCH] fix(static): replace staticfiles => static --- courses/templates/404.html | 2 +- courses/templates/about.html | 2 +- courses/templates/base.html | 2 +- courses/templates/base2.html | 2 +- courses/templates/courses/course/detail.html | 2 +- courses/templates/courses/course/list.html | 2 +- courses/templates/courses/manage/course/list.html | 2 +- courses/templates/registration/edit.html | 2 +- courses/templates/registration/login.html | 2 +- courses/templates/registration/password_change_form.html | 2 +- .../templates/registration/password_reset_confirm.html | 2 +- courses/templates/registration/password_reset_form.html | 2 +- courses/templates/registration/signup.html | 2 +- courses/templates/registration/signup_form.html | 2 +- myelearning/settings.py | 2 +- myelearning/settings_production.py | 8 +++++++- staticfiles/robots.txt | 0 students/templates/students/contact/contact_form.html | 2 +- students/templates/students/user/detail.html | 2 +- 19 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 staticfiles/robots.txt diff --git a/courses/templates/404.html b/courses/templates/404.html index 6f3a694..ee38ed4 100644 --- a/courses/templates/404.html +++ b/courses/templates/404.html @@ -1,5 +1,5 @@ {% extends "base2.html" %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block title %} {% trans '404 - Page Not Found' %} diff --git a/courses/templates/about.html b/courses/templates/about.html index d4cf48f..0655ac6 100644 --- a/courses/templates/about.html +++ b/courses/templates/about.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load widget_tweaks %} -{% load staticfiles %} +{% load static %} {% block title %} {% trans 'About us' %} {% endblock %} diff --git a/courses/templates/base.html b/courses/templates/base.html index 995771f..12dbe5f 100644 --- a/courses/templates/base.html +++ b/courses/templates/base.html @@ -1,4 +1,4 @@ -{% load staticfiles %} +{% load static %} {% load flatpages %} {% load i18n %} {% load gravatar %} diff --git a/courses/templates/base2.html b/courses/templates/base2.html index f680be9..d22a8a5 100644 --- a/courses/templates/base2.html +++ b/courses/templates/base2.html @@ -1,4 +1,4 @@ -{% load staticfiles %} +{% load static %} {% load flatpages %} {% load i18n %} {% load gravatar %} diff --git a/courses/templates/courses/course/detail.html b/courses/templates/courses/course/detail.html index eb8a170..2368648 100644 --- a/courses/templates/courses/course/detail.html +++ b/courses/templates/courses/course/detail.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load gravatar %} {% block title %} {{ object.title }} diff --git a/courses/templates/courses/course/list.html b/courses/templates/courses/course/list.html index 844bedf..69ae74b 100644 --- a/courses/templates/courses/course/list.html +++ b/courses/templates/courses/course/list.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block title %} {% if subject %} {{ subject.title }} {% trans 'courses' %} diff --git a/courses/templates/courses/manage/course/list.html b/courses/templates/courses/manage/course/list.html index 1aceea2..69ae0e6 100644 --- a/courses/templates/courses/manage/course/list.html +++ b/courses/templates/courses/manage/course/list.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block title %}{% trans "My courses"%}{% endblock %} {% block content %} diff --git a/courses/templates/registration/edit.html b/courses/templates/registration/edit.html index 3d37634..db128d8 100644 --- a/courses/templates/registration/edit.html +++ b/courses/templates/registration/edit.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% load widget_tweaks %} {% block title %}{% trans 'Edit your account' %}{% endblock %} diff --git a/courses/templates/registration/login.html b/courses/templates/registration/login.html index 9fb1663..1460987 100644 --- a/courses/templates/registration/login.html +++ b/courses/templates/registration/login.html @@ -1,7 +1,7 @@ {% extends "base2.html" %} {% load i18n %} {% load widget_tweaks %} -{% load staticfiles %} +{% load static %} {% block title %}{% trans 'Log In' %}{% endblock %} {% block content %}
diff --git a/courses/templates/registration/password_change_form.html b/courses/templates/registration/password_change_form.html index e5db557..fb7e87c 100644 --- a/courses/templates/registration/password_change_form.html +++ b/courses/templates/registration/password_change_form.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load widget_tweaks %} {% block title %}{% trans 'Change your password' %}{% endblock %} diff --git a/courses/templates/registration/password_reset_confirm.html b/courses/templates/registration/password_reset_confirm.html index 655a5c7..0ab1a90 100644 --- a/courses/templates/registration/password_reset_confirm.html +++ b/courses/templates/registration/password_reset_confirm.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% load widget_tweaks %} {% block title %}{% trans 'Reset your password' %}{% endblock %} diff --git a/courses/templates/registration/password_reset_form.html b/courses/templates/registration/password_reset_form.html index 1f5d0d3..9e31b8f 100644 --- a/courses/templates/registration/password_reset_form.html +++ b/courses/templates/registration/password_reset_form.html @@ -1,5 +1,5 @@ {% extends 'base2.html' %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% load widget_tweaks %} {% block title %}{% trans 'Reset your password' %}{% endblock %} diff --git a/courses/templates/registration/signup.html b/courses/templates/registration/signup.html index fc2b300..71b9ef1 100644 --- a/courses/templates/registration/signup.html +++ b/courses/templates/registration/signup.html @@ -1,6 +1,6 @@ {% extends "base2.html" %} {% load i18n %} -{% load staticfiles %} +{% load static %} {% block title %}{% trans 'Sign up' %}{% endblock %} {% block content %}
diff --git a/courses/templates/registration/signup_form.html b/courses/templates/registration/signup_form.html index faf8036..9f33f2e 100644 --- a/courses/templates/registration/signup_form.html +++ b/courses/templates/registration/signup_form.html @@ -1,6 +1,6 @@ {% extends "base2.html" %} {% load widget_tweaks %} -{% load staticfiles %} +{% load static %} {% load i18n %} {% block title %} {% trans 'Sign up as' %} {{ user_type }} diff --git a/myelearning/settings.py b/myelearning/settings.py index c4b5a8a..347e38b 100644 --- a/myelearning/settings.py +++ b/myelearning/settings.py @@ -26,7 +26,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', 'True', cast=bool) -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['*'] # Application definition diff --git a/myelearning/settings_production.py b/myelearning/settings_production.py index 8b60a87..56ba2a5 100644 --- a/myelearning/settings_production.py +++ b/myelearning/settings_production.py @@ -33,14 +33,20 @@ # SECURE_SSL_REDIRECT = True # CSRF_COOKIE_SECURE = True +SESSION_EXPIRE_SECONDS = 18000 # 5 hours + # Configure Redis for caching results +CACHE_MIDDLEWARE_SECONDS = 60 * 10 # 10 minutes +CACHE_MIDDLEWARE_KEY_PREFIX = 'myelearning' +CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": config("HEROKU_REDIS_AQUA_URL"), "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient" + "CLIENT_CLASS": "django_redis.client.DefaultClient", + "MAX_ENTRIES": 1000, }, "KEY_PREFIX": "myelearning", "TIMEOUT": 300 diff --git a/staticfiles/robots.txt b/staticfiles/robots.txt new file mode 100644 index 0000000..e69de29 diff --git a/students/templates/students/contact/contact_form.html b/students/templates/students/contact/contact_form.html index c60dfcd..4282937 100644 --- a/students/templates/students/contact/contact_form.html +++ b/students/templates/students/contact/contact_form.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load i18n %} {% load widget_tweaks %} -{% load staticfiles %} +{% load static %} {% block title %} {% trans 'Feeback' %} {% endblock %} diff --git a/students/templates/students/user/detail.html b/students/templates/students/user/detail.html index cbce41b..795b814 100644 --- a/students/templates/students/user/detail.html +++ b/students/templates/students/user/detail.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load staticfiles %} +{% load static %} {% load gravatar %} {% load badges_tags %} {% load i18n %}