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

feat: update to django-4.2 #30

Open
wants to merge 2 commits into
base: master
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
1 change: 1 addition & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.common.BrokenLinkEmailsMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"allauth.account.middleware.AccountMiddleware",
]

# STATIC
Expand Down
1 change: 0 additions & 1 deletion elearner/contrib/sites/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = []

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@


class Migration(migrations.Migration):

dependencies = [("sites", "0001_initial")]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def update_site_backward(apps, schema_editor):


class Migration(migrations.Migration):

dependencies = [("sites", "0002_alter_domain_unique")]

operations = [migrations.RunPython(update_site_forward, update_site_backward)]
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@


class Migration(migrations.Migration):

dependencies = [
('sites', '0003_set_site_domain_and_name'),
("sites", "0003_set_site_domain_and_name"),
]

operations = [
migrations.AlterModelOptions(
name='site',
options={'ordering': ['domain'], 'verbose_name': 'site', 'verbose_name_plural': 'sites'},
name="site",
options={
"ordering": ["domain"],
"verbose_name": "site",
"verbose_name_plural": "sites",
},
),
]
1 change: 0 additions & 1 deletion elearner/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):

form = UserChangeForm
add_form = UserCreationForm
fieldsets = (
Expand Down
6 changes: 3 additions & 3 deletions elearner/users/apps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import contextlib

from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _

Expand All @@ -7,7 +9,5 @@ class UsersConfig(AppConfig):
verbose_name = _("Users")

def ready(self):
try:
with contextlib.suppress(ImportError):
import elearner.users.signals # noqa F401
except ImportError:
pass
1 change: 0 additions & 1 deletion elearner/users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [("auth", "0008_alter_user_username_max_length")]
Expand Down
1 change: 0 additions & 1 deletion elearner/users/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class UserFactory(DjangoModelFactory):

username = Faker("user_name")
email = Faker("email")
name = Faker("name")
Expand Down
3 changes: 0 additions & 3 deletions elearner/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class UserDetailView(LoginRequiredMixin, DetailView):

model = User
slug_field = "username"
slug_url_kwarg = "username"
Expand All @@ -19,7 +18,6 @@ class UserDetailView(LoginRequiredMixin, DetailView):


class UserUpdateView(LoginRequiredMixin, SuccessMessageMixin, UpdateView):

model = User
fields = ["name"]
success_message = _("Information successfully updated")
Expand All @@ -35,7 +33,6 @@ def get_object(self):


class UserRedirectView(LoginRequiredMixin, RedirectView):

permanent = False

def get_redirect_url(self):
Expand Down
16 changes: 16 additions & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pytz
python-slugify
Pillow
argon2-cffi
whitenoise
redis
hiredis

# Django
# ------------------------------------------------------------------------------
django
django-environ
django-model-utils
django-allauth
django-crispy-forms
django-redis
93 changes: 77 additions & 16 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,77 @@
pytz==2021.3 # https://github.com/stub42/pytz
python-slugify==5.0.2 # https://github.com/un33k/python-slugify
Pillow==8.3.2 # https://github.com/python-pillow/Pillow
argon2-cffi==21.1.0 # https://github.com/hynek/argon2_cffi
whitenoise==5.3.0 # https://github.com/evansd/whitenoise
redis==3.5.3 # https://github.com/andymccurdy/redis-py
hiredis==2.0.0 # https://github.com/redis/hiredis-py

# Django
# ------------------------------------------------------------------------------
django==3.1.13 # pyup: < 3.2 # https://www.djangoproject.com/
django-environ==0.7.0 # https://github.com/joke2k/django-environ
django-model-utils==4.1.1 # https://github.com/jazzband/django-model-utils
django-allauth==0.45.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==1.13.0 # https://github.com/django-crispy-forms/django-crispy-forms
django-redis==5.0.0 # https://github.com/jazzband/django-redis
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements/base.in
#
argon2-cffi==23.1.0
# via -r requirements/base.in
argon2-cffi-bindings==21.2.0
# via argon2-cffi
asgiref==3.7.2
# via django
certifi==2023.7.22
# via requests
cffi==1.16.0
# via
# argon2-cffi-bindings
# cryptography
charset-normalizer==3.3.0
# via requests
cryptography==41.0.4
# via pyjwt
defusedxml==0.7.1
# via python3-openid
django==4.2.6
# via
# -r requirements/base.in
# django-allauth
# django-crispy-forms
# django-model-utils
# django-redis
django-allauth==0.57.0
# via -r requirements/base.in
django-crispy-forms==2.1
# via -r requirements/base.in
django-environ==0.11.2
# via -r requirements/base.in
django-model-utils==4.3.1
# via -r requirements/base.in
django-redis==5.4.0
# via -r requirements/base.in
hiredis==2.2.3
# via -r requirements/base.in
idna==3.4
# via requests
oauthlib==3.2.2
# via requests-oauthlib
pillow==10.1.0
# via -r requirements/base.in
pycparser==2.21
# via cffi
pyjwt[crypto]==2.8.0
# via django-allauth
python-slugify==8.0.1
# via -r requirements/base.in
python3-openid==3.2.0
# via django-allauth
pytz==2023.3.post1
# via -r requirements/base.in
redis==5.0.1
# via
# -r requirements/base.in
# django-redis
requests==2.31.0
# via
# django-allauth
# requests-oauthlib
requests-oauthlib==1.3.1
# via django-allauth
sqlparse==0.4.4
# via django
text-unidecode==1.3
# via python-slugify
urllib3==2.0.7
# via requests
whitenoise==6.6.0
# via -r requirements/base.in
36 changes: 36 additions & 0 deletions requirements/local.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
-r base.txt

Werkzeug
ipdb
psycopg2
pip-tools

# Testing
# ------------------------------------------------------------------------------
mypy
django-stubs
pytest
pytest-sugar

# Documentation
# ------------------------------------------------------------------------------
sphinx
sphinx-autobuild

# Code quality
# ------------------------------------------------------------------------------
flake8
flake8-isort
coverage
black
pylint-django
pre-commit

# Django
# ------------------------------------------------------------------------------
factory-boy

django-debug-toolbar
django-extensions
django-coverage-plugin
pytest-django
Loading