Skip to content

Commit 4854a9a

Browse files
committed
Black
1 parent ccf5c42 commit 4854a9a

File tree

9 files changed

+45
-49
lines changed

9 files changed

+45
-49
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# drf_endpoint_examples
2+
23
Example DRF Endpoints

drf_endpoint_examples/settings.py

+38-37
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
23-
SECRET_KEY = 'django-insecure-)6w3&j1ap=m72#3xh-8)8h06h*rh^rp!#=4-k9--1zn0rzs3&4'
23+
SECRET_KEY = "django-insecure-)6w3&j1ap=m72#3xh-8)8h06h*rh^rp!#=4-k9--1zn0rzs3&4"
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
2626
DEBUG = True
@@ -31,53 +31,52 @@
3131
# Application definition
3232

3333
INSTALLED_APPS = [
34-
'django.contrib.admin',
35-
'django.contrib.auth',
36-
'django.contrib.contenttypes',
37-
'django.contrib.sessions',
38-
'django.contrib.messages',
39-
'django.contrib.staticfiles',
34+
"django.contrib.admin",
35+
"django.contrib.auth",
36+
"django.contrib.contenttypes",
37+
"django.contrib.sessions",
38+
"django.contrib.messages",
39+
"django.contrib.staticfiles",
4040
]
4141

4242
MIDDLEWARE = [
43-
'django.middleware.security.SecurityMiddleware',
44-
'django.contrib.sessions.middleware.SessionMiddleware',
45-
'django.middleware.common.CommonMiddleware',
46-
'django.middleware.csrf.CsrfViewMiddleware',
47-
'django.contrib.auth.middleware.AuthenticationMiddleware',
48-
'django.contrib.messages.middleware.MessageMiddleware',
49-
'django.middleware.clickjacking.XFrameOptionsMiddleware',
43+
"django.middleware.security.SecurityMiddleware",
44+
"django.contrib.sessions.middleware.SessionMiddleware",
45+
"django.middleware.common.CommonMiddleware",
46+
"django.middleware.csrf.CsrfViewMiddleware",
47+
"django.contrib.auth.middleware.AuthenticationMiddleware",
48+
"django.contrib.messages.middleware.MessageMiddleware",
49+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
5050
]
5151

52-
ROOT_URLCONF = 'drf_endpoint_examples.urls'
52+
ROOT_URLCONF = "drf_endpoint_examples.urls"
5353

5454
TEMPLATES = [
5555
{
56-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
57-
'DIRS': [BASE_DIR / 'templates']
58-
,
59-
'APP_DIRS': True,
60-
'OPTIONS': {
61-
'context_processors': [
62-
'django.template.context_processors.debug',
63-
'django.template.context_processors.request',
64-
'django.contrib.auth.context_processors.auth',
65-
'django.contrib.messages.context_processors.messages',
56+
"BACKEND": "django.template.backends.django.DjangoTemplates",
57+
"DIRS": [BASE_DIR / "templates"],
58+
"APP_DIRS": True,
59+
"OPTIONS": {
60+
"context_processors": [
61+
"django.template.context_processors.debug",
62+
"django.template.context_processors.request",
63+
"django.contrib.auth.context_processors.auth",
64+
"django.contrib.messages.context_processors.messages",
6665
],
6766
},
6867
},
6968
]
7069

71-
WSGI_APPLICATION = 'drf_endpoint_examples.wsgi.application'
70+
WSGI_APPLICATION = "drf_endpoint_examples.wsgi.application"
7271

7372

7473
# Database
7574
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
7675

7776
DATABASES = {
78-
'default': {
79-
'ENGINE': 'django.db.backends.sqlite3',
80-
'NAME': BASE_DIR / 'db.sqlite3',
77+
"default": {
78+
"ENGINE": "django.db.backends.sqlite3",
79+
"NAME": BASE_DIR / "db.sqlite3",
8180
}
8281
}
8382

@@ -87,26 +86,28 @@
8786

8887
AUTH_PASSWORD_VALIDATORS = [
8988
{
90-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
89+
"NAME": (
90+
"django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
91+
),
9192
},
9293
{
93-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
94+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
9495
},
9596
{
96-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
97+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
9798
},
9899
{
99-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
100+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
100101
},
101102
]
102103

103104

104105
# Internationalization
105106
# https://docs.djangoproject.com/en/4.2/topics/i18n/
106107

107-
LANGUAGE_CODE = 'en-us'
108+
LANGUAGE_CODE = "en-us"
108109

109-
TIME_ZONE = 'UTC'
110+
TIME_ZONE = "UTC"
110111

111112
USE_I18N = True
112113

@@ -116,9 +117,9 @@
116117
# Static files (CSS, JavaScript, Images)
117118
# https://docs.djangoproject.com/en/4.2/howto/static-files/
118119

119-
STATIC_URL = 'static/'
120+
STATIC_URL = "static/"
120121

121122
# Default primary key field type
122123
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
123124

124-
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
125+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

drf_endpoint_examples/urls.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
from django.urls import path
1919

2020
urlpatterns = [
21-
path('admin/', admin.site.urls),
21+
path("admin/", admin.site.urls),
2222
]

endpoints/admin.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from django.contrib import admin
2-
31
# Register your models here.

endpoints/apps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33

44
class EndpointsConfig(AppConfig):
5-
default_auto_field = 'django.db.models.BigAutoField'
6-
name = 'endpoints'
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "endpoints"

endpoints/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Create your models here.
55

6+
67
class User(models.Model):
78
name = models.CharField(max_length=100)
89
email = models.EmailField(max_length=100)
@@ -46,4 +47,3 @@ class Review(models.Model):
4647

4748
def __str__(self):
4849
return self.user.name
49-

endpoints/tests.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from django.test import TestCase
2-
31
# Create your tests here.

endpoints/views.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
from django.shortcuts import render
2-
31
# Create your views here.

manage.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def main():
88
"""Run administrative tasks."""
9-
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drf_endpoint_examples.settings')
9+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drf_endpoint_examples.settings")
1010
try:
1111
from django.core.management import execute_from_command_line
1212
except ImportError as exc:
@@ -18,5 +18,5 @@ def main():
1818
execute_from_command_line(sys.argv)
1919

2020

21-
if __name__ == '__main__':
21+
if __name__ == "__main__":
2222
main()

0 commit comments

Comments
 (0)