Skip to content

Commit 02eb141

Browse files
authored
Format the codebase using Black (#188)
https://github.com/psf/black (This isn't being enforced in CI, since this project is a template, so we can't add a bunch of opinionated CI checks etc) GUS-W-13312373.
1 parent 7d2f6a1 commit 02eb141

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

gettingstarted/settings.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# SECURITY WARNING: keep the secret key used in production secret!
2929
SECRET_KEY = "CHANGE_ME!!!! (P.S. the SECRET_KEY environment variable will be used, if set, instead)."
3030

31-
if 'SECRET_KEY' in os.environ:
31+
if "SECRET_KEY" in os.environ:
3232
SECRET_KEY = os.environ["SECRET_KEY"]
3333

3434

@@ -78,9 +78,9 @@
7878
"django.template.context_processors.request",
7979
"django.contrib.auth.context_processors.auth",
8080
"django.contrib.messages.context_processors.messages",
81-
]
81+
],
8282
},
83-
}
83+
},
8484
]
8585

8686
WSGI_APPLICATION = "gettingstarted.wsgi.application"
@@ -94,14 +94,16 @@
9494
DATABASES = {
9595
"default": {
9696
"ENGINE": "django.db.backends.sqlite3",
97-
"NAME": os.path.join(BASE_DIR, "db.sqlite3")
97+
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
9898
}
9999
}
100100

101101
if "DATABASE_URL" in os.environ:
102102
# Configure Django for DATABASE_URL environment variable.
103103
DATABASES["default"] = dj_database_url.config(
104-
conn_max_age=MAX_CONN_AGE, ssl_require=True)
104+
conn_max_age=MAX_CONN_AGE,
105+
ssl_require=True,
106+
)
105107

106108
# Enable test database if found in CI environment.
107109
if "CI" in os.environ:
@@ -113,11 +115,17 @@
113115

114116
AUTH_PASSWORD_VALIDATORS = [
115117
{
116-
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
118+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
119+
},
120+
{
121+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
122+
},
123+
{
124+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
125+
},
126+
{
127+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
117128
},
118-
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
119-
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
120-
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
121129
]
122130

123131

@@ -161,4 +169,4 @@ def setup_databases(self, **kwargs):
161169
# Default primary key field type
162170
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
163171

164-
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
172+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

hello/migrations/0001_initial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
initial = True
98

109
dependencies = []

hello/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from django.db import models
22

33
# Create your models here.
4+
5+
46
class Greeting(models.Model):
57
when = models.DateTimeField("date created", auto_now_add=True)

hello/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
from .models import Greeting
55

66
# Create your views here.
7+
8+
79
def index(request):
810
# return HttpResponse('Hello from Python!')
911
return render(request, "index.html")
1012

1113

1214
def db(request):
13-
1415
greeting = Greeting()
1516
greeting.save()
1617

0 commit comments

Comments
 (0)