mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-05-23 17:15:50 +00:00
Add Django4.2 support
This commit is contained in:
parent
e9e866a289
commit
6b634a541f
2 changed files with 14 additions and 7 deletions
12
.github/workflows/django.yml
vendored
12
.github/workflows/django.yml
vendored
|
|
@ -26,6 +26,9 @@ jobs:
|
|||
- python-version: "3.8"
|
||||
django-version: Django==4.0
|
||||
|
||||
- python-version: "3.8"
|
||||
django-version: Django==4.2
|
||||
|
||||
- python-version: "3.9"
|
||||
django-version: Django==2.2
|
||||
|
||||
|
|
@ -35,12 +38,21 @@ jobs:
|
|||
- python-version: "3.9"
|
||||
django-version: Django==4.0
|
||||
|
||||
- python-version: "3.9"
|
||||
django-version: Django==4.2
|
||||
|
||||
- python-version: "3.10"
|
||||
django-version: Django==3.2
|
||||
|
||||
- python-version: "3.10"
|
||||
django-version: Django==4.0
|
||||
|
||||
- python-version: "3.10"
|
||||
django-version: Django==4.2
|
||||
|
||||
- python-version: "3.11"
|
||||
django-version: Django==4.2
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
import re
|
||||
|
||||
from django import VERSION as DJANGO_VERSION
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth import login as auth_login
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.contrib.sites.models import Site
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
from django.core.cache import caches
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
|
|
@ -136,10 +134,7 @@ def login(request, template_name='registration/login.html',
|
|||
|
||||
request.session.set_test_cookie()
|
||||
|
||||
if Site._meta.installed:
|
||||
current_site = Site.objects.get_current()
|
||||
else:
|
||||
current_site = RequestSite(request)
|
||||
current_site = get_current_site(request)
|
||||
|
||||
context = {
|
||||
'form': form,
|
||||
|
|
|
|||
Loading…
Reference in a new issue