Skip to content

Commit e417bf3

Browse files
committed
fix
1 parent 21e960b commit e417bf3

14 files changed

Lines changed: 99 additions & 189 deletions

File tree

example/commits.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
example/__init__.py | 0
3232
example/asgi.py | 17 ++++++++
3333
example/settings.py | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++
34-
example/urls.py | 24 +++++++++++
34+
example/urls.py | 23 ++++++++++
3535
example/wsgi.py | 17 ++++++++
3636
manage.py | 22 ++++++++++
3737
poetry.lock | 86 +++++++++++++++++++++++++++++++++++++-
3838
pyproject.toml | 6 ++-
3939
test_no_smoke.py | 8 ++++
40-
9 files changed, 296 insertions(+), 2 deletions(-)
40+
9 files changed, 295 insertions(+), 2 deletions(-)
4141

4242
--- Configure Django settings with django-environ
4343

@@ -86,13 +86,13 @@
8686

8787
--- Custom user model using UUID4 as the primary key
8888

89-
example/settings.py | 3 +
90-
users/__init__.py | 0
91-
users/apps.py | 5 ++
92-
users/migrations/0001_initial.py | 132 +++++++++++++++++++++++++++++++++++++++
93-
users/migrations/__init__.py | 0
94-
users/models.py | 8 +++
95-
6 files changed, 148 insertions(+)
89+
example/settings.py | 3 +++
90+
users/__init__.py | 0
91+
users/apps.py | 5 +++++
92+
users/migrations/0001_initial.py | 44 ++++++++++++++++++++++++++++++++++++++++
93+
users/migrations/__init__.py | 0
94+
users/models.py | 8 ++++++++
95+
6 files changed, 60 insertions(+)
9696

9797
--- feat: Add robots.txt view and test
9898

example/example/asgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
from django.core.asgi import get_asgi_application
1313

1414

15-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
15+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings')
1616

1717
application = get_asgi_application()

example/example/settings.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,43 +38,43 @@
3838

3939
INSTALLED_APPS = [
4040
'users',
41-
"django.contrib.admin",
42-
"django.contrib.auth",
43-
"django.contrib.contenttypes",
44-
"django.contrib.sessions",
45-
"django.contrib.messages",
46-
"django.contrib.staticfiles",
41+
'django.contrib.admin',
42+
'django.contrib.auth',
43+
'django.contrib.contenttypes',
44+
'django.contrib.sessions',
45+
'django.contrib.messages',
46+
'django.contrib.staticfiles',
4747
]
4848

4949
MIDDLEWARE = [
50-
"django.middleware.security.SecurityMiddleware",
50+
'django.middleware.security.SecurityMiddleware',
5151
'whitenoise.middleware.WhiteNoiseMiddleware',
52-
"django.contrib.sessions.middleware.SessionMiddleware",
53-
"django.middleware.common.CommonMiddleware",
54-
"django.middleware.csrf.CsrfViewMiddleware",
55-
"django.contrib.auth.middleware.AuthenticationMiddleware",
56-
"django.contrib.messages.middleware.MessageMiddleware",
57-
"django.middleware.clickjacking.XFrameOptionsMiddleware",
52+
'django.contrib.sessions.middleware.SessionMiddleware',
53+
'django.middleware.common.CommonMiddleware',
54+
'django.middleware.csrf.CsrfViewMiddleware',
55+
'django.contrib.auth.middleware.AuthenticationMiddleware',
56+
'django.contrib.messages.middleware.MessageMiddleware',
57+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
5858
]
5959

60-
ROOT_URLCONF = "example.urls"
60+
ROOT_URLCONF = 'example.urls'
6161

6262
TEMPLATES = [
6363
{
64-
"BACKEND": "django.template.backends.django.DjangoTemplates",
65-
"DIRS": [],
66-
"APP_DIRS": True,
67-
"OPTIONS": {
68-
"context_processors": [
69-
"django.template.context_processors.request",
70-
"django.contrib.auth.context_processors.auth",
71-
"django.contrib.messages.context_processors.messages",
64+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
65+
'DIRS': [],
66+
'APP_DIRS': True,
67+
'OPTIONS': {
68+
'context_processors': [
69+
'django.template.context_processors.request',
70+
'django.contrib.auth.context_processors.auth',
71+
'django.contrib.messages.context_processors.messages',
7272
],
7373
},
7474
},
7575
]
7676

77-
WSGI_APPLICATION = "example.wsgi.application"
77+
WSGI_APPLICATION = 'example.wsgi.application'
7878

7979

8080
# Database
@@ -90,26 +90,26 @@
9090

9191
AUTH_PASSWORD_VALIDATORS = [
9292
{
93-
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
93+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
9494
},
9595
{
96-
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
96+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
9797
},
9898
{
99-
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
99+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
100100
},
101101
{
102-
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
102+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
103103
},
104104
]
105105

106106

107107
# Internationalization
108108
# https://docs.djangoproject.com/en/6.0/topics/i18n/
109109

110-
LANGUAGE_CODE = "en-us"
110+
LANGUAGE_CODE = 'en-us'
111111

112-
TIME_ZONE = "UTC"
112+
TIME_ZONE = 'UTC'
113113

114114
USE_I18N = True
115115

@@ -119,7 +119,7 @@
119119
# Static files (CSS, JavaScript, Images)
120120
# https://docs.djangoproject.com/en/6.0/howto/static-files/
121121

122-
STATIC_URL = "static/"
122+
STATIC_URL = 'static/'
123123

124124
# enforce https traffic
125125
FORCE_HTTPS = env.bool('FORCE_HTTPS', default=True)

example/example/urls.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
from django.http import HttpResponse
1616
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1717
"""
18-
1918
from django.contrib import admin
2019
from django.http import HttpResponse
2120
from django.urls import path
2221

2322

2423
urlpatterns = [
2524
path('robots.txt', lambda r: HttpResponse("User-agent: *\nDisallow: /\n", content_type="text/plain")),
26-
path("admin/", admin.site.urls),
25+
path('admin/', admin.site.urls),
2726
]

example/example/wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
from django.core.wsgi import get_wsgi_application
1313

1414

15-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
15+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings')
1616

1717
application = get_wsgi_application()

example/manage.py

Lines changed: 2 additions & 2 deletions
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", "example.settings")
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.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()

example/users/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class UsersConfig(AppConfig):
5-
name = "users"
5+
name = 'users'

example/users/migrations/0001_initial.py

Lines changed: 19 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -11,122 +11,34 @@ class Migration(migrations.Migration):
1111
initial = True
1212

1313
dependencies = [
14-
("auth", "0012_alter_user_first_name_max_length"),
14+
('auth', '0012_alter_user_first_name_max_length'),
1515
]
1616

1717
operations = [
1818
migrations.CreateModel(
19-
name="User",
19+
name='User',
2020
fields=[
21-
("password", models.CharField(max_length=128, verbose_name="password")),
22-
(
23-
"last_login",
24-
models.DateTimeField(
25-
blank=True, null=True, verbose_name="last login"
26-
),
27-
),
28-
(
29-
"is_superuser",
30-
models.BooleanField(
31-
default=False,
32-
help_text="Designates that this user has all permissions without explicitly assigning them.",
33-
verbose_name="superuser status",
34-
),
35-
),
36-
(
37-
"username",
38-
models.CharField(
39-
error_messages={
40-
"unique": "A user with that username already exists."
41-
},
42-
help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
43-
max_length=150,
44-
unique=True,
45-
validators=[
46-
django.contrib.auth.validators.UnicodeUsernameValidator()
47-
],
48-
verbose_name="username",
49-
),
50-
),
51-
(
52-
"first_name",
53-
models.CharField(
54-
blank=True, max_length=150, verbose_name="first name"
55-
),
56-
),
57-
(
58-
"last_name",
59-
models.CharField(
60-
blank=True, max_length=150, verbose_name="last name"
61-
),
62-
),
63-
(
64-
"email",
65-
models.EmailField(
66-
blank=True, max_length=254, verbose_name="email address"
67-
),
68-
),
69-
(
70-
"is_staff",
71-
models.BooleanField(
72-
default=False,
73-
help_text="Designates whether the user can log into this admin site.",
74-
verbose_name="staff status",
75-
),
76-
),
77-
(
78-
"is_active",
79-
models.BooleanField(
80-
default=True,
81-
help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
82-
verbose_name="active",
83-
),
84-
),
85-
(
86-
"date_joined",
87-
models.DateTimeField(
88-
default=django.utils.timezone.now, verbose_name="date joined"
89-
),
90-
),
91-
(
92-
"id",
93-
models.UUIDField(
94-
default=uuid.uuid4,
95-
editable=False,
96-
primary_key=True,
97-
serialize=False,
98-
),
99-
),
100-
(
101-
"groups",
102-
models.ManyToManyField(
103-
blank=True,
104-
help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
105-
related_name="user_set",
106-
related_query_name="user",
107-
to="auth.group",
108-
verbose_name="groups",
109-
),
110-
),
111-
(
112-
"user_permissions",
113-
models.ManyToManyField(
114-
blank=True,
115-
help_text="Specific permissions for this user.",
116-
related_name="user_set",
117-
related_query_name="user",
118-
to="auth.permission",
119-
verbose_name="user permissions",
120-
),
121-
),
21+
('password', models.CharField(max_length=128, verbose_name='password')),
22+
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
23+
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
24+
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
25+
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
26+
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
27+
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
28+
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
29+
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
30+
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
31+
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
32+
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
33+
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
12234
],
12335
options={
124-
"verbose_name": "user",
125-
"verbose_name_plural": "users",
126-
"abstract": False,
36+
'verbose_name': 'user',
37+
'verbose_name_plural': 'users',
38+
'abstract': False,
12739
},
12840
managers=[
129-
("objects", django.contrib.auth.models.UserManager()),
41+
('objects', django.contrib.auth.models.UserManager()),
13042
],
13143
),
13244
]

fastapi/example/commits.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
.gitignore | 1 +
77
README.md | 11 +++++++++++
8-
pyproject.toml | 15 +++++++++++++++
9-
3 files changed, 27 insertions(+)
8+
pyproject.toml | 16 ++++++++++++++++
9+
3 files changed, 28 insertions(+)
1010

1111
--- Install and configure Flake8 with flake8-pyproject
1212

@@ -16,15 +16,15 @@
1616

1717
--- Install and configure isort with flake8-isort
1818

19-
poetry.lock | 37 ++++++++++++++++++++++++++++++++++++-
19+
poetry.lock | 35 +++++++++++++++++++++++++++++++++++
2020
pyproject.toml | 10 +++++++++-
21-
2 files changed, 45 insertions(+), 2 deletions(-)
21+
2 files changed, 44 insertions(+), 1 deletion(-)
2222

2323
--- Install and configure pytest
2424

25-
poetry.lock | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
25+
poetry.lock | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2626
pyproject.toml | 6 +++-
27-
2 files changed, 96 insertions(+), 2 deletions(-)
27+
2 files changed, 95 insertions(+), 1 deletion(-)
2828

2929
--- Install pydantic-settings and configure environment
3030

@@ -41,10 +41,10 @@
4141
example/__init__.py | 0
4242
example/config.py | 12 ++
4343
example/main.py | 14 ++
44-
poetry.lock | 604 +++++++++++++++++++++++++++++++++++++++++++++++++++-
44+
poetry.lock | 599 +++++++++++++++++++++++++++++++++++++++++++++++++++-
4545
pyproject.toml | 7 +-
4646
test_app.py | 18 ++
47-
7 files changed, 657 insertions(+), 6 deletions(-)
47+
7 files changed, 653 insertions(+), 5 deletions(-)
4848

4949
--- Install and configure SQLAlchemy with async support
5050

0 commit comments

Comments
 (0)