From 30b00b35e42298b64d7bcf7d4894bde420a75c21 Mon Sep 17 00:00:00 2001 From: Niko Abeler Date: Sun, 11 Jun 2023 21:25:30 +0200 Subject: [PATCH] blacked --- .vscode/settings.json | 7 + guild/apps.py | 4 +- guild/forms.py | 5 - guild/migrations/0001_initial.py | 122 +++++++++++++----- ...source_alter_player_name_resourceearned.py | 65 +++++++--- guild/models.py | 55 +++++--- guild/templatetags/guild_extras.py | 5 +- guild/urls.py | 100 +++++++++++--- guild/views/__init__.py | 3 +- guild/views/adventure.py | 12 +- guild/views/character.py | 7 +- guild/views/player.py | 6 +- guild_journal/asgi.py | 2 +- guild_journal/settings.py | 74 +++++------ guild_journal/urls.py | 2 +- guild_journal/wsgi.py | 2 +- manage.py | 4 +- 17 files changed, 330 insertions(+), 145 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1d37a96 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.formatting.provider": "none", + "editor.formatOnSave": true, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, +} \ No newline at end of file diff --git a/guild/apps.py b/guild/apps.py index 6496492..4090f4c 100644 --- a/guild/apps.py +++ b/guild/apps.py @@ -2,5 +2,5 @@ from django.apps import AppConfig class GuildConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'guild' + default_auto_field = "django.db.models.BigAutoField" + name = "guild" diff --git a/guild/forms.py b/guild/forms.py index b0af882..239812f 100644 --- a/guild/forms.py +++ b/guild/forms.py @@ -1,17 +1,12 @@ - - from django import forms from guild.models import PlaySession class PlaySessionForm(forms.ModelForm): - class Meta: model = PlaySession fields = ["date", "characters", "summary"] # set date wideget to type="date" widgets = { "date": forms.DateInput(attrs={"type": "date"}), - } - diff --git a/guild/migrations/0001_initial.py b/guild/migrations/0001_initial.py index 119e829..d43890f 100644 --- a/guild/migrations/0001_initial.py +++ b/guild/migrations/0001_initial.py @@ -5,70 +5,124 @@ import django.db.models.deletion class Migration(migrations.Migration): - initial = True - dependencies = [ - ] + dependencies = [] operations = [ migrations.CreateModel( - name='Adventure', + name="Adventure", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ('description', models.TextField()), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ("description", models.TextField()), ], options={ - 'verbose_name': 'Adventure', - 'verbose_name_plural': 'Adventures', + "verbose_name": "Adventure", + "verbose_name_plural": "Adventures", }, ), migrations.CreateModel( - name='Character', + name="Character", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ('description', models.TextField()), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ("description", models.TextField()), ], options={ - 'verbose_name': 'character', - 'verbose_name_plural': 'characters', + "verbose_name": "character", + "verbose_name_plural": "characters", }, ), migrations.CreateModel( - name='Player', + name="Player", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), ], options={ - 'verbose_name': 'player', - 'verbose_name_plural': 'players', + "verbose_name": "player", + "verbose_name_plural": "players", }, ), migrations.CreateModel( - name='PlaySession', + name="PlaySession", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('date', models.DateField()), - ('summary', models.TextField()), - ('adventure', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='guild.adventure', verbose_name='adventure')), - ('characters', models.ManyToManyField(to='guild.character', verbose_name='characters')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date", models.DateField()), + ("summary", models.TextField()), + ( + "adventure", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="guild.adventure", + verbose_name="adventure", + ), + ), + ( + "characters", + models.ManyToManyField( + to="guild.character", verbose_name="characters" + ), + ), ], options={ - 'verbose_name': 'playsession', - 'verbose_name_plural': 'playsessions', + "verbose_name": "playsession", + "verbose_name_plural": "playsessions", }, ), migrations.AddField( - model_name='character', - name='player', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='guild.player', verbose_name='player'), + model_name="character", + name="player", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="guild.player", + verbose_name="player", + ), ), migrations.AddField( - model_name='adventure', - name='master', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='guild.player', verbose_name='master'), + model_name="adventure", + name="master", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="guild.player", + verbose_name="master", + ), ), ] diff --git a/guild/migrations/0002_resource_alter_player_name_resourceearned.py b/guild/migrations/0002_resource_alter_player_name_resourceearned.py index cbe29af..a249bd9 100644 --- a/guild/migrations/0002_resource_alter_player_name_resourceearned.py +++ b/guild/migrations/0002_resource_alter_player_name_resourceearned.py @@ -5,40 +5,71 @@ import django.db.models.deletion class Migration(migrations.Migration): - dependencies = [ - ('guild', '0001_initial'), + ("guild", "0001_initial"), ] operations = [ migrations.CreateModel( - name='Resource', + name="Resource", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ('description', models.TextField()), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ("description", models.TextField()), ], options={ - 'verbose_name': 'resource', - 'verbose_name_plural': 'resources', + "verbose_name": "resource", + "verbose_name_plural": "resources", }, ), migrations.AlterField( - model_name='player', - name='name', + model_name="player", + name="name", field=models.CharField(max_length=255, unique=True), ), migrations.CreateModel( - name='ResourceEarned', + name="ResourceEarned", fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('amount', models.IntegerField()), - ('character', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='guild.character', verbose_name='character')), - ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='guild.resource', verbose_name='resource')), + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("amount", models.IntegerField()), + ( + "character", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="guild.character", + verbose_name="character", + ), + ), + ( + "resource", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to="guild.resource", + verbose_name="resource", + ), + ), ], options={ - 'verbose_name': 'resourceearned', - 'verbose_name_plural': 'resourceearneds', + "verbose_name": "resourceearned", + "verbose_name_plural": "resourceearneds", }, ), ] diff --git a/guild/models.py b/guild/models.py index 04d37b2..1a3cae6 100644 --- a/guild/models.py +++ b/guild/models.py @@ -2,8 +2,8 @@ from django.db import models from django.urls import reverse from django.utils.translation import gettext as _ -class Player(models.Model): +class Player(models.Model): name = models.CharField(max_length=255, unique=True) class Meta: @@ -16,8 +16,8 @@ class Player(models.Model): def get_absolute_url(self): return reverse("guild:player_detail", kwargs={"pk": self.pk}) -class Resource(models.Model): +class Resource(models.Model): name = models.CharField(max_length=255) description = models.TextField() @@ -33,11 +33,16 @@ class Resource(models.Model): class Adventure(models.Model): - name = models.CharField(max_length=255) - description = models.TextField() + description = models.TextField() - master = models.ForeignKey("Player", verbose_name=_("master"), on_delete=models.SET_NULL, null=True, blank=True) + master = models.ForeignKey( + "Player", + verbose_name=_("master"), + on_delete=models.SET_NULL, + null=True, + blank=True, + ) class Meta: verbose_name = _("Adventure") @@ -52,9 +57,15 @@ class Adventure(models.Model): class Character(models.Model): name = models.CharField(max_length=255) - description = models.TextField() + description = models.TextField() - player = models.ForeignKey("Player", verbose_name=_("player"), on_delete=models.SET_NULL, null=True, blank=True) + player = models.ForeignKey( + "Player", + verbose_name=_("player"), + on_delete=models.SET_NULL, + null=True, + blank=True, + ) class Meta: verbose_name = _("character") @@ -66,13 +77,15 @@ class Character(models.Model): def get_absolute_url(self): return reverse("guild:character_detail", kwargs={"pk": self.pk}) -class PlaySession(models.Model): +class PlaySession(models.Model): date = models.DateField() - adventure = models.ForeignKey("Adventure", verbose_name=_("adventure"), on_delete=models.CASCADE) + adventure = models.ForeignKey( + "Adventure", verbose_name=_("adventure"), on_delete=models.CASCADE + ) characters = models.ManyToManyField("Character", verbose_name=_("characters")) - summary = models.TextField() + summary = models.TextField() class Meta: verbose_name = _("playsession") @@ -82,16 +95,24 @@ class PlaySession(models.Model): return self.name def get_absolute_url(self): - return reverse( - "guild:adventure_detail", - kwargs={"pk": self.adventure.pk} - ) + "#playsession" + str(self.pk) + return ( + reverse("guild:adventure_detail", kwargs={"pk": self.adventure.pk}) + + "#playsession" + + str(self.pk) + ) class ResourceEarned(models.Model): - - resource = models.ForeignKey("Resource", verbose_name=_("resource"), on_delete=models.CASCADE) - character = models.ForeignKey("Character", verbose_name=_("character"), on_delete=models.CASCADE, null=True, blank=True) + resource = models.ForeignKey( + "Resource", verbose_name=_("resource"), on_delete=models.CASCADE + ) + character = models.ForeignKey( + "Character", + verbose_name=_("character"), + on_delete=models.CASCADE, + null=True, + blank=True, + ) amount = models.IntegerField() class Meta: diff --git a/guild/templatetags/guild_extras.py b/guild/templatetags/guild_extras.py index 18e06ff..19d926a 100644 --- a/guild/templatetags/guild_extras.py +++ b/guild/templatetags/guild_extras.py @@ -4,7 +4,8 @@ from django.template.defaultfilters import stringfilter register = template.Library() -@register.filter(name='md') + +@register.filter(name="md") @stringfilter def md(value): - return markdown.markdown(value) \ No newline at end of file + return markdown.markdown(value) diff --git a/guild/urls.py b/guild/urls.py index edcbf23..1a2fcd8 100644 --- a/guild/urls.py +++ b/guild/urls.py @@ -7,21 +7,87 @@ import guild.views.adventure as adventure_views urlpatterns = [ path("", views.HomeView.as_view(), name="home"), # path("players/", views.PlayerListView.as_view(), name="player_list"), - path("players/create/", player_views.CreatePlayerView.as_view(), name="create_player"), - path("players//", player_views.PlayerDetailView.as_view(), name="player_detail"), - path("players//update/", player_views.PlayerUpdateView.as_view(), name="player_update"), - path("players//delete/", player_views.PlayerDeleteView.as_view(), name="player_delete"), - path("characters/", character_views.CharacterListView.as_view(), name="character_list"), - path("characters/create/", character_views.CreateCharacterView.as_view(), name="create_character"), - path("characters//", character_views.CharacterDetailView.as_view(), name="character_detail"), - path("characters//update/", character_views.CharacterUpdateView.as_view(), name="character_update"), - path("characters//delete/", character_views.CharacterDeleteView.as_view(), name="character_delete"), - path("adventures/", adventure_views.AdventureListView.as_view(), name="adventure_list"), - path("adventures/create/", adventure_views.CreateAdventureView.as_view(), name="create_adventure"), - path("adventures//", adventure_views.AdventureDetailView.as_view(), name="adventure_detail"), - path("adventures//update/", adventure_views.AdventureUpdateView.as_view(), name="adventure_update"), - path("adventures//delete/", adventure_views.AdventureDeleteView.as_view(), name="adventure_delete"), - path("adventures//playsession/create/", adventure_views.PlaySessionCreateView.as_view(), name="create_playsession"), - path("adventures//playsession//update/", adventure_views.PlaySessionUpdateView.as_view(), name="playsession_update"), - path("adventures//playsession//delete/", adventure_views.PlaySessionDeleteView.as_view(), name="playsession_delete"), + path( + "players/create/", player_views.CreatePlayerView.as_view(), name="create_player" + ), + path( + "players//", + player_views.PlayerDetailView.as_view(), + name="player_detail", + ), + path( + "players//update/", + player_views.PlayerUpdateView.as_view(), + name="player_update", + ), + path( + "players//delete/", + player_views.PlayerDeleteView.as_view(), + name="player_delete", + ), + path( + "characters/", + character_views.CharacterListView.as_view(), + name="character_list", + ), + path( + "characters/create/", + character_views.CreateCharacterView.as_view(), + name="create_character", + ), + path( + "characters//", + character_views.CharacterDetailView.as_view(), + name="character_detail", + ), + path( + "characters//update/", + character_views.CharacterUpdateView.as_view(), + name="character_update", + ), + path( + "characters//delete/", + character_views.CharacterDeleteView.as_view(), + name="character_delete", + ), + path( + "adventures/", + adventure_views.AdventureListView.as_view(), + name="adventure_list", + ), + path( + "adventures/create/", + adventure_views.CreateAdventureView.as_view(), + name="create_adventure", + ), + path( + "adventures//", + adventure_views.AdventureDetailView.as_view(), + name="adventure_detail", + ), + path( + "adventures//update/", + adventure_views.AdventureUpdateView.as_view(), + name="adventure_update", + ), + path( + "adventures//delete/", + adventure_views.AdventureDeleteView.as_view(), + name="adventure_delete", + ), + path( + "adventures//playsession/create/", + adventure_views.PlaySessionCreateView.as_view(), + name="create_playsession", + ), + path( + "adventures//playsession//update/", + adventure_views.PlaySessionUpdateView.as_view(), + name="playsession_update", + ), + path( + "adventures//playsession//delete/", + adventure_views.PlaySessionDeleteView.as_view(), + name="playsession_delete", + ), ] diff --git a/guild/views/__init__.py b/guild/views/__init__.py index 9ca226b..d0eb1eb 100644 --- a/guild/views/__init__.py +++ b/guild/views/__init__.py @@ -4,6 +4,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from guild.models import Adventure, Character, Player + # Create your views here. class HomeView(LoginRequiredMixin, TemplateView): template_name = "guild/home.html" @@ -14,5 +15,3 @@ class HomeView(LoginRequiredMixin, TemplateView): context["players"] = Player.objects.all() context["characters"] = Character.objects.all() return context - - diff --git a/guild/views/adventure.py b/guild/views/adventure.py index 417fa45..a686c63 100644 --- a/guild/views/adventure.py +++ b/guild/views/adventure.py @@ -1,4 +1,3 @@ - from typing import Any, Dict, Optional, Type from django.forms.models import BaseModelForm from django.http import HttpResponse @@ -15,21 +14,26 @@ class AdventureListView(LoginRequiredMixin, ListView): model = Adventure context_object_name = "adventures" + class CreateAdventureView(LoginRequiredMixin, CreateView): model = Adventure fields = ["name", "description", "master"] + class AdventureDetailView(LoginRequiredMixin, DetailView): model = Adventure + class AdventureUpdateView(LoginRequiredMixin, UpdateView): model = Adventure fields = ["name", "description", "master"] + class AdventureDeleteView(LoginRequiredMixin, DeleteView): model = Adventure success_url = "/" + class PlaySessionCreateView(LoginRequiredMixin, CreateView): model = PlaySession form_class = PlaySessionForm @@ -37,11 +41,12 @@ class PlaySessionCreateView(LoginRequiredMixin, CreateView): def dispatch(self, request, *args, **kwargs): self.adventure = get_object_or_404(Adventure, pk=kwargs["pk"]) return super().dispatch(request, *args, **kwargs) - + def form_valid(self, form: BaseModelForm) -> HttpResponse: form.instance.adventure = self.adventure return super().form_valid(form) + class PlaySessionUpdateView(LoginRequiredMixin, UpdateView): model = PlaySession form_class = PlaySessionForm @@ -50,6 +55,7 @@ class PlaySessionUpdateView(LoginRequiredMixin, UpdateView): self.adventure = get_object_or_404(Adventure, pk=kwargs["pk"]) return super().dispatch(request, *args, **kwargs) + class PlaySessionDeleteView(LoginRequiredMixin, DeleteView): model = PlaySession pk_url_kwarg = "playsession_pk" @@ -59,4 +65,4 @@ class PlaySessionDeleteView(LoginRequiredMixin, DeleteView): return super().dispatch(request, *args, **kwargs) def get_success_url(self) -> str: - return self.adventure.get_absolute_url() \ No newline at end of file + return self.adventure.get_absolute_url() diff --git a/guild/views/character.py b/guild/views/character.py index ac234a5..2245d31 100644 --- a/guild/views/character.py +++ b/guild/views/character.py @@ -1,4 +1,3 @@ - from django.views.generic import TemplateView, ListView, DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.contrib.auth.mixins import LoginRequiredMixin @@ -10,17 +9,21 @@ class CharacterListView(LoginRequiredMixin, ListView): model = Character context_object_name = "characters" + class CreateCharacterView(LoginRequiredMixin, CreateView): model = Character fields = ["name", "description", "player"] + class CharacterDetailView(LoginRequiredMixin, DetailView): model = Character + class CharacterUpdateView(LoginRequiredMixin, UpdateView): model = Character fields = ["name", "description", "player"] + class CharacterDeleteView(LoginRequiredMixin, DeleteView): model = Character - success_url = "/" \ No newline at end of file + success_url = "/" diff --git a/guild/views/player.py b/guild/views/player.py index 2639e76..828bbbb 100644 --- a/guild/views/player.py +++ b/guild/views/player.py @@ -1,4 +1,3 @@ - from django.views.generic import TemplateView, ListView, DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.contrib.auth.mixins import LoginRequiredMixin @@ -10,13 +9,16 @@ class CreatePlayerView(LoginRequiredMixin, CreateView): model = Player fields = ["name"] + class PlayerDetailView(LoginRequiredMixin, DetailView): model = Player + class PlayerUpdateView(LoginRequiredMixin, UpdateView): model = Player fields = ["name"] + class PlayerDeleteView(LoginRequiredMixin, DeleteView): model = Player - success_url = "/" \ No newline at end of file + success_url = "/" diff --git a/guild_journal/asgi.py b/guild_journal/asgi.py index 541efdd..590df54 100644 --- a/guild_journal/asgi.py +++ b/guild_journal/asgi.py @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'guild_journal.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "guild_journal.settings") application = get_asgi_application() diff --git a/guild_journal/settings.py b/guild_journal/settings.py index ff4b199..4cc404a 100644 --- a/guild_journal/settings.py +++ b/guild_journal/settings.py @@ -20,7 +20,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-e*p%e)pwf+-ntt4wpn-^^7-0yq)!cjo*om18vy77-=*c0jjfqa' +SECRET_KEY = "django-insecure-e*p%e)pwf+-ntt4wpn-^^7-0yq)!cjo*om18vy77-=*c0jjfqa" # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -31,55 +31,55 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - "guild" + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "guild", ] MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = 'guild_journal.urls' +ROOT_URLCONF = "guild_journal.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [ BASE_DIR / "templates", ], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'guild_journal.wsgi.application' +WSGI_APPLICATION = "guild_journal.wsgi.application" # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", } } @@ -89,16 +89,16 @@ DATABASES = { AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] @@ -106,9 +106,9 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/4.2/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = "en-us" -TIME_ZONE = 'UTC' +TIME_ZONE = "UTC" USE_I18N = True @@ -118,7 +118,7 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = "static/" STATICFILES_DIRS = [ BASE_DIR / "static", @@ -127,4 +127,4 @@ STATICFILES_DIRS = [ # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/guild_journal/urls.py b/guild_journal/urls.py index 1661872..3003f2a 100644 --- a/guild_journal/urls.py +++ b/guild_journal/urls.py @@ -18,7 +18,7 @@ from django.contrib import admin from django.urls import include, path urlpatterns = [ - path('admin/', admin.site.urls), + path("admin/", admin.site.urls), path("accounts/", include("django.contrib.auth.urls")), path("", include(("guild.urls", "guild"), namespace="guild")), ] diff --git a/guild_journal/wsgi.py b/guild_journal/wsgi.py index 29522ba..dde552b 100644 --- a/guild_journal/wsgi.py +++ b/guild_journal/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'guild_journal.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "guild_journal.settings") application = get_wsgi_application() diff --git a/manage.py b/manage.py index 5f8ab42..f742135 100755 --- a/manage.py +++ b/manage.py @@ -6,7 +6,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'guild_journal.settings') + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "guild_journal.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -18,5 +18,5 @@ def main(): execute_from_command_line(sys.argv) -if __name__ == '__main__': +if __name__ == "__main__": main()