Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove not needed CSRF token #1582

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion interface/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
<button class="active-language" disabled>{{lang.name_local}}</button>
{% else %}
<form action="/change_language/" method="post">
{% csrf_token %}
<input type="hidden" name="previous-page" value="{{request.path}}"/>
<input type="hidden" name="language" value="{{language.0}}"/>
<button>{{lang.name_local}}</button>
Expand Down
6 changes: 0 additions & 6 deletions internetnl/internet.nl.dist.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ export SECRET_KEY=secret
export DJANGO_IS_PROXIED=True
### CSV String, the IPV6_TEST_ADDR is automatically added
export ALLOWED_HOSTS=.internet.nl,internet.nl
### String
export ADMIN_NAME=Administrator
### String, e-mail address
export [email protected]
### String, e-mail address
export [email protected]
### CSV String
export INTERNAL_IPS="localhost,127.0.0.1"
### String
Expand Down
13 changes: 0 additions & 13 deletions internetnl/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
# # and the option to Preserve the Host are set by your proxy.
DJANGO_IS_PROXIED = get_boolean_env("DJANGO_IS_PROXIED", False)
ALLOWED_HOSTS = split_csv_trim(getenv("ALLOWED_HOSTS", ".internet.nl, internet.nl"))
ADMIN_NAME = getenv("ADMIN_NAME", "Administrator")
ADMIN_EMAIL = getenv("ADMIN_EMAIL", "Administrator")
SERVER_EMAIL = getenv("SERVER_EMAIL", "[email protected]")
INTERNAL_IPS = split_csv_trim(getenv("INTERNAL_IPS", ""))
TIME_ZONE = getenv("TIME_ZONE", "UTC")

Expand Down Expand Up @@ -135,11 +132,7 @@
ALLOWED_HOSTS = ALLOWED_HOSTS + [IPV6_TEST_ADDR, f"[{IPV6_TEST_ADDR}]"]

INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django_bleach",
"markdown_deux",
Expand All @@ -156,13 +149,11 @@
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"django.template.context_processors.request",
],
"libraries": {"translate": "interface.templatetags.translate"},
Expand All @@ -178,15 +169,11 @@
"django_statsd.middleware.GraphiteRequestTimingMiddleware",
"django_statsd.middleware.GraphiteMiddleware",
"django_hosts.middleware.HostsRequestMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django_hosts.middleware.HostsResponseMiddleware",
"internetnl.custom_middlewares.ActivateTranslationMiddleware",
]

ADMINS = ((ADMIN_NAME, ADMIN_EMAIL),)
ROOT_URLCONF = "internetnl.urls"
ROOT_HOSTCONF = "internetnl.hosts"
DEFAULT_HOST = "www"
Expand Down
9 changes: 1 addition & 8 deletions internetnl/urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Copyright: 2022, ECP, NLnet Labs and the Internet.nl contributors
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
from django.urls import include, path, re_path
from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path("", include("interface.urls")),
]
handler404 = "interface.views.page404"

if settings.DEBUG is True:
urlpatterns += [
re_path(r"^admin/", admin.site.urls),
]
Loading