diff --git a/app/settings/common.py b/app/settings/common.py index 9a6fc4b..d8001fe 100644 --- a/app/settings/common.py +++ b/app/settings/common.py @@ -173,5 +173,6 @@ RATELIMIT_CACHE_BACKEND = "app.brake_backend.BrakeBackend" SITENAME = "Phantas.ma" URL = "https://phantas.ma" +TELEGRAM_CHANNEL = "/" SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') diff --git a/app/urls.py b/app/urls.py index 99316a5..e58e187 100644 --- a/app/urls.py +++ b/app/urls.py @@ -27,6 +27,7 @@ urlpatterns = [ path('robots.txt', views.robots_txt, name='robots_txt'), path('sitemap.xml', views.sitemap_xml, name='sitemap_xml'), path('atom.xml', item_views.atom_xml, name='atom_xml'), + path('telegram/', views.telegram, name='telegram'), path('login/', user_views.login, name='login'), path('logout/', user_views.logout, name='logout'), path('register/', user_views.register, name='register'), diff --git a/app/views.py b/app/views.py index b45738f..4b3c94c 100644 --- a/app/views.py +++ b/app/views.py @@ -1,8 +1,9 @@ import xml.etree.ElementTree as ET -from django.utils.timezone import datetime, timedelta -from django.shortcuts import render +from django.conf import settings from django.http import HttpResponse +from django.shortcuts import render, redirect +from django.utils.timezone import datetime, timedelta def robots_txt(request): @@ -65,3 +66,6 @@ def sitemap_xml(request): data = b'\n' + ET.tostring(urlset) return HttpResponse(data, 'application/xml') + +def telegram(request): + return redirect(settings.TELEGRAM_CHANNEL)