Skip to content
Closed
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
2 changes: 1 addition & 1 deletion cab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def get_form():
from captcha.fields import ReCaptchaField
from django_recaptcha.fields import ReCaptchaField
from django import forms
from django_comments.forms import CommentForm

2 changes: 1 addition & 1 deletion comments_spamfighter/admin.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

from django import forms
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugettext_lazy deprecated v3.0

Screenshot 2025-06-12 at 8 42 10 PM

from django.utils.translation import gettext_lazy as _

from .models import Keyword

2 changes: 1 addition & 1 deletion comments_spamfighter/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class Keyword(models.Model):
5 changes: 3 additions & 2 deletions djangosnippets/settings/base.py
Original file line number Diff line number Diff line change
@@ -53,15 +53,15 @@ def user_url(user):
"allauth",
"allauth.account",
"allauth.socialaccount",
"allauth.socialaccount.providers.bitbucket",
"allauth.socialaccount.providers.bitbucket_oauth2",
"allauth.socialaccount.providers.github",
"allauth.socialaccount.providers.twitter",
"base",
"cab",
"comments_spamfighter",
"ratings",
"taggit",
"captcha",
"django_recaptcha",
"django_extensions",
"rest_framework",
"django_htmx",
@@ -80,6 +80,7 @@ def user_url(user):
"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
"ratelimitbackend.middleware.RateLimitMiddleware",
"django_htmx.middleware.HtmxMiddleware",
"allauth.account.middleware.AccountMiddleware",
)

TEMPLATES = [
3 changes: 2 additions & 1 deletion djangosnippets/settings/testing.py
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django_htmx.middleware.HtmxMiddleware",
"allauth.account.middleware.AccountMiddleware",
)


@@ -24,7 +25,7 @@
"allauth",
"allauth.account",
"allauth.socialaccount",
"allauth.socialaccount.providers.bitbucket",
"allauth.socialaccount.providers.bitbucket_oauth2",
"allauth.socialaccount.providers.github",
"allauth.socialaccount.providers.twitter",
"base",
4 changes: 2 additions & 2 deletions ratings/views.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
from django.contrib.contenttypes.models import ContentType
from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseNotAllowed, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.http import is_safe_url
from django.utils.http import url_has_allowed_host_and_scheme
Copy link
Member Author

@Antoliny0919 Antoliny0919 Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_safe_url deprecated v3.0

Screenshot 2025-06-12 at 8 42 49 PM


# allow GET requests to create ratings -- this goes against the "GET" requests
# should be idempotent but avoids the necessity of using <form> elements or
@@ -17,7 +17,7 @@ def rate_object(request, ct, pk, score=1, add=True):
return HttpResponseNotAllowed('Invalid request method: "%s". ' "Must be POST." % request.method)

redirect_url = request.POST.get("next") or request.GET.get("next") or request.META.get("HTTP_REFERER")
if redirect_url and not is_safe_url(redirect_url, settings.ALLOWED_HOSTS):
if redirect_url and not url_has_allowed_host_and_scheme(redirect_url, settings.ALLOWED_HOSTS):
return HttpResponseBadRequest("Invalid next URL.")
if not redirect_url:
redirect_url = "/"
19 changes: 10 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
bleach==6.2.0
Django==3.2.15
Django==5.2.3
dj-database-url==0.5.0
django-allauth==0.50.0
django-contrib-comments==2.1.0
django-extensions==3.1.5
django-allauth==65.9.0
django-contrib-comments==2.2.0
django-extensions==4.1
django-generic-aggregation==0.4.0
django-ratelimit-backend==2.0
django-recaptcha==2.0.6
django-taggit==3.0.0
django-recaptcha==4.1.0
django-taggit==6.1.0
ipython==7.33.0
Markdown==3.4.4
Pillow==9.1.0
Pillow==11.2.1
Pygments==2.12.0
python-akismet==0.4.2
requests==2.26.0
six==1.15.0
urllib3==1.26.6
whitenoise==6.1.0
psycopg2-binary==2.9.3
djangorestframework==3.12.4
psycopg2-binary==2.9.10
djangorestframework==3.16.0
requests-oauthlib==1.4.1
django-htmx==1.15.0
gevent==22.10.2 # Updated version of gevent
greenlet==3.0.3 # Updated version of greenlet