Skip to content

Commit 56517de

Browse files
committed
fix
1 parent 8dbfaa1 commit 56517de

13 files changed

Lines changed: 189 additions & 11 deletions

File tree

20-poetry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [[ -z "$POETRY_PROJECT_NAME" ]]; then
1515
fi
1616

1717
# Initialize a new Poetry project with the project name
18-
poetry init --name "$POETRY_PROJECT_NAME" --no-interaction
18+
poetry init --name "$POETRY_PROJECT_NAME" --python ">=3.14,<4" --no-interaction
1919

2020
# Modify the existing [tool.poetry] section to add package-mode = false
2121
sed -i '/^\[tool.poetry\]/a package-mode = false' pyproject.toml

example.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -euo pipefail
23

34
EXAMPLE_DIR="example"
45

example/commits.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
README.md | 6 ++++++
4646
example.env | 3 +++
4747
example/settings.py | 15 ++++++++-------
48-
poetry.lock | 14 +++++++++++++-
48+
poetry.lock | 19 ++++++++++++++++++-
4949
pyproject.toml | 3 ++-
50-
6 files changed, 33 insertions(+), 9 deletions(-)
50+
6 files changed, 38 insertions(+), 9 deletions(-)
5151

5252
--- Force HTTPS traffic
5353

@@ -83,3 +83,19 @@
8383
poetry.lock | 27 +++++++++++++++++++++++++--
8484
pyproject.toml | 7 ++++++-
8585
4 files changed, 67 insertions(+), 3 deletions(-)
86+
87+
--- Custom user model using UUID4 as the primary key
88+
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(+)
96+
97+
--- feat: Add robots.txt view and test
98+
99+
example/test_no_smoke.py | 5 +++++
100+
example/urls.py | 3 +++
101+
2 files changed, 8 insertions(+)

example/example/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
# Application definition
3838

3939
INSTALLED_APPS = [
40+
'users',
4041
"django.contrib.admin",
4142
"django.contrib.auth",
4243
"django.contrib.contenttypes",
@@ -143,3 +144,5 @@
143144
dsn=SENTRY_DSN,
144145
traces_sample_rate=0.01,
145146
)
147+
148+
AUTH_USER_MODEL = 'users.User'

example/example/test_no_smoke.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
def test_robots_txt(client):
3+
response = client.get('/robots.txt')
4+
assert response.status_code == 200
5+
assert response['Content-Type'] == "text/plain"

example/example/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
1313
Including another URLconf
1414
1. Import the include() function: from django.urls import include, path
15+
from django.http import HttpResponse
1516
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1617
"""
1718

1819
from django.contrib import admin
20+
from django.http import HttpResponse
1921
from django.urls import path
2022

2123

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

example/poetry.lock

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = [
66
{name = "Jan Rydzewski",email = "flegmer@gmail.com"}
77
]
88
readme = "README.md"
9-
requires-python = ">=3.14"
9+
requires-python = ">=3.14,<4"
1010
dependencies = [
1111
"django",
1212
"django-environ",

example/users/__init__.py

Whitespace-only changes.

example/users/apps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class UsersConfig(AppConfig):
5+
name = "users"

0 commit comments

Comments
 (0)