This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
from django import forms | |
from django.conf import settings | |
from django.utils.translation import gettext_lazy as _ | |
from friendly_captcha.fields import FrcCaptchaField | |
from contact.models import Filter, ContactMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -name \settings.py -exec sed -i '' -e "s|'bootstrap4',|'django_bootstrap5',|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4\/bootstrap4.html|django_bootstrap5\/bootstrap5.html|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_extra_head|bootstrap5_extra_head|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_extra_script|bootstrap5_extra_script|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_title|bootstrap5_title|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|bootstrap4_content|bootstrap5_content|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s| bootstrap4 | django_bootstrap5 |g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-toggle=|data-bs-toggle=|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-dismiss=|data-bs-dismiss=|g" {} \; | |
find . -type f -name \*.html -exec sed -i '' -e "s|data-targe=|data-bs-targe=|g" {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GroupRequiredMixin(AccessMixin): | |
group_required = None | |
def get_group_required(self): | |
"""Get which group's membership is required""" | |
if any([ | |
self.group_required is None, | |
not isinstance(self.group_required, (list, tuple, str)) | |
]): | |
raise ImproperlyConfigured( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.conf import settings | |
from request.middleware import RequestMiddleware | |
class RequestProxyMiddleware(RequestMiddleware): | |
""" | |
Place this middleware to your project directory and | |
replace the django-request request.middleware.RequestMiddleware | |
with this middleware in the settings MIDDLEWARE |