mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-04-05 17:34:14 +03:00
Compare commits
416 Commits
2024.09.29
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
22fb3141a1 | ||
|
458a21ee5c | ||
|
06c0cd2bf8 | ||
|
10d80a2ff9 | ||
|
6455b39c07 | ||
|
bf9ac68fed | ||
|
bb2d056a15 | ||
|
7ba49c9dc5 | ||
|
b4590cf8d9 | ||
|
8f1b488069 | ||
|
9085f602fa | ||
|
1e19553ded | ||
|
285e86bf71 | ||
|
7d8dabb813 | ||
|
b4f95514aa | ||
|
97c363bf9e | ||
|
6ea1f3c718 | ||
|
a802ac491c | ||
|
f1760fb835 | ||
|
5c5ec3a2ba | ||
|
dd24cdb036 | ||
|
0c1a349bfa | ||
|
54c70edf39 | ||
|
c550acd874 | ||
|
3e95ca6d8f | ||
|
9910a2bb91 | ||
|
179e4846a5 | ||
|
23747ef0f4 | ||
|
2504a349af | ||
|
31f7901060 | ||
|
28aa085015 | ||
|
8459a36369 | ||
|
7fbcc652f1 | ||
|
c04a8e39f9 | ||
|
9c68c8f3db | ||
|
e1a7d93d09 | ||
|
6d5fdb7e04 | ||
|
0822b46c2f | ||
|
1e22b0b987 | ||
|
29c70dfd0d | ||
|
1696a9d277 | ||
|
100271e7e1 | ||
|
b37fa9c79f | ||
|
3f3bc529ae | ||
|
e5c315bbc7 | ||
|
05ce556006 | ||
|
e6fac6075d | ||
|
ffb6f616a7 | ||
|
aa5308e82a | ||
|
0849bb518d | ||
|
3ea0666650 | ||
|
9691dc10c8 | ||
|
51d1c5bb5f | ||
|
fb5fcdbcaf | ||
|
4443eb41c2 | ||
|
c85e2f57f5 | ||
|
50ddc282d7 | ||
|
dfc2fb134b | ||
|
e4ee6565ef | ||
|
16488dd0cf | ||
|
d506d38f2e | ||
|
b3389579c1 | ||
|
7c9f6a75af | ||
|
0b90ecf4bf | ||
|
79f572c010 | ||
|
2d5d84f61a | ||
|
4c8ab6b4ba | ||
|
ee40ae6119 | ||
|
8bc53f538c | ||
|
6e9d2de035 | ||
|
e6f16d424f | ||
|
e7cad8f1c6 | ||
|
e8d328b283 | ||
|
fedf1f34d6 | ||
|
90d55a3a48 | ||
|
c898ed0dc8 | ||
|
fcef872763 | ||
|
697e8e40ce | ||
|
70f5a984b4 | ||
|
ccbb1d3afc | ||
|
7e736503ee | ||
|
cc0bd38eff | ||
|
425520956d | ||
|
ec4e519795 | ||
|
907ee6a607 | ||
|
f30c3c036c | ||
|
1a81521ae8 | ||
|
0299f98693 | ||
|
c448ff5ae6 | ||
|
65b16c82c0 | ||
|
08d1a3ba61 | ||
|
d8f3ad04f4 | ||
|
39f882ffb0 | ||
|
9653f1df97 | ||
|
4978690ae1 | ||
|
0e35c6f3b1 | ||
|
1ec8ef58dd | ||
|
a76b8fe8c8 | ||
|
eb2daaa132 | ||
|
ecbcd763a8 | ||
|
7977437563 | ||
|
9544a2243b | ||
|
431a4bd10c | ||
|
a06ed7ae76 | ||
|
13acd682cc | ||
|
67b3a7b9f3 | ||
|
1962169f57 | ||
|
bcf96d432f | ||
|
d04d3802f3 | ||
|
978455aa94 | ||
|
08cf6f72e5 | ||
|
f79dbf9e17 | ||
|
36b7e7754d | ||
|
c37b46e5cf | ||
|
17e5ad3f17 | ||
|
bde74225a3 | ||
|
8a019b40cf | ||
|
6b8545a95d | ||
|
0be2d9c919 | ||
|
7c6dff3b70 | ||
|
e0da2963c3 | ||
|
bcd27ef206 | ||
|
7371becfcf | ||
|
633762d9d5 | ||
|
0299266df9 | ||
|
bf2a3c5d84 | ||
|
f95ef4f8dc | ||
|
b5b24db9d2 | ||
|
827d35708b | ||
|
70bd35d398 | ||
|
d7c995b873 | ||
|
bb6e4085c7 | ||
|
723a388f3d | ||
|
3e1e6cb41b | ||
|
a691219456 | ||
|
a1105d9010 | ||
|
7f4211ab16 | ||
|
1cad7df6cc | ||
|
2193a661c5 | ||
|
e69d77a0b9 | ||
|
54e0ccec0c | ||
|
185f18dfc0 | ||
|
ab475a5570 | ||
|
564ca18e56 | ||
|
fbf6c886cb | ||
|
2dc567d131 | ||
|
7a85931fb0 | ||
|
c89a45c45f | ||
|
1ba44e9e03 | ||
|
42febc9e84 | ||
|
843f268c4d | ||
|
a8847158c9 | ||
|
d78dff4969 | ||
|
cb4a277136 | ||
|
35dacd8718 | ||
|
01650ddc1b | ||
|
e7edde03ba | ||
|
33aa0c0639 | ||
|
6047eeff3d | ||
|
8fd6404901 | ||
|
5eba578860 | ||
|
0d6de8f23b | ||
|
9cd3d10776 | ||
|
1dbaeaa09d | ||
|
2d54690d34 | ||
|
d39bb8ae16 | ||
|
bb7bffec63 | ||
|
c5b60d27cf | ||
|
cee86b68b1 | ||
|
7324393b15 | ||
|
38639e251e | ||
|
b9eb7c8eca | ||
|
d50dd24e90 | ||
|
6e46acc466 | ||
|
570763e7ce | ||
|
e4b00c26d7 | ||
|
95c3772b3e | ||
|
3ef84f1a26 | ||
|
b0e12c9cea | ||
|
411e92cf9d | ||
|
0434aea33f | ||
|
df2bd97a24 | ||
|
f8d267a78c | ||
|
683f207d4a | ||
|
a623f7bbc6 | ||
|
5b4e769354 | ||
|
33f32b06d9 | ||
|
7e0f4c165d | ||
|
e3929b15e4 | ||
|
f9298f9b99 | ||
|
4dcc9e786f | ||
|
2b09e6bb41 | ||
|
fd9dd32d28 | ||
|
e9f4ba8ae5 | ||
|
250a28bca8 | ||
|
61ffcbf163 | ||
|
1787fe31d2 | ||
|
a7362a0838 | ||
|
fc68927672 | ||
|
df7fcce28f | ||
|
b1bc92ff2c | ||
|
92491bc4ad | ||
|
fb7b05afae | ||
|
6c20b26773 | ||
|
a40c4e8588 | ||
|
8245b0c147 | ||
|
c17fef651f | ||
|
35bed843b8 | ||
|
72cb463ace | ||
|
1b62f5b329 | ||
|
1702b79b8c | ||
|
bb38f34c70 | ||
|
736ff7659d | ||
|
9ce93909a3 | ||
|
277bb8f475 | ||
|
8ce5908229 | ||
|
c187975e1d | ||
|
402fd66165 | ||
|
2c835f0ed5 | ||
|
47bc51274d | ||
|
8c02bf8f93 | ||
|
f63daa7eb1 | ||
|
cedbcbd0bf | ||
|
da24b3aa3f | ||
|
a41bbee492 | ||
|
b25ab14385 | ||
|
7e4ba42e6e | ||
|
857bcb6895 | ||
|
eee987e1b4 | ||
|
d43c73aeb6 | ||
|
3eacd55bf7 | ||
|
d7fe509ce9 | ||
|
9f34c18ffe | ||
|
9465a18868 | ||
|
017c9ae6f8 | ||
|
4dd166267d | ||
|
7675287041 | ||
|
606db119cd | ||
|
f0b50fb735 | ||
|
054eebf510 | ||
|
6a526ac633 | ||
|
88ba893524 | ||
|
0de4a2f6eb | ||
|
c02a16d6bf | ||
|
07061b6e2f | ||
|
c05770a4dc | ||
|
575d4c3809 | ||
|
4617cd2212 | ||
|
b09ee5be8a | ||
|
be2fdb2984 | ||
|
aca580df00 | ||
|
cbead91fdc | ||
|
7fc33c2a23 | ||
|
d00cd42e6c | ||
|
dc8a470a8f | ||
|
b1de740dff | ||
|
6215f17382 | ||
|
f440144fde | ||
|
c97df5f755 | ||
|
28ec065561 | ||
|
3b490ffd2f | ||
|
c357d9ef33 | ||
|
0bb37a3f1f | ||
|
1b9f3e7a48 | ||
|
d3ffe31bd0 | ||
|
e03b0b0c7e | ||
|
08ba595f87 | ||
|
c5988b5c3c | ||
|
73f41e2425 | ||
|
555872e1c9 | ||
|
868db771f3 | ||
|
cf375e934b | ||
|
b932c9bf15 | ||
|
4e506b44f1 | ||
|
8d6c8ebed1 | ||
|
f8954e8a47 | ||
|
1e0c9ff2c1 | ||
|
06bfd2ebaa | ||
|
dd98112051 | ||
|
51ce542796 | ||
|
5136d3da99 | ||
|
f2a45a3ee7 | ||
|
33a7478559 | ||
|
8d5a4269fc | ||
|
6b8d4dc856 | ||
|
4c95392321 | ||
|
6b7c4aebda | ||
|
14ba82423e | ||
|
46795883b5 | ||
|
5f9acfdf47 | ||
|
9bef46c198 | ||
|
571f8787eb | ||
|
a062a146df | ||
|
b40566e401 | ||
|
63044a04cd | ||
|
ab7f01c4d1 | ||
|
272ef407d6 | ||
|
4377481f32 | ||
|
fb27881b33 | ||
|
d40abd321e | ||
|
f4afaf5ba3 | ||
|
231940644e | ||
|
e86fd33633 | ||
|
19294ef8a0 | ||
|
60cc312918 | ||
|
17a1bf7e38 | ||
|
428fac8776 | ||
|
0384b8f001 | ||
|
33a707dd9f | ||
|
fb6549dc4d | ||
|
109238f746 | ||
|
244d7ac9cd | ||
|
ceafff014e | ||
|
b4737acb6d | ||
|
fd05b1de21 | ||
|
edd8a8b315 | ||
|
2533f72d61 | ||
|
020639f86f | ||
|
a829571997 | ||
|
9806ba7a36 | ||
|
8bf9a8c278 | ||
|
02f6336d74 | ||
|
6f5f1b8576 | ||
|
1b83a472ec | ||
|
8c1fac1b2e | ||
|
abc199d5ef | ||
|
ca405049ad | ||
|
ae86e01779 | ||
|
dc4d102477 | ||
|
ff7874b316 | ||
|
67af42be0c | ||
|
16b2c16b52 | ||
|
deb813ca05 | ||
|
4709a30bd7 | ||
|
62f39cda5e | ||
|
8831a8bd11 | ||
|
057562bf26 | ||
|
04d6620733 | ||
|
ccb0d974ed | ||
|
b042b212b6 | ||
|
a0c8863a9c | ||
|
931e300b63 | ||
|
822c1c0327 | ||
|
98f4863a25 | ||
|
c1092f5194 | ||
|
abfc6b0ee2 | ||
|
3f2155ab6e | ||
|
92cf1daaf4 | ||
|
209b54a628 | ||
|
54247e783e | ||
|
6994914572 | ||
|
b96e118f86 | ||
|
5fead041df | ||
|
2eb0b22530 | ||
|
dcde07d0ca | ||
|
bee41248a4 | ||
|
4696302b22 | ||
|
ed184d460a | ||
|
1ebaddc204 | ||
|
f3d4a9fcc7 | ||
|
44dc46997a | ||
|
a0c599d978 | ||
|
0bd606922c | ||
|
8fb90ab02a | ||
|
b66960ed2d | ||
|
9ada7ab125 | ||
|
c3ec0b020e | ||
|
6a2effb67c | ||
|
214e5f5d34 | ||
|
30295fefd2 | ||
|
c2caf522b5 | ||
|
d95f88142c | ||
|
49ed4a0267 | ||
|
c115b2e6de | ||
|
2d06ddda95 | ||
|
3252aa7ae7 | ||
|
f590d14070 | ||
|
d879c0b2ba | ||
|
0d9fbfd729 | ||
|
f86ebbbf3a | ||
|
907bfa5f6b | ||
|
877d81d618 | ||
|
7d9f58bef5 | ||
|
1a893456c3 | ||
|
d826d2e6f0 | ||
|
7114a1e1ba | ||
|
1bbd6d5fe4 | ||
|
29bd84b397 | ||
|
52ce09e623 | ||
|
ba3b48dcd9 | ||
|
0cac725ca1 | ||
|
9a3e7ebf16 | ||
|
5c4abe5b78 | ||
|
0a291c1ec1 | ||
|
a0af461794 | ||
|
b0c45224f1 | ||
|
6c64a810b4 | ||
|
56fce2b0e3 | ||
|
37aa462a2d | ||
|
120ba0d07f | ||
|
732c8784fa | ||
|
2cbb3bd02d | ||
|
d703580c75 | ||
|
168aae17f2 | ||
|
5e582d0392 | ||
|
463d671ffc | ||
|
33c75ad251 | ||
|
6f858e904b | ||
|
9bbee5f84d | ||
|
12380e1e80 | ||
|
e0819933ad | ||
|
ec499fa0ac | ||
|
9379027267 | ||
|
f8ef6c6251 | ||
|
faba566d31 | ||
|
6f3b72d691 |
|
@ -12,7 +12,7 @@ trim_trailing_whitespace = true
|
|||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{html,css,scss,json,yml,xml}]
|
||||
[*.{html,css,scss,json,yml,xml,toml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
|
|
65
.github/contributors.json
vendored
65
.github/contributors.json
vendored
|
@ -1648,5 +1648,70 @@
|
|||
"name": "LJFP",
|
||||
"github_login": "ljfp",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Francisco Navarro Morales ",
|
||||
"github_login": "spothound",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Mariot Tsitoara",
|
||||
"github_login": "mariot",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Christian Jensen",
|
||||
"github_login": "jensenbox",
|
||||
"twitter_username": "cjensen"
|
||||
},
|
||||
{
|
||||
"name": "Denis Darii",
|
||||
"github_login": "DNX",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "qwerrrqw",
|
||||
"github_login": "qwerrrqw",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Pulse-Mind",
|
||||
"github_login": "pulse-mind",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Hana Belay",
|
||||
"github_login": "earthcomfy",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Ed Morley",
|
||||
"github_login": "edmorley",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Alan Cyment",
|
||||
"github_login": "acyment",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Kawsar Alam Foysal",
|
||||
"github_login": "iamfoysal",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Igor Jerosimić",
|
||||
"github_login": "igor-wl",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Pepa",
|
||||
"github_login": "07pepa",
|
||||
"twitter_username": ""
|
||||
},
|
||||
{
|
||||
"name": "Aidos Kanapyanov",
|
||||
"github_login": "aidoskanapyanov",
|
||||
"twitter_username": ""
|
||||
}
|
||||
]
|
78
.github/dependabot.yml
vendored
78
.github/dependabot.yml
vendored
|
@ -2,23 +2,16 @@
|
|||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
enable-beta-ecosystems: true
|
||||
updates:
|
||||
# Update Python deps for the template (not the generated project)
|
||||
- package-ecosystem: "pip"
|
||||
- package-ecosystem: "uv"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "project infrastructure"
|
||||
|
||||
# Update Python deps for the documentation
|
||||
- package-ecosystem: "pip"
|
||||
directory: "docs/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "project infrastructure"
|
||||
|
||||
# Update GitHub actions in workflows
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
|
@ -36,11 +29,11 @@ updates:
|
|||
- "update"
|
||||
|
||||
# Enable version updates for Docker
|
||||
# We need to specify each Dockerfile in a separate entry because Dependabot doesn't
|
||||
# support wildcards or recursively checking subdirectories. Check this issue for updates:
|
||||
# https://github.com/dependabot/dependabot-core/issues/2178
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/local/django/"
|
||||
directories:
|
||||
- "{{cookiecutter.project_slug}}/compose/local/django/"
|
||||
- "{{cookiecutter.project_slug}}/compose/local/docs/"
|
||||
- "{{cookiecutter.project_slug}}/compose/production/django/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
ignore:
|
||||
|
@ -52,59 +45,12 @@ updates:
|
|||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/local/docs/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types:
|
||||
- "version-update:semver-major"
|
||||
- "version-update:semver-minor"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/local/node/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/production/aws/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/production/django/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types:
|
||||
- "version-update:semver-major"
|
||||
- "version-update:semver-minor"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/production/postgres/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/production/nginx/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
- "update"
|
||||
|
||||
- package-ecosystem: "docker"
|
||||
directory: "{{cookiecutter.project_slug}}/compose/production/traefik/"
|
||||
directories:
|
||||
- "{{cookiecutter.project_slug}}/compose/local/node/"
|
||||
- "{{cookiecutter.project_slug}}/compose/production/aws/"
|
||||
- "{{cookiecutter.project_slug}}/compose/production/postgres/"
|
||||
- "{{cookiecutter.project_slug}}/compose/production/nginx/"
|
||||
- "{{cookiecutter.project_slug}}/compose/production/traefik/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
labels:
|
||||
|
|
52
.github/workflows/align-versions.yml
vendored
Normal file
52
.github/workflows/align-versions.yml
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
name: align versions
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "{{cookiecutter.project_slug}}/requirements/local.txt"
|
||||
- "{{cookiecutter.project_slug}}/compose/local/node/Dockerfile"
|
||||
# Manual trigger
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
run:
|
||||
if: ${{ github.actor == 'pyup-bot' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
job:
|
||||
- script: scripts/ruff_version.py
|
||||
name: Ruff
|
||||
- script: scripts/node_version.py
|
||||
name: Node
|
||||
|
||||
name: "${{ matrix.job.name }} versions"
|
||||
steps:
|
||||
- name: Checkout with token
|
||||
uses: actions/checkout@v4
|
||||
if: ${{ env.GH_PAT != '' }}
|
||||
with:
|
||||
token: ${{ env.GH_PAT }}
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
- name: Checkout without token
|
||||
uses: actions/checkout@v4
|
||||
if: ${{ env.GH_PAT == '' }}
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
|
||||
- run: uv run ${{ matrix.job.script }}
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Align versions
|
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
|
@ -23,14 +23,12 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
run: uv sync
|
||||
- name: Run tests
|
||||
run: pytest -n auto tests
|
||||
run: uv run pytest -n auto tests
|
||||
|
||||
docker:
|
||||
strategy:
|
||||
|
@ -54,12 +52,10 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
run: uv sync
|
||||
- name: Docker ${{ matrix.script.name }}
|
||||
run: sh tests/test_docker.sh ${{ matrix.script.args }}
|
||||
|
||||
|
@ -85,14 +81,14 @@ jobs:
|
|||
ports:
|
||||
- 6379:6379
|
||||
postgres:
|
||||
image: postgres:12
|
||||
image: postgres:13
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
|
||||
env:
|
||||
CELERY_BROKER_URL: "redis://localhost:6379/0"
|
||||
REDIS_URL: "redis://localhost:6379/0"
|
||||
# postgres://user:password@host:port/database
|
||||
DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres"
|
||||
|
||||
|
@ -101,15 +97,12 @@ jobs:
|
|||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
cache-dependency-path: |
|
||||
requirements.txt
|
||||
{{cookiecutter.project_slug}}/requirements/base.txt
|
||||
{{cookiecutter.project_slug}}/requirements/local.txt
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
run: uv sync
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
node-version: "22.14"
|
||||
- name: Bare Metal ${{ matrix.script.name }}
|
||||
run: sh tests/test_bare.sh ${{ matrix.script.args }}
|
||||
|
|
33
.github/workflows/dependabot-uv-lock.yml
vendored
Normal file
33
.github/workflows/dependabot-uv-lock.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: uv
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "pyproject.toml"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
steps:
|
||||
- name: Checkout with token
|
||||
uses: actions/checkout@v4
|
||||
if: ${{ env.GH_PAT != '' }}
|
||||
with:
|
||||
token: ${{ env.GH_PAT }}
|
||||
|
||||
- name: Checkout without token
|
||||
uses: actions/checkout@v4
|
||||
if: ${{ env.GH_PAT == '' }}
|
||||
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
- run: uv lock
|
||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: Regenerate uv.lock
|
11
.github/workflows/django-issue-checker.yml
vendored
11
.github/workflows/django-issue-checker.yml
vendored
|
@ -17,14 +17,9 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Create Django Major Issue
|
||||
run: python scripts/create_django_issue.py
|
||||
run: uv run --frozen scripts/create_django_issue.py
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
15
.github/workflows/update-changelog.yml
vendored
15
.github/workflows/update-changelog.yml
vendored
|
@ -15,20 +15,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Set git details
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "action@github.com"
|
||||
- name: Update list
|
||||
run: python scripts/update_changelog.py
|
||||
- name: Update changelog
|
||||
run: uv run --frozen scripts/update_changelog.py
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
13
.github/workflows/update-contributors.yml
vendored
13
.github/workflows/update-contributors.yml
vendored
|
@ -18,17 +18,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Update list
|
||||
run: python scripts/update_contributors.py
|
||||
run: uv run --frozen scripts/update_contributors.py
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
exclude: "{{cookiecutter.project_slug}}|.github/contributors.json|CHANGELOG.md|CONTRIBUTORS.md"
|
||||
default_stages: [commit]
|
||||
default_stages: [pre-commit]
|
||||
minimum_pre_commit_version: "3.2.0"
|
||||
|
||||
default_language_version:
|
||||
python: python3.12
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
|
@ -26,29 +27,29 @@ repos:
|
|||
args: ["--tab-width", "2"]
|
||||
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.17.0
|
||||
rev: v3.19.1
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py312-plus]
|
||||
exclude: hooks/
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 24.8.0
|
||||
rev: 25.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.13.2
|
||||
rev: 6.0.1
|
||||
hooks:
|
||||
- id: isort
|
||||
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 7.1.1
|
||||
rev: 7.2.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
|
||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||
rev: "2.2.4"
|
||||
rev: "v2.5.1"
|
||||
hooks:
|
||||
- id: pyproject-fmt
|
||||
|
||||
|
|
|
@ -9,12 +9,13 @@ build:
|
|||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.12"
|
||||
commands:
|
||||
- asdf plugin add uv
|
||||
- asdf install uv latest
|
||||
- asdf global uv latest
|
||||
- uv sync --only-group docs --frozen
|
||||
- uv run -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
# Declare the Python requirements required to build your docs
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
|
967
CHANGELOG.md
967
CHANGELOG.md
|
@ -3,6 +3,973 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
|
|||
|
||||
<!-- GENERATOR_PLACEHOLDER -->
|
||||
|
||||
## 2025.04.03
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-anymail to 13.0 ([#5763](https://github.com/cookiecutter/cookiecutter-django/pull/5763))
|
||||
|
||||
- Update pytest-django to 4.11.1 ([#5762](https://github.com/cookiecutter/cookiecutter-django/pull/5762))
|
||||
|
||||
- Update ruff to 0.11.3 ([#5761](https://github.com/cookiecutter/cookiecutter-django/pull/5761))
|
||||
|
||||
- Update django-allauth to 65.7.0 ([#5760](https://github.com/cookiecutter/cookiecutter-django/pull/5760))
|
||||
|
||||
## 2025.04.02
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix line endings for dotenv merge script on Windows ([#5754](https://github.com/cookiecutter/cookiecutter-django/pull/5754))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update crispy-bootstrap5 to 2025.4 ([#5756](https://github.com/cookiecutter/cookiecutter-django/pull/5756))
|
||||
|
||||
- Update Django from 5.0 to 5.1 ([#5740](https://github.com/cookiecutter/cookiecutter-django/pull/5740))
|
||||
|
||||
- Update sentry-sdk to 2.25.1 ([#5757](https://github.com/cookiecutter/cookiecutter-django/pull/5757))
|
||||
|
||||
- Update django-storages to 1.14.6 ([#5753](https://github.com/cookiecutter/cookiecutter-django/pull/5753))
|
||||
|
||||
- Update pytest-django to 4.11.0 ([#5752](https://github.com/cookiecutter/cookiecutter-django/pull/5752))
|
||||
|
||||
## 2025.04.01
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update pillow to 11.2.0 ([#5751](https://github.com/cookiecutter/cookiecutter-django/pull/5751))
|
||||
|
||||
- Bump traefik from 3.3.4 to 3.3.5 ([#5750](https://github.com/cookiecutter/cookiecutter-django/pull/5750))
|
||||
|
||||
- Update celery to 5.5.0 ([#5748](https://github.com/cookiecutter/cookiecutter-django/pull/5748))
|
||||
|
||||
## 2025.03.31
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-allauth to 65.6.0 ([#5741](https://github.com/cookiecutter/cookiecutter-django/pull/5741))
|
||||
|
||||
- Update sentry-sdk to 2.25.0 ([#5747](https://github.com/cookiecutter/cookiecutter-django/pull/5747))
|
||||
|
||||
- Update coverage to 7.8.0 ([#5745](https://github.com/cookiecutter/cookiecutter-django/pull/5745))
|
||||
|
||||
## 2025.03.28
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djangorestframework to 3.16.0 ([#5743](https://github.com/cookiecutter/cookiecutter-django/pull/5743))
|
||||
|
||||
- Update django-upgrade pre-commit hook to v1.24.0 ([#5742](https://github.com/cookiecutter/cookiecutter-django/pull/5742))
|
||||
|
||||
## 2025.03.24
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-allauth to 65.5.0 ([#5723](https://github.com/cookiecutter/cookiecutter-django/pull/5723))
|
||||
|
||||
- Update sentry-sdk to 2.24.1 ([#5739](https://github.com/cookiecutter/cookiecutter-django/pull/5739))
|
||||
|
||||
## 2025.03.22
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.7.1 ([#5736](https://github.com/cookiecutter/cookiecutter-django/pull/5736))
|
||||
|
||||
## 2025.03.21
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.24.0 ([#5734](https://github.com/cookiecutter/cookiecutter-django/pull/5734))
|
||||
|
||||
- Update django-debug-toolbar to 5.1.0 ([#5732](https://github.com/cookiecutter/cookiecutter-django/pull/5732))
|
||||
|
||||
- Update ruff to 0.11.2 ([#5735](https://github.com/cookiecutter/cookiecutter-django/pull/5735))
|
||||
|
||||
- Bump amazon/aws-cli from 2.24.0 to 2.25.0 ([#5733](https://github.com/cookiecutter/cookiecutter-django/pull/5733))
|
||||
|
||||
- Auto-update pre-commit hooks ([#5657](https://github.com/cookiecutter/cookiecutter-django/pull/5657))
|
||||
|
||||
## 2025.03.19
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update pre-commit to 4.2.0 ([#5730](https://github.com/cookiecutter/cookiecutter-django/pull/5730))
|
||||
|
||||
## 2025.03.17
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.23.1 ([#5727](https://github.com/cookiecutter/cookiecutter-django/pull/5727))
|
||||
|
||||
- Update coverage to 7.7.0 ([#5725](https://github.com/cookiecutter/cookiecutter-django/pull/5725))
|
||||
|
||||
## 2025.03.15
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update psycopg to 3.2.6 ([#5721](https://github.com/cookiecutter/cookiecutter-django/pull/5721))
|
||||
|
||||
- Update ruff to 0.11.0 ([#5724](https://github.com/cookiecutter/cookiecutter-django/pull/5724))
|
||||
|
||||
## 2025.03.08
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.10 ([#5720](https://github.com/cookiecutter/cookiecutter-django/pull/5720))
|
||||
|
||||
## 2025.03.06
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django to 5.0.13 ([#5719](https://github.com/cookiecutter/cookiecutter-django/pull/5719))
|
||||
|
||||
## 2025.03.04
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Add groups for dependabot updates ([#5709](https://github.com/cookiecutter/cookiecutter-django/pull/5709))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sphinx to 8.3.0 ([#5714](https://github.com/cookiecutter/cookiecutter-django/pull/5714))
|
||||
|
||||
- Update pytest to 8.3.5 ([#5713](https://github.com/cookiecutter/cookiecutter-django/pull/5713))
|
||||
|
||||
## 2025.03.01
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.9 ([#5711](https://github.com/cookiecutter/cookiecutter-django/pull/5711))
|
||||
|
||||
## 2025.02.28
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.8 ([#5708](https://github.com/cookiecutter/cookiecutter-django/pull/5708))
|
||||
|
||||
- Bump babel-loader from 9.2.1 to 10.0.0 ([#5710](https://github.com/cookiecutter/cookiecutter-django/pull/5710))
|
||||
|
||||
## 2025.02.26
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump traefik from 3.3.3 to 3.3.4 ([#5705](https://github.com/cookiecutter/cookiecutter-django/pull/5705))
|
||||
|
||||
## 2025.02.25
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
- Fix links to FAQ about `contrib.sites` directory ([#5704](https://github.com/cookiecutter/cookiecutter-django/pull/5704))
|
||||
|
||||
## 2025.02.23
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Group dependabot docker directories ([#5698](https://github.com/cookiecutter/cookiecutter-django/pull/5698))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sphinx to 8.2.1 ([#5696](https://github.com/cookiecutter/cookiecutter-django/pull/5696))
|
||||
|
||||
- Update psycopg to 3.2.5 ([#5697](https://github.com/cookiecutter/cookiecutter-django/pull/5697))
|
||||
|
||||
## 2025.02.21
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djangorestframework-stubs to 3.15.3 ([#5695](https://github.com/cookiecutter/cookiecutter-django/pull/5695))
|
||||
|
||||
- Update sphinx to 8.2.0 ([#5693](https://github.com/cookiecutter/cookiecutter-django/pull/5693))
|
||||
|
||||
- Update ruff to 0.9.7 ([#5694](https://github.com/cookiecutter/cookiecutter-django/pull/5694))
|
||||
|
||||
## 2025.02.17
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.22.0 ([#5692](https://github.com/cookiecutter/cookiecutter-django/pull/5692))
|
||||
|
||||
- Update django-storages to 1.14.5 ([#5690](https://github.com/cookiecutter/cookiecutter-django/pull/5690))
|
||||
|
||||
## 2025.02.14
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump node from 22.13 to 22.14 ([#5688](https://github.com/cookiecutter/cookiecutter-django/pull/5688))
|
||||
|
||||
## 2025.02.13
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.21.0 ([#5687](https://github.com/cookiecutter/cookiecutter-django/pull/5687))
|
||||
|
||||
## 2025.02.11
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.12 ([#5686](https://github.com/cookiecutter/cookiecutter-django/pull/5686))
|
||||
|
||||
## 2025.02.10
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update pytest-django to 4.10.0 ([#5684](https://github.com/cookiecutter/cookiecutter-django/pull/5684))
|
||||
|
||||
- Update ruff to 0.9.6 ([#5683](https://github.com/cookiecutter/cookiecutter-django/pull/5683))
|
||||
|
||||
- Bump amazon/aws-cli from 2.23.0 to 2.24.0 ([#5682](https://github.com/cookiecutter/cookiecutter-django/pull/5682))
|
||||
|
||||
## 2025.02.08
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.11 ([#5681](https://github.com/cookiecutter/cookiecutter-django/pull/5681))
|
||||
|
||||
## 2025.02.07
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update mypy to 1.15.0 ([#5664](https://github.com/cookiecutter/cookiecutter-django/pull/5664))
|
||||
|
||||
- Update django-stubs to 5.1.3 ([#5680](https://github.com/cookiecutter/cookiecutter-django/pull/5680))
|
||||
|
||||
- Bump python from 3.12.8 to 3.12.9 in local Docker image ([#5678](https://github.com/cookiecutter/cookiecutter-django/pull/5678))
|
||||
|
||||
- Bump python from 3.12.8 to 3.12.9 in production Docker image ([#5677](https://github.com/cookiecutter/cookiecutter-django/pull/5677))
|
||||
|
||||
- Bump python from 3.12.8 to 3.12.9 in docs Docker image ([#5676](https://github.com/cookiecutter/cookiecutter-django/pull/5676))
|
||||
|
||||
- Update django-allauth to 65.4.1 ([#5679](https://github.com/cookiecutter/cookiecutter-django/pull/5679))
|
||||
|
||||
- Update django-cors-headers to 4.7.0 ([#5675](https://github.com/cookiecutter/cookiecutter-django/pull/5675))
|
||||
|
||||
- Update whitenoise to 6.9.0 ([#5674](https://github.com/cookiecutter/cookiecutter-django/pull/5674))
|
||||
|
||||
## 2025.02.06
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Bump node version in production Dockerfile from 20 to 22.13 ([#5672](https://github.com/cookiecutter/cookiecutter-django/pull/5672))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.5 ([#5673](https://github.com/cookiecutter/cookiecutter-django/pull/5673))
|
||||
|
||||
## 2025.02.05
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Add missing trailing slash in test `MEDIA_URL` ([#5666](https://github.com/cookiecutter/cookiecutter-django/pull/5666))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django to 5.0.12 ([#5667](https://github.com/cookiecutter/cookiecutter-django/pull/5667))
|
||||
|
||||
## 2025.02.03
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump traefik from 3.3.2 to 3.3.3 ([#5660](https://github.com/cookiecutter/cookiecutter-django/pull/5660))
|
||||
|
||||
- Update factory-boy to 3.3.2 ([#5661](https://github.com/cookiecutter/cookiecutter-django/pull/5661))
|
||||
|
||||
## 2025.01.30
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.4 ([#5659](https://github.com/cookiecutter/cookiecutter-django/pull/5659))
|
||||
|
||||
## 2025.01.26
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Migrate generated project from `runtime.txt` to `.python-version` ([#5652](https://github.com/cookiecutter/cookiecutter-django/pull/5652))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Update Heroku deployment guide ([#5656](https://github.com/cookiecutter/cookiecutter-django/pull/5656))
|
||||
|
||||
## 2025.01.24
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.3 ([#5654](https://github.com/cookiecutter/cookiecutter-django/pull/5654))
|
||||
|
||||
## 2025.01.21
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Update linter error code from TCH to TC ([#5651](https://github.com/cookiecutter/cookiecutter-django/pull/5651))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update pre-commit to 4.1.0 ([#5650](https://github.com/cookiecutter/cookiecutter-django/pull/5650))
|
||||
|
||||
## 2025.01.20
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Group all API tests under a `tests.api` namespace ([#5615](https://github.com/cookiecutter/cookiecutter-django/pull/5615))
|
||||
|
||||
- Migrate post-generation hook to pathlib ([#5648](https://github.com/cookiecutter/cookiecutter-django/pull/5648))
|
||||
|
||||
## 2025.01.16
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.2 ([#5646](https://github.com/cookiecutter/cookiecutter-django/pull/5646))
|
||||
|
||||
- Bump amazon/aws-cli from 2.22.1 to 2.23.0 ([#5645](https://github.com/cookiecutter/cookiecutter-django/pull/5645))
|
||||
|
||||
## 2025.01.15
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix setting for to `CELERY_WORKER_HIJACK_ROOT_LOGGER` ([#5643](https://github.com/cookiecutter/cookiecutter-django/pull/5643))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update psycopg to 3.2.4 ([#5644](https://github.com/cookiecutter/cookiecutter-django/pull/5644))
|
||||
|
||||
- Update django-stubs to 5.1.2 ([#5639](https://github.com/cookiecutter/cookiecutter-django/pull/5639))
|
||||
|
||||
- Bump traefik from 3.3.1 to 3.3.2 ([#5642](https://github.com/cookiecutter/cookiecutter-django/pull/5642))
|
||||
|
||||
## 2025.01.14
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django to 5.0.11 ([#5640](https://github.com/cookiecutter/cookiecutter-django/pull/5640))
|
||||
|
||||
- Update sentry-sdk to 2.20.0 ([#5638](https://github.com/cookiecutter/cookiecutter-django/pull/5638))
|
||||
|
||||
- Update django-debug-toolbar to 5.0.1 ([#5636](https://github.com/cookiecutter/cookiecutter-django/pull/5636))
|
||||
|
||||
## 2025.01.13
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-environ to 0.12.0 ([#5635](https://github.com/cookiecutter/cookiecutter-django/pull/5635))
|
||||
|
||||
- Bump traefik from 3.3.0 to 3.3.1 ([#5634](https://github.com/cookiecutter/cookiecutter-django/pull/5634))
|
||||
|
||||
## 2025.01.11
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.9.1 ([#5633](https://github.com/cookiecutter/cookiecutter-django/pull/5633))
|
||||
|
||||
## 2025.01.10
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update watchfiles to 1.0.4 ([#5631](https://github.com/cookiecutter/cookiecutter-django/pull/5631))
|
||||
|
||||
## 2025.01.09
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Drop support for Python 2 in template generation hooks ([#5614](https://github.com/cookiecutter/cookiecutter-django/pull/5614))
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump node from 22.12 to 22.13 ([#5627](https://github.com/cookiecutter/cookiecutter-django/pull/5627))
|
||||
|
||||
## 2025.01.07
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Set `minimum_pre_commit_version` in pre-commit config ([#5626](https://github.com/cookiecutter/cookiecutter-django/pull/5626))
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump traefik from 3.2.3 to 3.3.0 ([#5625](https://github.com/cookiecutter/cookiecutter-django/pull/5625))
|
||||
|
||||
## 2025.01.06
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Add justfile for use with docker ([#5621](https://github.com/cookiecutter/cookiecutter-django/pull/5621))
|
||||
|
||||
## 2025.01.04
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.6 ([#5622](https://github.com/cookiecutter/cookiecutter-django/pull/5622))
|
||||
|
||||
## 2025.01.02
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix logging configuration for Celery tasks ([#5563](https://github.com/cookiecutter/cookiecutter-django/pull/5563))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.5 ([#5619](https://github.com/cookiecutter/cookiecutter-django/pull/5619))
|
||||
|
||||
- Update pillow to 11.1.0 ([#5617](https://github.com/cookiecutter/cookiecutter-django/pull/5617))
|
||||
|
||||
## 2024.12.27
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.10 ([#5608](https://github.com/cookiecutter/cookiecutter-django/pull/5608))
|
||||
|
||||
- Update uvicorn-worker to 0.3.0 ([#5607](https://github.com/cookiecutter/cookiecutter-django/pull/5607))
|
||||
|
||||
## 2024.12.26
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update collectfasta to 3.2.1 ([#5606](https://github.com/cookiecutter/cookiecutter-django/pull/5606))
|
||||
|
||||
- Update django-allauth to 65.3.1 ([#5605](https://github.com/cookiecutter/cookiecutter-django/pull/5605))
|
||||
|
||||
## 2024.12.24
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djlint to 1.36.4 ([#5603](https://github.com/cookiecutter/cookiecutter-django/pull/5603))
|
||||
|
||||
- Update uvicorn to 0.34.0 ([#5592](https://github.com/cookiecutter/cookiecutter-django/pull/5592))
|
||||
|
||||
## 2024.12.23
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump webpack-cli from 5.1.4 to 6.0.1 ([#5601](https://github.com/cookiecutter/cookiecutter-django/pull/5601))
|
||||
|
||||
## 2024.12.20
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.4 ([#5595](https://github.com/cookiecutter/cookiecutter-django/pull/5595))
|
||||
|
||||
## 2024.12.17
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djangorestframework-stubs to 3.15.2 ([#5591](https://github.com/cookiecutter/cookiecutter-django/pull/5591))
|
||||
|
||||
- Bump traefik from 3.2.2 to 3.2.3 ([#5594](https://github.com/cookiecutter/cookiecutter-django/pull/5594))
|
||||
|
||||
## 2024.12.12
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.3 ([#5587](https://github.com/cookiecutter/cookiecutter-django/pull/5587))
|
||||
|
||||
## 2024.12.11
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump traefik from 3.2.1 to 3.2.2 ([#5586](https://github.com/cookiecutter/cookiecutter-django/pull/5586))
|
||||
|
||||
## 2024.12.10
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update watchfiles to 1.0.3 ([#5585](https://github.com/cookiecutter/cookiecutter-django/pull/5585))
|
||||
|
||||
- Bump node from 22.11 to 22.12 ([#5583](https://github.com/cookiecutter/cookiecutter-django/pull/5583))
|
||||
|
||||
## 2024.12.08
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Pin node to version 22.11 ([#5582](https://github.com/cookiecutter/cookiecutter-django/pull/5582))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.2 ([#5576](https://github.com/cookiecutter/cookiecutter-django/pull/5576))
|
||||
|
||||
- Update coverage to 7.6.9 ([#5581](https://github.com/cookiecutter/cookiecutter-django/pull/5581))
|
||||
|
||||
- Update sentry-sdk to 2.19.2 ([#5579](https://github.com/cookiecutter/cookiecutter-django/pull/5579))
|
||||
|
||||
- Bump python from 3.12.7 to 3.12.8 in production Docker image ([#5575](https://github.com/cookiecutter/cookiecutter-django/pull/5575))
|
||||
|
||||
- Bump python from 3.12.7 to 3.12.8 in local Docker image ([#5574](https://github.com/cookiecutter/cookiecutter-django/pull/5574))
|
||||
|
||||
- Bump python from 3.12.7 to 3.12.8 in docs Docker image ([#5573](https://github.com/cookiecutter/cookiecutter-django/pull/5573))
|
||||
|
||||
- Update hiredis to 3.1.0 ([#5571](https://github.com/cookiecutter/cookiecutter-django/pull/5571))
|
||||
|
||||
- Update redis to 5.2.1 ([#5580](https://github.com/cookiecutter/cookiecutter-django/pull/5580))
|
||||
|
||||
- Update django to 5.0.10 ([#5572](https://github.com/cookiecutter/cookiecutter-django/pull/5572))
|
||||
|
||||
- Update drf-spectacular to 0.28.0 ([#5564](https://github.com/cookiecutter/cookiecutter-django/pull/5564))
|
||||
|
||||
## 2024.12.03
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-upgrade to 1.22.2 ([#5567](https://github.com/cookiecutter/cookiecutter-django/pull/5567))
|
||||
|
||||
## 2024.12.02
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update pytest to 8.3.4 ([#5566](https://github.com/cookiecutter/cookiecutter-django/pull/5566))
|
||||
|
||||
## 2024.12.01
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-allauth to 65.3.0 ([#5565](https://github.com/cookiecutter/cookiecutter-django/pull/5565))
|
||||
|
||||
## 2024.11.29
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.1 ([#5557](https://github.com/cookiecutter/cookiecutter-django/pull/5557))
|
||||
|
||||
- Update djlint to 1.36.3 ([#5558](https://github.com/cookiecutter/cookiecutter-django/pull/5558))
|
||||
|
||||
## 2024.11.28
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djlint to 1.36.2 ([#5555](https://github.com/cookiecutter/cookiecutter-django/pull/5555))
|
||||
|
||||
## 2024.11.27
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Pin dart-sass to 1.77.6 to avoid deprecation warnings ([#5552](https://github.com/cookiecutter/cookiecutter-django/pull/5552))
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump gulp-imagemin from 7.1.0 to 9.1.0 ([#5052](https://github.com/cookiecutter/cookiecutter-django/pull/5052))
|
||||
|
||||
- Bump gulp from 4.0.2 to 5.0.0 ([#4949](https://github.com/cookiecutter/cookiecutter-django/pull/4949))
|
||||
|
||||
## 2024.11.26
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.8 ([#5547](https://github.com/cookiecutter/cookiecutter-django/pull/5547))
|
||||
|
||||
- Update watchfiles to 1.0.0 ([#5548](https://github.com/cookiecutter/cookiecutter-django/pull/5548))
|
||||
|
||||
## 2024.11.22
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.8.0 ([#5545](https://github.com/cookiecutter/cookiecutter-django/pull/5545))
|
||||
|
||||
## 2024.11.21
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Add support for secure Redis (TLS support) ([#5526](https://github.com/cookiecutter/cookiecutter-django/pull/5526))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.19.0 ([#5543](https://github.com/cookiecutter/cookiecutter-django/pull/5543))
|
||||
|
||||
- Update uvicorn to 0.32.1 ([#5539](https://github.com/cookiecutter/cookiecutter-django/pull/5539))
|
||||
|
||||
- Bump traefik from 3.2.0 to 3.2.1 ([#5541](https://github.com/cookiecutter/cookiecutter-django/pull/5541))
|
||||
|
||||
## 2024.11.20
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix typos in translation instructions in README ([#5538](https://github.com/cookiecutter/cookiecutter-django/pull/5538))
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump amazon/aws-cli from 2.21.0 to 2.22.1 ([#5537](https://github.com/cookiecutter/cookiecutter-django/pull/5537))
|
||||
|
||||
## 2024.11.16
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.7.4 ([#5531](https://github.com/cookiecutter/cookiecutter-django/pull/5531))
|
||||
|
||||
## 2024.11.15
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.5 ([#5529](https://github.com/cookiecutter/cookiecutter-django/pull/5529))
|
||||
|
||||
## 2024.11.14
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump amazon/aws-cli from 2.20.0 to 2.21.0 ([#5528](https://github.com/cookiecutter/cookiecutter-django/pull/5528))
|
||||
|
||||
## 2024.11.13
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update werkzeug to 3.1.3 ([#5524](https://github.com/cookiecutter/cookiecutter-django/pull/5524))
|
||||
|
||||
- Update ruff to 0.7.3 ([#5521](https://github.com/cookiecutter/cookiecutter-django/pull/5521))
|
||||
|
||||
- Bump amazon/aws-cli from 2.19.0 to 2.20.0 ([#5527](https://github.com/cookiecutter/cookiecutter-django/pull/5527))
|
||||
|
||||
- Update django-allauth to 65.2.0 ([#5523](https://github.com/cookiecutter/cookiecutter-django/pull/5523))
|
||||
|
||||
## 2024.11.08
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff pre-commit hook to 0.7.3 ([#5522](https://github.com/cookiecutter/cookiecutter-django/pull/5522))
|
||||
|
||||
## 2024.11.07
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djlint to 1.36.1 ([#5519](https://github.com/cookiecutter/cookiecutter-django/pull/5519))
|
||||
|
||||
## 2024.11.05
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djlint to 1.36.0 ([#5517](https://github.com/cookiecutter/cookiecutter-django/pull/5517))
|
||||
|
||||
## 2024.11.04
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.18.0 ([#5515](https://github.com/cookiecutter/cookiecutter-django/pull/5515))
|
||||
|
||||
## 2024.11.02
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.7.2 ([#5510](https://github.com/cookiecutter/cookiecutter-django/pull/5510))
|
||||
|
||||
## 2024.11.01
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djlint to 1.35.4 ([#5508](https://github.com/cookiecutter/cookiecutter-django/pull/5508))
|
||||
|
||||
- Bump amazon/aws-cli from 2.18.1 to 2.19.0 ([#5507](https://github.com/cookiecutter/cookiecutter-django/pull/5507))
|
||||
|
||||
## 2024.10.30
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
- Small spelling correction in comment ([#5502](https://github.com/cookiecutter/cookiecutter-django/pull/5502))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update djlint to 1.35.3 ([#5503](https://github.com/cookiecutter/cookiecutter-django/pull/5503))
|
||||
|
||||
- Update whitenoise to 6.8.2 ([#5501](https://github.com/cookiecutter/cookiecutter-django/pull/5501))
|
||||
|
||||
## 2024.10.29
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-cors-headers to 4.6.0 ([#5499](https://github.com/cookiecutter/cookiecutter-django/pull/5499))
|
||||
|
||||
- Update whitenoise to 6.8.1 ([#5497](https://github.com/cookiecutter/cookiecutter-django/pull/5497))
|
||||
|
||||
- Bump traefik from 3.1.6 to 3.2.0 ([#5498](https://github.com/cookiecutter/cookiecutter-django/pull/5498))
|
||||
|
||||
## 2024.10.26
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update django-stubs to 5.1.1 ([#5495](https://github.com/cookiecutter/cookiecutter-django/pull/5495))
|
||||
|
||||
- Update mypy to 1.13.0 ([#5484](https://github.com/cookiecutter/cookiecutter-django/pull/5484))
|
||||
|
||||
- Update werkzeug to 3.0.6 ([#5492](https://github.com/cookiecutter/cookiecutter-django/pull/5492))
|
||||
|
||||
## 2024.10.25
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update werkzeug to 3.0.5 and unpin watchdog<5 ([#5489](https://github.com/cookiecutter/cookiecutter-django/pull/5489))
|
||||
|
||||
## 2024.10.24
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.7.1 ([#5487](https://github.com/cookiecutter/cookiecutter-django/pull/5487))
|
||||
|
||||
- Update redis to 5.2.0 ([#5486](https://github.com/cookiecutter/cookiecutter-django/pull/5486))
|
||||
|
||||
- Update django-allauth to 65.1.0 ([#5485](https://github.com/cookiecutter/cookiecutter-django/pull/5485))
|
||||
|
||||
## 2024.10.22
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix broken links in generated README ([#5482](https://github.com/cookiecutter/cookiecutter-django/pull/5482))
|
||||
|
||||
### Updated
|
||||
|
||||
- Auto-update pre-commit hooks ([#5483](https://github.com/cookiecutter/cookiecutter-django/pull/5483))
|
||||
|
||||
## 2024.10.21
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Remove CELERY_BROKER_URL in favor of REDIS_URL ([#4861](https://github.com/cookiecutter/cookiecutter-django/pull/4861))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix a number of issues with Azure storage ([#5476](https://github.com/cookiecutter/cookiecutter-django/pull/5476))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.4 ([#5480](https://github.com/cookiecutter/cookiecutter-django/pull/5480))
|
||||
|
||||
## 2024.10.17
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.7.0 ([#5474](https://github.com/cookiecutter/cookiecutter-django/pull/5474))
|
||||
|
||||
- Update uvicorn to 0.32.0 ([#5471](https://github.com/cookiecutter/cookiecutter-django/pull/5471))
|
||||
|
||||
- Update pillow to 11.0.0 ([#5470](https://github.com/cookiecutter/cookiecutter-django/pull/5470))
|
||||
|
||||
- Update sentry-sdk to 2.17.0 ([#5473](https://github.com/cookiecutter/cookiecutter-django/pull/5473))
|
||||
|
||||
## 2024.10.15
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- [pre-commit.ci] pre-commit autoupdate ([#5468](https://github.com/cookiecutter/cookiecutter-django/pull/5468))
|
||||
|
||||
## 2024.10.14
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Add requirements for ubuntu 24.04 ([#5467](https://github.com/cookiecutter/cookiecutter-django/pull/5467))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sphinx to 8.1.3 ([#5463](https://github.com/cookiecutter/cookiecutter-django/pull/5463))
|
||||
|
||||
- Update coverage to 7.6.3 ([#5464](https://github.com/cookiecutter/cookiecutter-django/pull/5464))
|
||||
|
||||
## 2024.10.12
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Pin Python version to 3.12 ([#5456](https://github.com/cookiecutter/cookiecutter-django/pull/5456))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sphinx to 8.1.1 ([#5457](https://github.com/cookiecutter/cookiecutter-django/pull/5457))
|
||||
|
||||
- Auto-update pre-commit hooks ([#5458](https://github.com/cookiecutter/cookiecutter-django/pull/5458))
|
||||
|
||||
- Update django-cors-headers to 4.5.0 ([#5459](https://github.com/cookiecutter/cookiecutter-django/pull/5459))
|
||||
|
||||
## 2024.10.11
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Update README.md broken links ([#5454](https://github.com/cookiecutter/cookiecutter-django/pull/5454))
|
||||
|
||||
- wait-for-it as dependency in the run stage ([#5452](https://github.com/cookiecutter/cookiecutter-django/pull/5452))
|
||||
|
||||
### Updated
|
||||
|
||||
- Auto-update pre-commit hooks ([#5450](https://github.com/cookiecutter/cookiecutter-django/pull/5450))
|
||||
|
||||
## 2024.10.10
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.16.0 ([#5444](https://github.com/cookiecutter/cookiecutter-django/pull/5444))
|
||||
|
||||
- Bump traefik from 3.1.5 to 3.1.6 ([#5449](https://github.com/cookiecutter/cookiecutter-django/pull/5449))
|
||||
|
||||
## 2024.10.09
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update coverage to 7.6.2 ([#5448](https://github.com/cookiecutter/cookiecutter-django/pull/5448))
|
||||
|
||||
## 2024.10.08
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- [pre-commit.ci] pre-commit autoupdate ([#5441](https://github.com/cookiecutter/cookiecutter-django/pull/5441))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update pre-commit to 4.0.1 ([#5445](https://github.com/cookiecutter/cookiecutter-django/pull/5445))
|
||||
|
||||
- Bump amazon/aws-cli from 2.18.0 to 2.18.1 in /{{cookiecutter.project_slug}}/compose/production/aws ([#5443](https://github.com/cookiecutter/cookiecutter-django/pull/5443))
|
||||
|
||||
- Auto-update pre-commit hooks ([#5442](https://github.com/cookiecutter/cookiecutter-django/pull/5442))
|
||||
|
||||
## 2024.10.07
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
- Docs: fix Mailgun include in troubleshooting sections ([#5439](https://github.com/cookiecutter/cookiecutter-django/pull/5439))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sphinx to 8.0.2 ([#5263](https://github.com/cookiecutter/cookiecutter-django/pull/5263))
|
||||
|
||||
- Update pre-commit to 4.0.0 ([#5432](https://github.com/cookiecutter/cookiecutter-django/pull/5432))
|
||||
|
||||
- Auto-update pre-commit hooks ([#5433](https://github.com/cookiecutter/cookiecutter-django/pull/5433))
|
||||
|
||||
- Update sphinx-rtd-theme to 3.0.0 ([#5437](https://github.com/cookiecutter/cookiecutter-django/pull/5437))
|
||||
|
||||
- Bump amazon/aws-cli from 2.17.0 to 2.18.0 in /{{cookiecutter.project_slug}}/compose/production/aws ([#5436](https://github.com/cookiecutter/cookiecutter-django/pull/5436))
|
||||
|
||||
## 2024.10.05
|
||||
|
||||
|
||||
### Changed
|
||||
|
||||
- Replace pip with uv for the project files ([#5356](https://github.com/cookiecutter/cookiecutter-django/pull/5356))
|
||||
|
||||
- Use wait-for-it in favor of the custom python script when waiting for postgres ([#5327](https://github.com/cookiecutter/cookiecutter-django/pull/5327))
|
||||
|
||||
### Documentation
|
||||
|
||||
- Spit docs into sections ([#5426](https://github.com/cookiecutter/cookiecutter-django/pull/5426))
|
||||
|
||||
### Updated
|
||||
|
||||
- Update crispy-bootstrap5 to 2024.10 ([#5430](https://github.com/cookiecutter/cookiecutter-django/pull/5430))
|
||||
|
||||
## 2024.10.04
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update ruff to 0.6.9 ([#5428](https://github.com/cookiecutter/cookiecutter-django/pull/5428))
|
||||
|
||||
- Update redis to 5.1.1 ([#5427](https://github.com/cookiecutter/cookiecutter-django/pull/5427))
|
||||
|
||||
## 2024.10.03
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sphinx-autobuild to 2024.10.3 ([#5420](https://github.com/cookiecutter/cookiecutter-django/pull/5420))
|
||||
|
||||
- Bump traefik from 3.1.4 to 3.1.5 ([#5423](https://github.com/cookiecutter/cookiecutter-django/pull/5423))
|
||||
|
||||
## 2024.10.02
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Bump python from 3.12.6 to 3.12.7 in docs Docker image ([#5416](https://github.com/cookiecutter/cookiecutter-django/pull/5416))
|
||||
|
||||
- Bump python from 3.12.6 to 3.12.7 in local Docker image ([#5415](https://github.com/cookiecutter/cookiecutter-django/pull/5415))
|
||||
|
||||
- Bump python from 3.12.6 to 3.12.7 production Docker ([#5414](https://github.com/cookiecutter/cookiecutter-django/pull/5414))
|
||||
|
||||
## 2024.10.01
|
||||
|
||||
|
||||
### Updated
|
||||
|
||||
- Update sentry-sdk to 2.15.0 ([#5413](https://github.com/cookiecutter/cookiecutter-django/pull/5413))
|
||||
|
||||
## 2024.09.29
|
||||
|
||||
|
||||
|
|
|
@ -24,33 +24,20 @@ We'll also run the tests on GitHub actions when you send your pull request, but
|
|||
|
||||
### Installation
|
||||
|
||||
First, make sure that your version of Python is 3.12:
|
||||
|
||||
```bash
|
||||
$ python --version
|
||||
Python 3.12.2
|
||||
```
|
||||
|
||||
Any version that starts with 3.12 will do. If you need to install it, you can get it from [python.org](https://www.python.org/downloads/).
|
||||
|
||||
Then install `tox`, if not already installed:
|
||||
|
||||
```bash
|
||||
$ python -m pip install tox
|
||||
```
|
||||
We use uv to manage our environment and manage our Python installation. You can install it following the instructions at https://docs.astral.sh/uv/getting-started/installation/
|
||||
|
||||
### Run the template's test suite
|
||||
|
||||
To run the tests of the template using the current Python version:
|
||||
|
||||
```bash
|
||||
$ tox -e py
|
||||
$ uv run tox run -e py
|
||||
```
|
||||
|
||||
This uses `pytest `under the hood, and you can pass options to it after a `--`. So to run a particular test:
|
||||
|
||||
```bash
|
||||
$ tox -e py -- -k test_default_configuration
|
||||
$ uv run tox run -e py -- -k test_default_configuration
|
||||
```
|
||||
|
||||
For further information, please consult the [pytest usage docs](https://pytest.org/en/latest/how-to/usage.html#specifying-which-tests-to-run).
|
||||
|
|
|
@ -201,6 +201,20 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aidos Kanapyanov</td>
|
||||
<td>
|
||||
<a href="https://github.com/aidoskanapyanov">aidoskanapyanov</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alan Cyment</td>
|
||||
<td>
|
||||
<a href="https://github.com/acyment">acyment</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alberto Sanchez</td>
|
||||
<td>
|
||||
|
@ -544,6 +558,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Christian Jensen</td>
|
||||
<td>
|
||||
<a href="https://github.com/jensenbox">jensenbox</a>
|
||||
</td>
|
||||
<td>cjensen</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Christopher Clarke</td>
|
||||
<td>
|
||||
|
@ -726,6 +747,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Denis Darii</td>
|
||||
<td>
|
||||
<a href="https://github.com/DNX">DNX</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Denis Orehovsky</td>
|
||||
<td>
|
||||
|
@ -789,6 +817,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ed Morley</td>
|
||||
<td>
|
||||
<a href="https://github.com/edmorley">edmorley</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Emanuel Calso</td>
|
||||
<td>
|
||||
|
@ -880,6 +915,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Francisco Navarro Morales </td>
|
||||
<td>
|
||||
<a href="https://github.com/spothound">spothound</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Freddy</td>
|
||||
<td>
|
||||
|
@ -978,6 +1020,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hana Belay</td>
|
||||
<td>
|
||||
<a href="https://github.com/earthcomfy">earthcomfy</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hana Quadara</td>
|
||||
<td>
|
||||
|
@ -1062,6 +1111,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Igor Jerosimić</td>
|
||||
<td>
|
||||
<a href="https://github.com/igor-wl">igor-wl</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Imran Rahman</td>
|
||||
<td>
|
||||
|
@ -1279,6 +1335,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kawsar Alam Foysal</td>
|
||||
<td>
|
||||
<a href="https://github.com/iamfoysal">iamfoysal</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Keith Bailey</td>
|
||||
<td>
|
||||
|
@ -1482,6 +1545,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mariot Tsitoara</td>
|
||||
<td>
|
||||
<a href="https://github.com/mariot">mariot</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Marlon Castillo</td>
|
||||
<td>
|
||||
|
@ -1818,6 +1888,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pepa</td>
|
||||
<td>
|
||||
<a href="https://github.com/07pepa">07pepa</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Peter Bittner</td>
|
||||
<td>
|
||||
|
@ -1860,6 +1937,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pulse-Mind</td>
|
||||
<td>
|
||||
<a href="https://github.com/pulse-mind">pulse-mind</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>quroom</td>
|
||||
<td>
|
||||
|
@ -1867,6 +1951,13 @@ Listed in alphabetical order.
|
|||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>qwerrrqw</td>
|
||||
<td>
|
||||
<a href="https://github.com/qwerrrqw">qwerrrqw</a>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Raony Guimarães Corrêa</td>
|
||||
<td>
|
||||
|
|
15
README.md
15
README.md
|
@ -13,13 +13,13 @@ Powered by [Cookiecutter](https://github.com/cookiecutter/cookiecutter), Cookiec
|
|||
production-ready Django projects quickly.
|
||||
|
||||
- Documentation: <https://cookiecutter-django.readthedocs.io/en/latest/>
|
||||
- See [Troubleshooting](https://cookiecutter-django.readthedocs.io/en/latest/troubleshooting.html) for common errors and obstacles
|
||||
- See [Troubleshooting](https://cookiecutter-django.readthedocs.io/en/latest/5-help/troubleshooting.html) for common errors and obstacles
|
||||
- If you have problems with Cookiecutter Django, please open [issues](https://github.com/cookiecutter/cookiecutter-django/issues/new) don't send
|
||||
emails to the maintainers.
|
||||
|
||||
## Features
|
||||
|
||||
- For Django 5.0
|
||||
- For Django 5.1
|
||||
- Works with Python 3.12
|
||||
- Renders Django projects with 100% starting test coverage
|
||||
- Twitter [Bootstrap](https://github.com/twbs/bootstrap) v5
|
||||
|
@ -51,7 +51,7 @@ _These features can be enabled during initial project setup._
|
|||
## Constraints
|
||||
|
||||
- Only maintained 3rd party libraries are used.
|
||||
- Uses PostgreSQL everywhere: 12 - 16 ([MySQL fork](https://github.com/mabdullahadeel/cookiecutter-django-mysql) also available).
|
||||
- Uses PostgreSQL everywhere: 13 - 16 ([MySQL fork](https://github.com/mabdullahadeel/cookiecutter-django-mysql) also available).
|
||||
- Environment variables for configuration (This won't work with Apache/mod_wsgi).
|
||||
|
||||
## Support this Project!
|
||||
|
@ -94,7 +94,7 @@ You'll be prompted for some values. Provide them, then a Django project will be
|
|||
|
||||
**Warning**: After this point, change 'Daniel Greenfeld', 'pydanny', etc to your own information.
|
||||
|
||||
Answer the prompts with your own desired [options](http://cookiecutter-django.readthedocs.io/en/latest/project-generation-options.html). For example:
|
||||
Answer the prompts with your own desired [options](http://cookiecutter-django.readthedocs.io/en/latest/1-getting-started/project-generation-options.html). For example:
|
||||
|
||||
Cloning into 'cookiecutter-django'...
|
||||
remote: Counting objects: 550, done.
|
||||
|
@ -133,8 +133,7 @@ Answer the prompts with your own desired [options](http://cookiecutter-django.re
|
|||
2 - 15
|
||||
3 - 14
|
||||
4 - 13
|
||||
5 - 12
|
||||
Choose from 1, 2, 3, 4, 5 [1]: 1
|
||||
Choose from 1, 2, 3, 4 [1]: 1
|
||||
Select cloud_provider:
|
||||
1 - AWS
|
||||
2 - GCP
|
||||
|
@ -190,8 +189,8 @@ Now take a look at your repo. Don't forget to carefully look at the generated RE
|
|||
|
||||
For local development, see the following:
|
||||
|
||||
- [Developing locally](http://cookiecutter-django.readthedocs.io/en/latest/developing-locally.html)
|
||||
- [Developing locally using docker](http://cookiecutter-django.readthedocs.io/en/latest/developing-locally-docker.html)
|
||||
- [Developing locally](https://cookiecutter-django.readthedocs.io/en/latest/2-local-development/developing-locally.html)
|
||||
- [Developing locally using docker](https://cookiecutter-django.readthedocs.io/en/latest/2-local-development/developing-locally-docker.html)
|
||||
|
||||
## Community
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"windows": "n",
|
||||
"editor": ["None", "PyCharm", "VS Code"],
|
||||
"use_docker": "n",
|
||||
"postgresql_version": ["16", "15", "14", "13", "12"],
|
||||
"postgresql_version": ["16", "15", "14", "13"],
|
||||
"cloud_provider": ["AWS", "GCP", "Azure", "None"],
|
||||
"mail_service": [
|
||||
"Mailgun",
|
||||
|
|
|
@ -70,7 +70,6 @@ postgresql_version:
|
|||
2. 15
|
||||
3. 14
|
||||
4. 13
|
||||
5. 12
|
||||
|
||||
cloud_provider:
|
||||
Select a cloud provider for static & media files. The choices are:
|
|
@ -39,7 +39,6 @@ The following table lists settings and their defaults for third-party applicatio
|
|||
======================================= =========================== ============================================== ======================================================================
|
||||
Environment Variable Django Setting Development Default Production Default
|
||||
======================================= =========================== ============================================== ======================================================================
|
||||
CELERY_BROKER_URL CELERY_BROKER_URL auto w/ Docker; raises error w/o raises error
|
||||
DJANGO_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID n/a raises error
|
||||
DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a raises error
|
||||
DJANGO_AWS_STORAGE_BUCKET_NAME AWS_STORAGE_BUCKET_NAME n/a raises error
|
|
@ -242,6 +242,41 @@ The stack comes with a dedicated node service to build the static assets, watch
|
|||
.. _Sass: https://sass-lang.com/
|
||||
.. _live reloading: https://browsersync.io
|
||||
|
||||
|
||||
Using Just for Docker Commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
We have included a ``justfile`` to simplify the use of frequent Docker commands for local development.
|
||||
|
||||
.. warning::
|
||||
Currently, "Just" does not reliably handle signals or forward them to its subprocesses. As a result,
|
||||
pressing CTRL+C (or sending other signals like SIGTERM, SIGINT, or SIGHUP) may only interrupt
|
||||
"Just" itself rather than its subprocesses.
|
||||
For more information, see `this GitHub issue <https://github.com/casey/just/issues/2473>`_.
|
||||
|
||||
First, install Just using one of the methods described in the `official documentation <https://just.systems/man/en/packages.html>`_.
|
||||
|
||||
Here are the available commands:
|
||||
|
||||
- ``just build``
|
||||
Builds the Python image using the local Docker Compose file.
|
||||
|
||||
- ``just up``
|
||||
Starts the containers in detached mode and removes orphaned containers.
|
||||
|
||||
- ``just down``
|
||||
Stops the running containers.
|
||||
|
||||
- ``just prune``
|
||||
Stops and removes containers along with their volumes. You can optionally pass an argument with the service name to prune a single container.
|
||||
|
||||
- ``just logs``
|
||||
Shows container logs. You can optionally pass an argument with the service name to view logs for a specific service.
|
||||
|
||||
- ``just manage <command>``
|
||||
Runs Django management commands within the container. Replace ``<command>`` with any valid Django management command, such as ``migrate``, ``createsuperuser``, or ``shell``.
|
||||
|
||||
|
||||
(Optionally) Developing locally with HTTPS
|
||||
------------------------------------------
|
||||
|
||||
|
@ -257,7 +292,7 @@ Here is a link to an article on `how to add HTTPS using Nginx`_ to your local do
|
|||
Webpack
|
||||
~~~~~~~
|
||||
|
||||
If you are using Webpack, first install ``mkcert``_. It is a simple by design tool that hides all the arcane knowledge required to generate valid TLS certificates. It works for any hostname or IP, including localhost. It supports macOS, Linux, and Windows, and Firefox, Chrome and Java. It even works on mobile devices with a couple manual steps. See https://blog.filippo.io/mkcert-valid-https-certificates-for-localhost/
|
||||
If you are using Webpack, first install `mkcert`_. It is a simple by design tool that hides all the arcane knowledge required to generate valid TLS certificates. It works for any hostname or IP, including localhost. It supports macOS, Linux, and Windows, and Firefox, Chrome and Java. It even works on mobile devices with a couple manual steps. See https://blog.filippo.io/mkcert-valid-https-certificates-for-localhost/
|
||||
|
||||
.. _`mkcert`: https://github.com/FiloSottile/mkcert/blob/master/README.md#supported-root-stores
|
||||
|
||||
|
@ -267,36 +302,36 @@ Assuming that you registered your local hostname as ``my-dev-env.local``, the ce
|
|||
|
||||
1. Add the ``nginx-proxy`` service to the ``docker-compose.local.yml``. ::
|
||||
|
||||
nginx-proxy:
|
||||
image: jwilder/nginx-proxy:alpine
|
||||
container_name: nginx-proxy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./certs:/etc/nginx/certs
|
||||
restart: always
|
||||
depends_on:
|
||||
- node
|
||||
environment:
|
||||
- VIRTUAL_HOST=my-dev-env.local
|
||||
- VIRTUAL_PORT=3000
|
||||
nginx-proxy:
|
||||
image: jwilder/nginx-proxy:alpine
|
||||
container_name: nginx-proxy
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./certs:/etc/nginx/certs
|
||||
restart: always
|
||||
depends_on:
|
||||
- node
|
||||
environment:
|
||||
- VIRTUAL_HOST=my-dev-env.local
|
||||
- VIRTUAL_PORT=3000
|
||||
|
||||
2. Add the local secure domain to the ``config/settings/local.py``. You should allow the new hostname ::
|
||||
|
||||
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1", "my-dev-env.local"]
|
||||
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1", "my-dev-env.local"]
|
||||
|
||||
3. Add the following configuration to the ``devServer`` section of ``webpack/dev.config.js`` ::
|
||||
|
||||
client: {
|
||||
webSocketURL: 'auto://0.0.0.0:0/ws', // note the `:0` after `0.0.0.0`
|
||||
},
|
||||
client: {
|
||||
webSocketURL: 'auto://0.0.0.0:0/ws', // note the `:0` after `0.0.0.0`
|
||||
},
|
||||
|
||||
|
||||
Rebuild your ``docker`` application. ::
|
||||
|
||||
$ docker compose -f docker-compose.local.yml up -d --build
|
||||
$ docker compose -f docker-compose.local.yml up -d --build
|
||||
|
||||
Go to your browser and type in your URL bar ``https://my-dev-env.local``.
|
||||
|
|
@ -24,8 +24,7 @@ First things first.
|
|||
|
||||
$ source <virtual env path>/bin/activate
|
||||
|
||||
#.
|
||||
.. include:: generate-project-block.rst
|
||||
#. .. include:: generate-project-block.rst
|
||||
|
||||
#. Install development requirements: ::
|
||||
|
||||
|
@ -56,8 +55,6 @@ First things first.
|
|||
#. Set the environment variables for your database(s): ::
|
||||
|
||||
$ export DATABASE_URL=postgres://postgres:<password>@127.0.0.1:5432/<DB name given to createdb>
|
||||
# Optional: set broker URL if using Celery
|
||||
$ export CELERY_BROKER_URL=redis://localhost:6379/0
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -219,7 +216,7 @@ The project comes with a simple task for manual testing purposes, inside `<proje
|
|||
|
||||
You can also use Django admin to queue up tasks, thanks to the `django-celerybeat`_ package.
|
||||
|
||||
.. _Getting started with Redis guide: https://redis.io/docs/getting-started/
|
||||
.. _Getting started with Redis: https://redis.io/docs/getting-started/
|
||||
.. _Celery Workers Guide: https://docs.celeryq.dev/en/stable/userguide/workers.html
|
||||
.. _django-celerybeat: https://django-celery-beat.readthedocs.io/en/latest/
|
||||
|
|
@ -14,6 +14,7 @@ Run these commands to deploy the project to Heroku:
|
|||
|
||||
# Note: this is not a free plan
|
||||
heroku addons:create heroku-postgresql:essential-0
|
||||
|
||||
# On Windows use double quotes for the time zone, e.g.
|
||||
# heroku pg:backups schedule --at "02:00 America/Los_Angeles" DATABASE_URL
|
||||
heroku pg:backups schedule --at '02:00 America/Los_Angeles' DATABASE_URL
|
||||
|
@ -24,10 +25,6 @@ Run these commands to deploy the project to Heroku:
|
|||
# Assuming you chose Mailgun as mail service (see below for others)
|
||||
heroku addons:create mailgun:starter
|
||||
|
||||
heroku config:set PYTHONHASHSEED=random
|
||||
|
||||
heroku config:set WEB_CONCURRENCY=4
|
||||
|
||||
heroku config:set DJANGO_DEBUG=False
|
||||
heroku config:set DJANGO_SETTINGS_MODULE=config.settings.production
|
||||
heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)"
|
||||
|
@ -65,7 +62,7 @@ The script above assumes that you've chose Mailgun as email service. If you want
|
|||
|
||||
.. warning::
|
||||
|
||||
.. include:: mailgun.rst
|
||||
.. include:: ../includes/mailgun.rst
|
||||
|
||||
Heroku & Docker
|
||||
+++++++++++++++
|
||||
|
@ -86,8 +83,6 @@ it's in the ``Procfile``, but is turned off by default:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
# Set the broker URL to Redis
|
||||
heroku config:set CELERY_BROKER_URL=`heroku config:get REDIS_URL`
|
||||
# Scale dyno to 1 instance
|
||||
heroku ps:scale worker=1
|
||||
|
|
@ -55,7 +55,7 @@ You will probably also need to setup the Mail backend, for example by adding a `
|
|||
|
||||
.. warning::
|
||||
|
||||
.. include:: mailgun.rst
|
||||
.. include:: ../includes/mailgun.rst
|
||||
|
||||
|
||||
Optional: Use AWS IAM Role for EC2 instance
|
|
@ -8,7 +8,7 @@ Server Error on sign-up/log-in
|
|||
|
||||
Make sure you have configured the mail backend (e.g. Mailgun) by adding the API key and sender domain
|
||||
|
||||
.. include:: mailgun.rst
|
||||
.. include:: ../includes/mailgun.rst
|
||||
|
||||
.. _docker-postgres-auth-failed:
|
||||
|
3
docs/6-about/contributing.md
Normal file
3
docs/6-about/contributing.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
```{include} ../../CONTRIBUTING.md
|
||||
|
||||
```
|
142
docs/Makefile
142
docs/Makefile
|
@ -4,150 +4,30 @@
|
|||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
.PHONY: help clean html livehtml linkcheck
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
|
||||
|
||||
# Clean the build output
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
# Build the HTML docs
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
$(SPHINXBUILD) -b html $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/{{ cookiecutter.project_slug }}.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/{{ cookiecutter.project_slug }}"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
# Build and serve docs with live reload
|
||||
livehtml:
|
||||
sphinx-autobuild -b html --port 9000 --watch . -c . $(SOURCEDIR) $(BUILDDIR)/html
|
||||
|
||||
# Check all external links for integrity
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
$(SPHINXBUILD) -b linkcheck $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
|
11
docs/conf.py
11
docs/conf.py
|
@ -29,7 +29,10 @@ extensions = ["myst_parser"]
|
|||
templates_path = ["_templates"]
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = [".rst", ".md"]
|
||||
source_suffix = {
|
||||
".rst": "restructuredtext",
|
||||
".md": "markdown",
|
||||
}
|
||||
|
||||
# The encoding of source files.
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
@ -185,7 +188,7 @@ latex_documents = [
|
|||
"cookiecutter-django Documentation",
|
||||
"cookiecutter-django",
|
||||
"manual",
|
||||
)
|
||||
),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
@ -220,7 +223,7 @@ man_pages = [
|
|||
"Cookiecutter Django documentation",
|
||||
["Daniel Roy Greenfeld"],
|
||||
1,
|
||||
)
|
||||
),
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
|
@ -239,7 +242,7 @@ texinfo_documents = [
|
|||
"Cookiecutter Django documentation",
|
||||
"Daniel Roy Greenfeld",
|
||||
"Cookiecutter Django",
|
||||
"A Cookiecutter template for creating production-ready " "Django projects quickly.",
|
||||
"A Cookiecutter template for creating production-ready Django projects quickly.",
|
||||
"Miscellaneous",
|
||||
)
|
||||
]
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
```{include} ../CONTRIBUTING.md
|
||||
|
||||
```
|
|
@ -7,28 +7,51 @@ Powered by Cookiecutter_, Cookiecutter Django is a project template for jumpstar
|
|||
|
||||
.. _cookiecutter: https://github.com/cookiecutter/cookiecutter
|
||||
|
||||
Contents
|
||||
--------
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Getting Started
|
||||
|
||||
1-getting-started/project-generation-options
|
||||
1-getting-started/settings
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Local Development
|
||||
|
||||
project-generation-options
|
||||
developing-locally
|
||||
developing-locally-docker
|
||||
settings
|
||||
linters
|
||||
testing
|
||||
document
|
||||
deployment-on-pythonanywhere
|
||||
deployment-on-heroku
|
||||
deployment-with-docker
|
||||
docker-postgres-backups
|
||||
websocket
|
||||
faq
|
||||
troubleshooting
|
||||
contributing
|
||||
maintainer-guide
|
||||
2-local-development/developing-locally
|
||||
2-local-development/developing-locally-docker
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Deployment
|
||||
|
||||
3-deployment/deployment-on-pythonanywhere
|
||||
3-deployment/deployment-on-heroku
|
||||
3-deployment/deployment-with-docker
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Guides
|
||||
|
||||
4-guides/docker-postgres-backups
|
||||
4-guides/linters
|
||||
4-guides/testing
|
||||
4-guides/document
|
||||
4-guides/websocket
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Help
|
||||
|
||||
5-help/faq
|
||||
5-help/troubleshooting
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: About
|
||||
|
||||
6-about/contributing
|
||||
6-about/maintainer-guide
|
||||
|
||||
Indices and tables
|
||||
------------------
|
||||
|
|
153
docs/make.bat
153
docs/make.bat
|
@ -5,36 +5,20 @@ REM Command file for Sphinx documentation
|
|||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set SOURCEDIR=.
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS%
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. clean to clean the build directory
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. livehtml to build and serve docs with live reload
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
|
@ -45,132 +29,22 @@ if "%1" == "clean" (
|
|||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %SOURCEDIR% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if "%1" == "livehtml" (
|
||||
sphinx-autobuild -b html --port 9000 --watch . -c . %SOURCEDIR% %BUILDDIR%/html
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\{{ cookiecutter.project_slug }}.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %SOURCEDIR% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
|
@ -178,13 +52,4 @@ or in %BUILDDIR%/linkcheck/output.txt.
|
|||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
sphinx==7.4.7
|
||||
sphinx-rtd-theme==2.0.0
|
||||
myst-parser==4.0.0
|
|
@ -1,21 +1,8 @@
|
|||
"""
|
||||
NOTE:
|
||||
the below code is to be maintained Python 2.x-compatible
|
||||
as the whole Cookiecutter Django project initialization
|
||||
can potentially be run in Python 2.x environment
|
||||
(at least so we presume in `pre_gen_project.py`).
|
||||
|
||||
TODO: restrict Cookiecutter Django project initialization to
|
||||
Python 3.x environments only
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
import string
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
# Inspired by
|
||||
|
@ -37,40 +24,28 @@ DEBUG_VALUE = "debug"
|
|||
def remove_open_source_files():
|
||||
file_names = ["CONTRIBUTORS.txt", "LICENSE"]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
Path(file_name).unlink()
|
||||
|
||||
|
||||
def remove_gplv3_files():
|
||||
file_names = ["COPYING"]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
Path(file_name).unlink()
|
||||
|
||||
|
||||
def remove_custom_user_manager_files():
|
||||
os.remove(
|
||||
os.path.join(
|
||||
"{{cookiecutter.project_slug}}",
|
||||
"users",
|
||||
"managers.py",
|
||||
)
|
||||
)
|
||||
os.remove(
|
||||
os.path.join(
|
||||
"{{cookiecutter.project_slug}}",
|
||||
"users",
|
||||
"tests",
|
||||
"test_managers.py",
|
||||
)
|
||||
)
|
||||
users_path = Path("{{cookiecutter.project_slug}}", "users")
|
||||
(users_path / "managers.py").unlink()
|
||||
(users_path / "tests" / "test_managers.py").unlink()
|
||||
|
||||
|
||||
def remove_pycharm_files():
|
||||
idea_dir_path = ".idea"
|
||||
if os.path.exists(idea_dir_path):
|
||||
idea_dir_path = Path(".idea")
|
||||
if idea_dir_path.exists():
|
||||
shutil.rmtree(idea_dir_path)
|
||||
|
||||
docs_dir_path = os.path.join("docs", "pycharm")
|
||||
if os.path.exists(docs_dir_path):
|
||||
docs_dir_path = Path("docs", "pycharm")
|
||||
if docs_dir_path.exists():
|
||||
shutil.rmtree(docs_dir_path)
|
||||
|
||||
|
||||
|
@ -82,13 +57,18 @@ def remove_docker_files():
|
|||
"docker-compose.local.yml",
|
||||
"docker-compose.production.yml",
|
||||
".dockerignore",
|
||||
"justfile",
|
||||
]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
Path(file_name).unlink()
|
||||
if "{{ cookiecutter.editor }}" == "PyCharm":
|
||||
file_names = ["docker_compose_up_django.xml", "docker_compose_up_docs.xml"]
|
||||
for file_name in file_names:
|
||||
os.remove(os.path.join(".idea", "runConfigurations", file_name))
|
||||
Path(".idea", "runConfigurations", file_name).unlink()
|
||||
|
||||
|
||||
def remove_nginx_docker_files():
|
||||
shutil.rmtree(Path("compose", "production", "nginx"))
|
||||
|
||||
|
||||
def remove_utility_files():
|
||||
|
@ -96,23 +76,23 @@ def remove_utility_files():
|
|||
|
||||
|
||||
def remove_heroku_files():
|
||||
file_names = ["Procfile", "runtime.txt", "requirements.txt"]
|
||||
file_names = ["Procfile", "requirements.txt"]
|
||||
for file_name in file_names:
|
||||
if file_name == "requirements.txt" and "{{ cookiecutter.ci_tool }}".lower() == "travis":
|
||||
# don't remove the file if we are using travisci but not using heroku
|
||||
continue
|
||||
os.remove(file_name)
|
||||
Path(file_name).unlink()
|
||||
shutil.rmtree("bin")
|
||||
|
||||
|
||||
def remove_sass_files():
|
||||
shutil.rmtree(os.path.join("{{cookiecutter.project_slug}}", "static", "sass"))
|
||||
shutil.rmtree(Path("{{cookiecutter.project_slug}}", "static", "sass"))
|
||||
|
||||
|
||||
def remove_gulp_files():
|
||||
file_names = ["gulpfile.js"]
|
||||
file_names = ["gulpfile.mjs"]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
Path(file_name).unlink()
|
||||
|
||||
|
||||
def remove_webpack_files():
|
||||
|
@ -121,36 +101,30 @@ def remove_webpack_files():
|
|||
|
||||
|
||||
def remove_vendors_js():
|
||||
vendors_js_path = os.path.join(
|
||||
"{{ cookiecutter.project_slug }}",
|
||||
"static",
|
||||
"js",
|
||||
"vendors.js",
|
||||
)
|
||||
if os.path.exists(vendors_js_path):
|
||||
os.remove(vendors_js_path)
|
||||
vendors_js_path = Path("{{ cookiecutter.project_slug }}", "static", "js", "vendors.js")
|
||||
if vendors_js_path.exists():
|
||||
vendors_js_path.unlink()
|
||||
|
||||
|
||||
def remove_packagejson_file():
|
||||
file_names = ["package.json"]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
Path(file_name).unlink()
|
||||
|
||||
|
||||
def update_package_json(remove_dev_deps=None, remove_keys=None, scripts=None):
|
||||
remove_dev_deps = remove_dev_deps or []
|
||||
remove_keys = remove_keys or []
|
||||
scripts = scripts or {}
|
||||
with open("package.json", mode="r") as fd:
|
||||
content = json.load(fd)
|
||||
package_json = Path("package.json")
|
||||
content = json.loads(package_json.read_text())
|
||||
for package_name in remove_dev_deps:
|
||||
content["devDependencies"].pop(package_name)
|
||||
for key in remove_keys:
|
||||
content.pop(key)
|
||||
content["scripts"].update(scripts)
|
||||
with open("package.json", mode="w") as fd:
|
||||
json.dump(content, fd, ensure_ascii=False, indent=2)
|
||||
fd.write("\n")
|
||||
updated_content = json.dumps(content, ensure_ascii=False, indent=2) + "\n"
|
||||
package_json.write_text(updated_content)
|
||||
|
||||
|
||||
def handle_js_runner(choice, use_docker, use_async):
|
||||
|
@ -175,7 +149,7 @@ def handle_js_runner(choice, use_docker, use_async):
|
|||
remove_keys=["babel"],
|
||||
scripts={
|
||||
"dev": "gulp",
|
||||
"build": "gulp generate-assets",
|
||||
"build": "gulp build",
|
||||
},
|
||||
)
|
||||
remove_webpack_files()
|
||||
|
@ -214,8 +188,8 @@ def handle_js_runner(choice, use_docker, use_async):
|
|||
|
||||
|
||||
def remove_prettier_pre_commit():
|
||||
with open(".pre-commit-config.yaml", "r") as fd:
|
||||
content = fd.readlines()
|
||||
pre_commit_yaml = Path(".pre-commit-config.yaml")
|
||||
content = pre_commit_yaml.read_text().splitlines()
|
||||
|
||||
removing = False
|
||||
new_lines = []
|
||||
|
@ -227,35 +201,34 @@ def remove_prettier_pre_commit():
|
|||
if not removing:
|
||||
new_lines.append(line)
|
||||
|
||||
with open(".pre-commit-config.yaml", "w") as fd:
|
||||
fd.writelines(new_lines)
|
||||
pre_commit_yaml.write_text("\n".join(new_lines))
|
||||
|
||||
|
||||
def remove_celery_files():
|
||||
file_names = [
|
||||
os.path.join("config", "celery_app.py"),
|
||||
os.path.join("{{ cookiecutter.project_slug }}", "users", "tasks.py"),
|
||||
os.path.join("{{ cookiecutter.project_slug }}", "users", "tests", "test_tasks.py"),
|
||||
file_paths = [
|
||||
Path("config", "celery_app.py"),
|
||||
Path("{{ cookiecutter.project_slug }}", "users", "tasks.py"),
|
||||
Path("{{ cookiecutter.project_slug }}", "users", "tests", "test_tasks.py"),
|
||||
]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
for file_path in file_paths:
|
||||
file_path.unlink()
|
||||
|
||||
|
||||
def remove_async_files():
|
||||
file_names = [
|
||||
os.path.join("config", "asgi.py"),
|
||||
os.path.join("config", "websocket.py"),
|
||||
file_paths = [
|
||||
Path("config", "asgi.py"),
|
||||
Path("config", "websocket.py"),
|
||||
]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
for file_path in file_paths:
|
||||
file_path.unlink()
|
||||
|
||||
|
||||
def remove_dottravisyml_file():
|
||||
os.remove(".travis.yml")
|
||||
Path(".travis.yml").unlink()
|
||||
|
||||
|
||||
def remove_dotgitlabciyml_file():
|
||||
os.remove(".gitlab-ci.yml")
|
||||
Path(".gitlab-ci.yml").unlink()
|
||||
|
||||
|
||||
def remove_dotgithub_folder():
|
||||
|
@ -263,7 +236,7 @@ def remove_dotgithub_folder():
|
|||
|
||||
|
||||
def remove_dotdrone_file():
|
||||
os.remove(".drone.yml")
|
||||
Path(".drone.yml").unlink()
|
||||
|
||||
|
||||
def generate_random_string(length, using_digits=False, using_ascii_letters=False, using_punctuation=False):
|
||||
|
@ -289,7 +262,7 @@ def generate_random_string(length, using_digits=False, using_ascii_letters=False
|
|||
return "".join([random.choice(symbols) for _ in range(length)])
|
||||
|
||||
|
||||
def set_flag(file_path, flag, value=None, formatted=None, *args, **kwargs):
|
||||
def set_flag(file_path: Path, flag, value=None, formatted=None, *args, **kwargs):
|
||||
if value is None:
|
||||
random_string = generate_random_string(*args, **kwargs)
|
||||
if random_string is None:
|
||||
|
@ -302,7 +275,7 @@ def set_flag(file_path, flag, value=None, formatted=None, *args, **kwargs):
|
|||
random_string = formatted.format(random_string)
|
||||
value = random_string
|
||||
|
||||
with open(file_path, "r+") as f:
|
||||
with file_path.open("r+") as f:
|
||||
file_contents = f.read().replace(flag, value)
|
||||
f.seek(0)
|
||||
f.write(file_contents)
|
||||
|
@ -311,7 +284,7 @@ def set_flag(file_path, flag, value=None, formatted=None, *args, **kwargs):
|
|||
return value
|
||||
|
||||
|
||||
def set_django_secret_key(file_path):
|
||||
def set_django_secret_key(file_path: Path):
|
||||
django_secret_key = set_flag(
|
||||
file_path,
|
||||
"!!!SET DJANGO_SECRET_KEY!!!",
|
||||
|
@ -322,7 +295,7 @@ def set_django_secret_key(file_path):
|
|||
return django_secret_key
|
||||
|
||||
|
||||
def set_django_admin_url(file_path):
|
||||
def set_django_admin_url(file_path: Path):
|
||||
django_admin_url = set_flag(
|
||||
file_path,
|
||||
"!!!SET DJANGO_ADMIN_URL!!!",
|
||||
|
@ -377,16 +350,16 @@ def set_celery_flower_password(file_path, value=None):
|
|||
|
||||
|
||||
def append_to_gitignore_file(ignored_line):
|
||||
with open(".gitignore", "a") as gitignore_file:
|
||||
with Path(".gitignore").open("a") as gitignore_file:
|
||||
gitignore_file.write(ignored_line)
|
||||
gitignore_file.write("\n")
|
||||
|
||||
|
||||
def set_flags_in_envs(postgres_user, celery_flower_user, debug=False):
|
||||
local_django_envs_path = os.path.join(".envs", ".local", ".django")
|
||||
production_django_envs_path = os.path.join(".envs", ".production", ".django")
|
||||
local_postgres_envs_path = os.path.join(".envs", ".local", ".postgres")
|
||||
production_postgres_envs_path = os.path.join(".envs", ".production", ".postgres")
|
||||
local_django_envs_path = Path(".envs", ".local", ".django")
|
||||
production_django_envs_path = Path(".envs", ".production", ".django")
|
||||
local_postgres_envs_path = Path(".envs", ".local", ".postgres")
|
||||
production_postgres_envs_path = Path(".envs", ".production", ".postgres")
|
||||
|
||||
set_django_secret_key(production_django_envs_path)
|
||||
set_django_admin_url(production_django_envs_path)
|
||||
|
@ -403,35 +376,33 @@ def set_flags_in_envs(postgres_user, celery_flower_user, debug=False):
|
|||
|
||||
|
||||
def set_flags_in_settings_files():
|
||||
set_django_secret_key(os.path.join("config", "settings", "local.py"))
|
||||
set_django_secret_key(os.path.join("config", "settings", "test.py"))
|
||||
set_django_secret_key(Path("config", "settings", "local.py"))
|
||||
set_django_secret_key(Path("config", "settings", "test.py"))
|
||||
|
||||
|
||||
def remove_envs_and_associated_files():
|
||||
shutil.rmtree(".envs")
|
||||
os.remove("merge_production_dotenvs_in_dotenv.py")
|
||||
Path("merge_production_dotenvs_in_dotenv.py").unlink()
|
||||
shutil.rmtree("tests")
|
||||
|
||||
|
||||
def remove_celery_compose_dirs():
|
||||
shutil.rmtree(os.path.join("compose", "local", "django", "celery"))
|
||||
shutil.rmtree(os.path.join("compose", "production", "django", "celery"))
|
||||
shutil.rmtree(Path("compose", "local", "django", "celery"))
|
||||
shutil.rmtree(Path("compose", "production", "django", "celery"))
|
||||
|
||||
|
||||
def remove_node_dockerfile():
|
||||
shutil.rmtree(os.path.join("compose", "local", "node"))
|
||||
shutil.rmtree(Path("compose", "local", "node"))
|
||||
|
||||
|
||||
def remove_aws_dockerfile():
|
||||
shutil.rmtree(os.path.join("compose", "production", "aws"))
|
||||
shutil.rmtree(Path("compose", "production", "aws"))
|
||||
|
||||
|
||||
def remove_drf_starter_files():
|
||||
os.remove(os.path.join("config", "api_router.py"))
|
||||
shutil.rmtree(os.path.join("{{cookiecutter.project_slug}}", "users", "api"))
|
||||
os.remove(os.path.join("{{cookiecutter.project_slug}}", "users", "tests", "test_drf_urls.py"))
|
||||
os.remove(os.path.join("{{cookiecutter.project_slug}}", "users", "tests", "test_drf_views.py"))
|
||||
os.remove(os.path.join("{{cookiecutter.project_slug}}", "users", "tests", "test_swagger.py"))
|
||||
Path("config", "api_router.py").unlink()
|
||||
shutil.rmtree(Path("{{cookiecutter.project_slug}}", "users", "api"))
|
||||
shutil.rmtree(Path("{{cookiecutter.project_slug}}", "users", "tests", "api"))
|
||||
|
||||
|
||||
def main():
|
||||
|
@ -457,6 +428,8 @@ def main():
|
|||
|
||||
if "{{ cookiecutter.use_docker }}".lower() == "y":
|
||||
remove_utility_files()
|
||||
if "{{ cookiecutter.cloud_provider }}".lower() != "none":
|
||||
remove_nginx_docker_files()
|
||||
else:
|
||||
remove_docker_files()
|
||||
|
||||
|
|
|
@ -1,15 +1,3 @@
|
|||
"""
|
||||
NOTE:
|
||||
the below code is to be maintained Python 2.x-compatible
|
||||
as the whole Cookiecutter Django project initialization
|
||||
can potentially be run in Python 2.x environment.
|
||||
|
||||
TODO: restrict Cookiecutter Django project initialization
|
||||
to Python 3.x environments only
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
TERMINATOR = "\x1b[0m"
|
||||
|
@ -34,36 +22,10 @@ assert project_slug == project_slug.lower(), "'{}' project slug should be all lo
|
|||
|
||||
assert "\\" not in "{{ cookiecutter.author_name }}", "Don't include backslashes in author name."
|
||||
|
||||
if "{{ cookiecutter.use_docker }}".lower() == "n":
|
||||
python_major_version = sys.version_info[0]
|
||||
if python_major_version == 2:
|
||||
print(
|
||||
WARNING + "You're running cookiecutter under Python 2, but the generated "
|
||||
"project requires Python 3.12+. Do you want to proceed (y/n)? " + TERMINATOR
|
||||
)
|
||||
yes_options, no_options = frozenset(["y"]), frozenset(["n"])
|
||||
while True:
|
||||
choice = raw_input().lower() # noqa: F821
|
||||
if choice in yes_options:
|
||||
break
|
||||
|
||||
elif choice in no_options:
|
||||
print(INFO + "Generation process stopped as requested." + TERMINATOR)
|
||||
sys.exit(1)
|
||||
else:
|
||||
print(
|
||||
HINT
|
||||
+ "Please respond with {} or {}: ".format(
|
||||
", ".join(["'{}'".format(o) for o in yes_options if not o == ""]),
|
||||
", ".join(["'{}'".format(o) for o in no_options if not o == ""]),
|
||||
)
|
||||
+ TERMINATOR
|
||||
)
|
||||
|
||||
if "{{ cookiecutter.use_whitenoise }}".lower() == "n" and "{{ cookiecutter.cloud_provider }}" == "None":
|
||||
print("You should either use Whitenoise or select a " "Cloud Provider to serve static files")
|
||||
print("You should either use Whitenoise or select a Cloud Provider to serve static files")
|
||||
sys.exit(1)
|
||||
|
||||
if "{{ cookiecutter.mail_service }}" == "Amazon SES" and "{{ cookiecutter.cloud_provider }}" != "AWS":
|
||||
print("You should either use AWS or select a different " "Mail Service for sending emails.")
|
||||
print("You should either use AWS or select a different Mail Service for sending emails.")
|
||||
sys.exit(1)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "cookiecutter-django"
|
||||
version = "2024.09.29"
|
||||
version = "2025.04.03"
|
||||
description = "A Cookiecutter template for creating production-ready Django projects quickly."
|
||||
readme = "README.md"
|
||||
keywords = [
|
||||
|
@ -14,7 +14,7 @@ license = { text = "BSD" }
|
|||
authors = [
|
||||
{ name = "Daniel Roy Greenfeld", email = "pydanny@gmail.com" },
|
||||
]
|
||||
requires-python = ">=3.12"
|
||||
requires-python = ">=3.12,<3.13"
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Environment :: Console",
|
||||
|
@ -28,8 +28,36 @@ classifiers = [
|
|||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Topic :: Software Development",
|
||||
]
|
||||
dependencies = [
|
||||
"binaryornot==0.4.4",
|
||||
"cookiecutter==2.6",
|
||||
"django-upgrade==1.22.2",
|
||||
"djlint==1.36.4",
|
||||
"gitpython==3.1.43",
|
||||
"jinja2==3.1.5",
|
||||
"pre-commit==4.1.0",
|
||||
"pygithub==2.5",
|
||||
"pytest==8.3.4",
|
||||
"pytest-cookies==0.7",
|
||||
"pytest-instafail==0.5",
|
||||
"pytest-xdist==3.6.1",
|
||||
"pyyaml==6.0.2",
|
||||
"requests==2.32.3",
|
||||
"ruff==0.11.4",
|
||||
"sh==2.1; sys_platform!='win23'",
|
||||
"tox==4.23.2",
|
||||
"tox-uv>=1.17",
|
||||
]
|
||||
urls = { Repository = "https://github.com/cookiecutter/cookiecutter-django" }
|
||||
|
||||
[dependency-groups]
|
||||
docs = [
|
||||
"myst-parser>=4",
|
||||
"sphinx>=8.0.2",
|
||||
"sphinx-autobuild>=2024.10.3",
|
||||
"sphinx-rtd-theme>=3",
|
||||
]
|
||||
|
||||
[tool.black]
|
||||
line-length = 119
|
||||
target-version = [
|
||||
|
@ -47,7 +75,10 @@ known_first_party = [
|
|||
"hooks",
|
||||
]
|
||||
|
||||
# ==== djLint ====
|
||||
[tool.pyproject-fmt]
|
||||
keep_full_version = true
|
||||
|
||||
# ==== pytest ====
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "-v --tb=short"
|
||||
|
@ -61,7 +92,7 @@ norecursedirs = [
|
|||
"*/{{cookiecutter.project_slug}}/*",
|
||||
]
|
||||
|
||||
# ==== black ====
|
||||
# ==== djLint ====
|
||||
|
||||
[tool.djlint]
|
||||
blank_line_after_tag = "load,extends"
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
cookiecutter==2.6.0
|
||||
sh==2.0.7; sys_platform != "win32"
|
||||
binaryornot==0.4.4
|
||||
|
||||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
ruff==0.6.8
|
||||
django-upgrade==1.21.0
|
||||
djlint==1.35.2
|
||||
pre-commit==3.8.0
|
||||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
tox==4.20.0
|
||||
pytest==8.3.3
|
||||
pytest-xdist==3.6.1
|
||||
pytest-cookies==0.7.0
|
||||
pytest-instafail==0.5.0
|
||||
pyyaml==6.0.2
|
||||
|
||||
# Scripting
|
||||
# ------------------------------------------------------------------------------
|
||||
PyGithub==2.4.0
|
||||
gitpython==3.1.43
|
||||
jinja2==3.1.4
|
||||
requests==2.32.3
|
|
@ -12,7 +12,6 @@ from __future__ import annotations
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections.abc import Iterable
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, NamedTuple
|
||||
|
||||
|
@ -20,6 +19,8 @@ import requests
|
|||
from github import Github
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Iterable
|
||||
|
||||
from github.Issue import Issue
|
||||
|
||||
CURRENT_FILE = Path(__file__)
|
||||
|
@ -83,7 +84,7 @@ def get_name_and_version(requirements_line: str) -> tuple[str, ...]:
|
|||
|
||||
|
||||
def get_all_latest_django_versions(
|
||||
django_max_version: tuple[DjVersion] = None,
|
||||
django_max_version: tuple[DjVersion] | None = None,
|
||||
) -> tuple[DjVersion, list[DjVersion]]:
|
||||
"""
|
||||
Grabs all Django versions that are worthy of a GitHub issue.
|
||||
|
@ -221,8 +222,7 @@ class GitHubManager:
|
|||
if supported_dj_versions:
|
||||
if any(v >= needed_dj_version for v in supported_dj_versions):
|
||||
return package_info["info"]["version"], "✅"
|
||||
else:
|
||||
return "", "❌"
|
||||
return "", "❌"
|
||||
|
||||
# Django classifier DNE; assume it isn't a Django lib
|
||||
# Great exceptions include pylint-django, where we need to do this manually...
|
||||
|
|
69
scripts/node_version.py
Normal file
69
scripts/node_version.py
Normal file
|
@ -0,0 +1,69 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).parent.parent
|
||||
TEMPLATED_ROOT = ROOT / "{{cookiecutter.project_slug}}"
|
||||
DOCKERFILE = TEMPLATED_ROOT / "compose" / "local" / "node" / "Dockerfile"
|
||||
PROD_DOCKERFILE = TEMPLATED_ROOT / "compose" / "production" / "django" / "Dockerfile"
|
||||
PACKAGE_JSON = TEMPLATED_ROOT / "package.json"
|
||||
CI_YML = ROOT / ".github" / "workflows" / "ci.yml"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
new_version = get_version_from_dockerfile()
|
||||
old_version = get_version_from_package_json()
|
||||
if old_version != new_version:
|
||||
update_package_json_version(old_version, new_version)
|
||||
update_ci_node_version(old_version, new_version)
|
||||
update_production_node_version(old_version, new_version)
|
||||
|
||||
|
||||
def get_version_from_dockerfile() -> str:
|
||||
# Extract version out of base image name:
|
||||
# FROM docker.io/node:22.13-bookworm-slim
|
||||
# -> 22.13
|
||||
with DOCKERFILE.open("r") as f:
|
||||
for line in f:
|
||||
if "FROM docker.io/node:" in line:
|
||||
_, _, docker_tag = line.partition(":")
|
||||
version_str, _, _ = docker_tag.partition("-")
|
||||
return version_str
|
||||
raise RuntimeError("Could not find version in Dockerfile")
|
||||
|
||||
|
||||
def get_version_from_package_json() -> str:
|
||||
package_json = json.loads(PACKAGE_JSON.read_text())
|
||||
return package_json["engines"]["node"]
|
||||
|
||||
|
||||
def update_package_json_version(old_version: str, new_version: str) -> None:
|
||||
package_json_text = PACKAGE_JSON.read_text()
|
||||
package_json_text = package_json_text.replace(
|
||||
f'"node": "{old_version}"',
|
||||
f'"node": "{new_version}"',
|
||||
)
|
||||
PACKAGE_JSON.write_text(package_json_text)
|
||||
|
||||
|
||||
def update_ci_node_version(old_version: str, new_version: str) -> None:
|
||||
yml_content = CI_YML.read_text()
|
||||
yml_content = yml_content.replace(
|
||||
f'node-version: "{old_version}"',
|
||||
f'node-version: "{new_version}"',
|
||||
)
|
||||
CI_YML.write_text(yml_content)
|
||||
|
||||
|
||||
def update_production_node_version(old_version: str, new_version: str) -> None:
|
||||
dockerfile_content = PROD_DOCKERFILE.read_text()
|
||||
dockerfile_content = dockerfile_content.replace(
|
||||
f"FROM docker.io/node:{old_version}",
|
||||
f"FROM docker.io/node:{new_version}",
|
||||
)
|
||||
PROD_DOCKERFILE.write_text(dockerfile_content)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
56
scripts/ruff_version.py
Normal file
56
scripts/ruff_version.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).parent.parent
|
||||
TEMPLATED_ROOT = ROOT / "{{cookiecutter.project_slug}}"
|
||||
REQUIREMENTS_LOCAL_TXT = TEMPLATED_ROOT / "requirements" / "local.txt"
|
||||
PRE_COMMIT_CONFIG = TEMPLATED_ROOT / ".pre-commit-config.yaml"
|
||||
PYPROJECT_TOML = ROOT / "pyproject.toml"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
new_version = get_requirements_txt_version()
|
||||
old_version = get_pyproject_toml_version()
|
||||
if old_version == new_version:
|
||||
return
|
||||
|
||||
update_ruff_version(old_version, new_version)
|
||||
subprocess.run(["uv", "lock", "--no-upgrade"], cwd=ROOT)
|
||||
|
||||
|
||||
def get_requirements_txt_version() -> str:
|
||||
content = REQUIREMENTS_LOCAL_TXT.read_text()
|
||||
for line in content.split("\n"):
|
||||
if line.startswith("ruff"):
|
||||
return line.split(" ")[0].split("==")[1]
|
||||
raise RuntimeError("Could not find ruff version in requirements/local.txt")
|
||||
|
||||
|
||||
def get_pyproject_toml_version() -> str:
|
||||
data = tomllib.loads(PYPROJECT_TOML.read_text())
|
||||
for dependency in data["project"]["dependencies"]:
|
||||
if dependency.startswith("ruff=="):
|
||||
return dependency.split("==")[1]
|
||||
raise RuntimeError("Could not find ruff version in pyproject.toml")
|
||||
|
||||
|
||||
def update_ruff_version(old_version: str, new_version: str) -> None:
|
||||
# Update pyproject.toml
|
||||
new_content = PYPROJECT_TOML.read_text().replace(
|
||||
f"ruff=={old_version}",
|
||||
f"ruff=={new_version}",
|
||||
)
|
||||
PYPROJECT_TOML.write_text(new_content)
|
||||
# Update pre-commit config
|
||||
new_content = PRE_COMMIT_CONFIG.read_text().replace(
|
||||
f"repo: https://github.com/astral-sh/ruff-pre-commit\n rev: v{old_version}",
|
||||
f"repo: https://github.com/astral-sh/ruff-pre-commit\n rev: v{new_version}",
|
||||
)
|
||||
PRE_COMMIT_CONFIG.write_text(new_content)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -1,6 +1,7 @@
|
|||
import datetime as dt
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from collections.abc import Iterable
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -51,8 +52,12 @@ def main() -> None:
|
|||
update_version(setup_py_path, release)
|
||||
print(f"Updated version in {setup_py_path}")
|
||||
|
||||
# Run uv lock
|
||||
uv_lock_path = ROOT / "uv.lock"
|
||||
subprocess.run(["uv", "lock", "--no-upgrade"], cwd=ROOT)
|
||||
|
||||
# Commit changes, create tag and push
|
||||
update_git_repo([changelog_path, setup_py_path], release)
|
||||
update_git_repo([changelog_path, setup_py_path, uv_lock_path], release)
|
||||
|
||||
# Create GitHub release
|
||||
github_release = repo.create_git_release(
|
||||
|
|
|
@ -11,7 +11,7 @@ mkdir -p .cache/bare
|
|||
cd .cache/bare
|
||||
|
||||
# create the project using the default settings in cookiecutter.json
|
||||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=n "$@"
|
||||
uv run cookiecutter ../../ --no-input --overwrite-if-exists use_docker=n "$@"
|
||||
cd my_awesome_project
|
||||
|
||||
# Install OS deps
|
||||
|
|
|
@ -2,6 +2,8 @@ import glob
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections.abc import Iterable
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -61,7 +63,6 @@ SUPPORTED_COMBINATIONS = [
|
|||
{"postgresql_version": "15"},
|
||||
{"postgresql_version": "14"},
|
||||
{"postgresql_version": "13"},
|
||||
{"postgresql_version": "12"},
|
||||
{"cloud_provider": "AWS", "use_whitenoise": "y"},
|
||||
{"cloud_provider": "AWS", "use_whitenoise": "n"},
|
||||
{"cloud_provider": "GCP", "use_whitenoise": "y"},
|
||||
|
@ -146,19 +147,19 @@ def _fixture_id(ctx):
|
|||
return "-".join(f"{key}:{value}" for key, value in ctx.items())
|
||||
|
||||
|
||||
def build_files_list(base_dir):
|
||||
def build_files_list(base_path: Path):
|
||||
"""Build a list containing absolute paths to the generated files."""
|
||||
return [os.path.join(dirpath, file_path) for dirpath, subdirs, files in os.walk(base_dir) for file_path in files]
|
||||
return [dirpath / file_path for dirpath, subdirs, files in base_path.walk() for file_path in files]
|
||||
|
||||
|
||||
def check_paths(paths):
|
||||
def check_paths(paths: Iterable[Path]):
|
||||
"""Method to check all paths have correct substitutions."""
|
||||
# Assert that no match is found in any of the files
|
||||
for path in paths:
|
||||
if is_binary(path):
|
||||
if is_binary(str(path)):
|
||||
continue
|
||||
|
||||
for line in open(path):
|
||||
for line in path.open():
|
||||
match = RE_OBJ.search(line)
|
||||
assert match is None, f"cookiecutter variable not replaced in {path}"
|
||||
|
||||
|
@ -173,7 +174,7 @@ def test_project_generation(cookies, context, context_override):
|
|||
assert result.project_path.name == context["project_slug"]
|
||||
assert result.project_path.is_dir()
|
||||
|
||||
paths = build_files_list(str(result.project_path))
|
||||
paths = build_files_list(result.project_path)
|
||||
assert paths
|
||||
check_paths(paths)
|
||||
|
||||
|
@ -271,7 +272,7 @@ def test_djlint_check_passes(cookies, context_override):
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
["use_docker", "expected_test_script"],
|
||||
("use_docker", "expected_test_script"),
|
||||
[
|
||||
("n", "pytest"),
|
||||
("y", "docker compose -f docker-compose.local.yml run django pytest"),
|
||||
|
@ -286,7 +287,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip
|
|||
assert result.project_path.name == context["project_slug"]
|
||||
assert result.project_path.is_dir()
|
||||
|
||||
with open(f"{result.project_path}/.travis.yml") as travis_yml:
|
||||
with (result.project_path / ".travis.yml").open() as travis_yml:
|
||||
try:
|
||||
yml = yaml.safe_load(travis_yml)["jobs"]["include"]
|
||||
assert yml[0]["script"] == ["ruff check ."]
|
||||
|
@ -296,7 +297,7 @@ def test_travis_invokes_pytest(cookies, context, use_docker, expected_test_scrip
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
["use_docker", "expected_test_script"],
|
||||
("use_docker", "expected_test_script"),
|
||||
[
|
||||
("n", "pytest"),
|
||||
("y", "docker compose -f docker-compose.local.yml run django pytest"),
|
||||
|
@ -311,11 +312,11 @@ def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expec
|
|||
assert result.project_path.name == context["project_slug"]
|
||||
assert result.project_path.is_dir()
|
||||
|
||||
with open(f"{result.project_path}/.gitlab-ci.yml") as gitlab_yml:
|
||||
with (result.project_path / ".gitlab-ci.yml").open() as gitlab_yml:
|
||||
try:
|
||||
gitlab_config = yaml.safe_load(gitlab_yml)
|
||||
assert gitlab_config["precommit"]["script"] == [
|
||||
"pre-commit run --show-diff-on-failure --color=always --all-files"
|
||||
"pre-commit run --show-diff-on-failure --color=always --all-files",
|
||||
]
|
||||
assert gitlab_config["pytest"]["script"] == [expected_test_script]
|
||||
except yaml.YAMLError as e:
|
||||
|
@ -323,7 +324,7 @@ def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expec
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
["use_docker", "expected_test_script"],
|
||||
("use_docker", "expected_test_script"),
|
||||
[
|
||||
("n", "pytest"),
|
||||
("y", "docker compose -f docker-compose.local.yml run django pytest"),
|
||||
|
@ -338,7 +339,7 @@ def test_github_invokes_linter_and_pytest(cookies, context, use_docker, expected
|
|||
assert result.project_path.name == context["project_slug"]
|
||||
assert result.project_path.is_dir()
|
||||
|
||||
with open(f"{result.project_path}/.github/workflows/ci.yml") as github_yml:
|
||||
with (result.project_path / ".github" / "workflows" / "ci.yml").open() as github_yml:
|
||||
try:
|
||||
github_config = yaml.safe_load(github_yml)
|
||||
linter_present = False
|
||||
|
@ -378,7 +379,7 @@ def test_error_if_incompatible(cookies, context, invalid_context):
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
["editor", "pycharm_docs_exist"],
|
||||
("editor", "pycharm_docs_exist"),
|
||||
[
|
||||
("None", False),
|
||||
("PyCharm", True),
|
||||
|
@ -389,9 +390,9 @@ def test_pycharm_docs_removed(cookies, context, editor, pycharm_docs_exist):
|
|||
context.update({"editor": editor})
|
||||
result = cookies.bake(extra_context=context)
|
||||
|
||||
with open(f"{result.project_path}/docs/index.rst") as f:
|
||||
has_pycharm_docs = "pycharm/configuration" in f.read()
|
||||
assert has_pycharm_docs is pycharm_docs_exist
|
||||
index_rst = result.project_path / "docs" / "index.rst"
|
||||
has_pycharm_docs = "pycharm/configuration" in index_rst.read_text()
|
||||
assert has_pycharm_docs is pycharm_docs_exist
|
||||
|
||||
|
||||
def test_trim_domain_email(cookies, context):
|
||||
|
@ -401,7 +402,7 @@ def test_trim_domain_email(cookies, context):
|
|||
"use_docker": "y",
|
||||
"domain_name": " example.com ",
|
||||
"email": " me@example.com ",
|
||||
}
|
||||
},
|
||||
)
|
||||
result = cookies.bake(extra_context=context)
|
||||
|
||||
|
|
|
@ -11,29 +11,28 @@ mkdir -p .cache/docker
|
|||
cd .cache/docker
|
||||
|
||||
# create the project using the default settings in cookiecutter.json
|
||||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@"
|
||||
uv run cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@"
|
||||
cd my_awesome_project
|
||||
|
||||
# make sure all images build
|
||||
docker compose -f docker-compose.local.yml build
|
||||
|
||||
# run the project's type checks
|
||||
docker compose -f docker-compose.local.yml run django mypy my_awesome_project
|
||||
docker compose -f docker-compose.local.yml run --rm django mypy my_awesome_project
|
||||
|
||||
# run the project's tests
|
||||
docker compose -f docker-compose.local.yml run django pytest
|
||||
docker compose -f docker-compose.local.yml run --rm django pytest
|
||||
|
||||
# return non-zero status code if there are migrations that have not been created
|
||||
docker compose -f docker-compose.local.yml run django python manage.py makemigrations --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
|
||||
docker compose -f docker-compose.local.yml run --rm django python manage.py makemigrations --check || { echo "ERROR: there were changes in the models, but migration listed above have not been created and are not saved in version control"; exit 1; }
|
||||
|
||||
# Test support for translations
|
||||
docker compose -f docker-compose.local.yml run django python manage.py makemessages --all
|
||||
docker compose -f docker-compose.local.yml run --rm django python manage.py makemessages --all
|
||||
|
||||
# Make sure the check doesn't raise any warnings
|
||||
docker compose -f docker-compose.local.yml run \
|
||||
docker compose -f docker-compose.local.yml run --rm \
|
||||
-e DJANGO_SECRET_KEY="$(openssl rand -base64 64)" \
|
||||
-e REDIS_URL=redis://redis:6379/0 \
|
||||
-e CELERY_BROKER_URL=redis://redis:6379/0 \
|
||||
-e DJANGO_AWS_ACCESS_KEY_ID=x \
|
||||
-e DJANGO_AWS_SECRET_ACCESS_KEY=x \
|
||||
-e DJANGO_AWS_STORAGE_BUCKET_NAME=x \
|
||||
|
@ -43,10 +42,10 @@ docker compose -f docker-compose.local.yml run \
|
|||
django python manage.py check --settings=config.settings.production --deploy --database default --fail-level WARNING
|
||||
|
||||
# Generate the HTML for the documentation
|
||||
docker compose -f docker-compose.docs.yml run docs make html
|
||||
docker compose -f docker-compose.docs.yml run --rm docs make html
|
||||
|
||||
# Run npm build script if package.json is present
|
||||
if [ -f "package.json" ]
|
||||
then
|
||||
docker compose -f docker-compose.local.yml run node npm run build
|
||||
docker compose -f docker-compose.local.yml run --rm node npm run build
|
||||
fi
|
||||
|
|
|
@ -8,7 +8,7 @@ import pytest
|
|||
from hooks.post_gen_project import append_to_gitignore_file
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@pytest.fixture
|
||||
def working_directory(tmp_path):
|
||||
prev_cwd = Path.cwd()
|
||||
os.chdir(tmp_path)
|
||||
|
|
1
tox.ini
1
tox.ini
|
@ -3,7 +3,6 @@ skipsdist = true
|
|||
envlist = py312,black-template
|
||||
|
||||
[testenv]
|
||||
deps = -rrequirements.txt
|
||||
passenv = AUTOFIXABLE_STYLES
|
||||
commands = pytest -n auto {posargs:./tests}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ environment:
|
|||
POSTGRES_DB: 'test_{{ cookiecutter.project_slug }}'
|
||||
POSTGRES_HOST_AUTH_METHOD: trust
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
CELERY_BROKER_URL: 'redis://redis:6379/0'
|
||||
REDIS_URL: 'redis://redis:6379/0'
|
||||
{%- endif %}
|
||||
|
||||
steps:
|
||||
|
|
|
@ -12,7 +12,7 @@ trim_trailing_whitespace = true
|
|||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{html,css,scss,json,yml,xml}]
|
||||
[*.{html,css,scss,json,yml,xml,toml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
|
|
|
@ -9,16 +9,20 @@ updates:
|
|||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- '*'
|
||||
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
|
||||
# Enable version updates for Docker
|
||||
# We need to specify each Dockerfile in a separate entry because Dependabot doesn't
|
||||
# support wildcards or recursively checking subdirectories. Check this issue for updates:
|
||||
# https://github.com/dependabot/dependabot-core/issues/2178
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/local/django` directory
|
||||
directory: 'compose/local/django/'
|
||||
directories:
|
||||
- 'compose/local/django/'
|
||||
- 'compose/local/docs/'
|
||||
- 'compose/production/django/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
|
@ -28,81 +32,41 @@ updates:
|
|||
update-types:
|
||||
- 'version-update:semver-major'
|
||||
- 'version-update:semver-minor'
|
||||
groups:
|
||||
docker-python:
|
||||
patterns:
|
||||
- '*'
|
||||
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/local/docs` directory
|
||||
directory: 'compose/local/docs/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
||||
ignore:
|
||||
- dependency-name: '*'
|
||||
update-types:
|
||||
- 'version-update:semver-major'
|
||||
- 'version-update:semver-minor'
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/local/node` directory
|
||||
directory: 'compose/local/node/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/production/aws` directory
|
||||
directory: 'compose/production/aws/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/production/django` directory
|
||||
directory: 'compose/production/django/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
# Ignore minor version updates (3.10 -> 3.11) but update patch versions
|
||||
ignore:
|
||||
- dependency-name: '*'
|
||||
update-types:
|
||||
- 'version-update:semver-major'
|
||||
- 'version-update:semver-minor'
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/production/postgres` directory
|
||||
directory: 'compose/production/postgres/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/production/traefik` directory
|
||||
directory: 'compose/production/traefik/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
|
||||
# Look for a `Dockerfile` in the listed directories
|
||||
directories:
|
||||
- 'compose/local/node/'
|
||||
- 'compose/production/aws/'
|
||||
- 'compose/production/postgres/'
|
||||
- 'compose/production/traefik/'
|
||||
{%- if cookiecutter.cloud_provider == 'None' %}
|
||||
|
||||
- package-ecosystem: 'docker'
|
||||
# Look for a `Dockerfile` in the `compose/production/nginx` directory
|
||||
directory: 'compose/production/nginx/'
|
||||
- 'compose/production/nginx/'
|
||||
{%- endif %}
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
{%- endif %}
|
||||
|
||||
{%- endif %}
|
||||
|
||||
# Enable version updates for Python/Pip - Production
|
||||
- package-ecosystem: 'pip'
|
||||
# Look for a `requirements.txt` in the `root` directory
|
||||
# also 'setup.cfg', 'runtime.txt' and 'requirements/*.txt'
|
||||
# also 'setup.cfg', '.python-version' and 'requirements/*.txt'
|
||||
directory: '/'
|
||||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
groups:
|
||||
python:
|
||||
update-types:
|
||||
- 'minor'
|
||||
- 'patch'
|
||||
|
||||
{%- if cookiecutter.frontend_pipeline == 'Gulp' %}
|
||||
|
||||
|
@ -113,5 +77,10 @@ updates:
|
|||
# Every weekday
|
||||
schedule:
|
||||
interval: 'daily'
|
||||
groups:
|
||||
javascript:
|
||||
update-types:
|
||||
- 'minor'
|
||||
- 'patch'
|
||||
|
||||
{%- endif %}
|
||||
|
|
|
@ -28,7 +28,7 @@ jobs:
|
|||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
python-version-file: '.python-version'
|
||||
|
||||
{%- if cookiecutter.open_source_license != 'Not open source' %}
|
||||
# Consider using pre-commit.ci for open source project
|
||||
|
@ -57,7 +57,7 @@ jobs:
|
|||
|
||||
env:
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
CELERY_BROKER_URL: 'redis://localhost:6379/0'
|
||||
REDIS_URL: 'redis://localhost:6379/0'
|
||||
{%- endif %}
|
||||
# postgres://user:password@host:port/database
|
||||
DATABASE_URL: 'postgres://postgres:postgres@localhost:5432/postgres'
|
||||
|
@ -68,11 +68,31 @@ jobs:
|
|||
uses: actions/checkout@v4
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
|
||||
- name: Build the Stack
|
||||
run: docker compose -f docker-compose.local.yml build django
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build the docs
|
||||
run: docker compose -f docker-compose.docs.yml build docs
|
||||
- name: Build and cache local backend
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
push: false
|
||||
load: true
|
||||
files: docker-compose.local.yml
|
||||
targets: django
|
||||
set: |
|
||||
django.cache-from=type=gha,scope=django-cached-tests
|
||||
django.cache-to=type=gha,scope=django-cached-tests,mode=max
|
||||
postgres.cache-from=type=gha,scope=postgres-cached-tests
|
||||
postgres.cache-to=type=gha,scope=postgres-cached-tests,mode=max
|
||||
|
||||
- name: Build and cache docs
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
push: false
|
||||
load: true
|
||||
files: docker-compose.docs.yml
|
||||
set: |
|
||||
docs.cache-from=type=gha,scope=cached-docs
|
||||
docs.cache-to=type=gha,scope=cached-docs,mode=max
|
||||
|
||||
- name: Check DB Migrations
|
||||
run: docker compose -f docker-compose.local.yml run --rm django python manage.py makemigrations --check
|
||||
|
@ -88,9 +108,9 @@ jobs:
|
|||
{%- else %}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
python-version-file: '.python-version'
|
||||
cache: pip
|
||||
cache-dependency-path: |
|
||||
requirements/base.txt
|
||||
|
|
3
{{cookiecutter.project_slug}}/.gitignore
vendored
3
{{cookiecutter.project_slug}}/.gitignore
vendored
|
@ -59,9 +59,6 @@ docs/_build/
|
|||
# PyBuilder
|
||||
target/
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
{% if cookiecutter.use_celery == 'y' -%}
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
|
|
@ -8,7 +8,7 @@ variables:
|
|||
POSTGRES_DB: 'test_{{ cookiecutter.project_slug }}'
|
||||
POSTGRES_HOST_AUTH_METHOD: trust
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
CELERY_BROKER_URL: 'redis://redis:6379/0'
|
||||
REDIS_URL: 'redis://redis:6379/0'
|
||||
{%- endif %}
|
||||
|
||||
precommit:
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
exclude: '^docs/|/migrations/|devcontainer.json'
|
||||
default_stages: [commit]
|
||||
default_stages: [pre-commit]
|
||||
minimum_pre_commit_version: "3.2.0"
|
||||
|
||||
default_language_version:
|
||||
python: python3.12
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
|
@ -28,14 +29,14 @@ repos:
|
|||
exclude: '{{cookiecutter.project_slug}}/templates/'
|
||||
|
||||
- repo: https://github.com/adamchainz/django-upgrade
|
||||
rev: '1.21.0'
|
||||
rev: '1.24.0'
|
||||
hooks:
|
||||
- id: django-upgrade
|
||||
args: ['--target-version', '5.0']
|
||||
|
||||
# Run the Ruff linter.
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.6.8
|
||||
rev: v0.11.4
|
||||
hooks:
|
||||
# Linter
|
||||
- id: ruff
|
||||
|
@ -44,7 +45,7 @@ repos:
|
|||
- id: ruff-format
|
||||
|
||||
- repo: https://github.com/Riverside-Healthcare/djLint
|
||||
rev: v1.35.2
|
||||
rev: v1.36.4
|
||||
hooks:
|
||||
- id: djlint-reformat-django
|
||||
- id: djlint-django
|
||||
|
|
1
{{cookiecutter.project_slug}}/.python-version
Normal file
1
{{cookiecutter.project_slug}}/.python-version
Normal file
|
@ -0,0 +1 @@
|
|||
3.12
|
|
@ -12,7 +12,7 @@ License: {{cookiecutter.open_source_license}}
|
|||
|
||||
## Settings
|
||||
|
||||
Moved to [settings](http://cookiecutter-django.readthedocs.io/en/latest/settings.html).
|
||||
Moved to [settings](https://cookiecutter-django.readthedocs.io/en/latest/1-getting-started/settings.html).
|
||||
|
||||
## Basic Commands
|
||||
|
||||
|
@ -46,7 +46,7 @@ To run the tests, check your test coverage, and generate an HTML coverage report
|
|||
|
||||
### Live reloading and Sass CSS compilation
|
||||
|
||||
Moved to [Live reloading and SASS compilation](https://cookiecutter-django.readthedocs.io/en/latest/developing-locally.html#sass-compilation-live-reloading).
|
||||
Moved to [Live reloading and SASS compilation](https://cookiecutter-django.readthedocs.io/en/latest/2-local-development/developing-locally.html#using-webpack-or-gulp).
|
||||
|
||||
{%- if cookiecutter.use_celery == "y" %}
|
||||
|
||||
|
@ -87,7 +87,7 @@ celery -A config.celery_app worker -B -l info
|
|||
In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server [Mailpit](https://github.com/axllent/mailpit) with a web interface is available as docker container.
|
||||
|
||||
Container mailpit will start automatically when you will run all docker containers.
|
||||
Please check [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html) for more details how to start all containers.
|
||||
Please check [cookiecutter-django Docker documentation](https://cookiecutter-django.readthedocs.io/en/latest/2-local-development/developing-locally-docker.html) for more details how to start all containers.
|
||||
|
||||
With Mailpit running, to view messages that are sent by your application, open your browser and go to `http://127.0.0.1:8025`
|
||||
{%- else %}
|
||||
|
@ -130,14 +130,14 @@ The following details how to deploy this application.
|
|||
|
||||
### Heroku
|
||||
|
||||
See detailed [cookiecutter-django Heroku documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-on-heroku.html).
|
||||
See detailed [cookiecutter-django Heroku documentation](https://cookiecutter-django.readthedocs.io/en/latest/3-deployment/deployment-on-heroku.html).
|
||||
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_docker.lower() == "y" %}
|
||||
|
||||
### Docker
|
||||
|
||||
See detailed [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html).
|
||||
See detailed [cookiecutter-django Docker documentation](https://cookiecutter-django.readthedocs.io/en/latest/3-deployment/deployment-with-docker.html).
|
||||
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.frontend_pipeline in ['Gulp', 'Webpack'] %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# define an alias for the specific python version used in this file.
|
||||
FROM docker.io/python:3.12.6-slim-bookworm AS python
|
||||
FROM docker.io/python:3.12.9-slim-bookworm AS python
|
||||
|
||||
# Python build stage
|
||||
FROM python AS python-build-stage
|
||||
|
@ -48,7 +48,8 @@ RUN groupadd --gid 1000 dev-user \
|
|||
# Install required system dependencies
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
# psycopg dependencies
|
||||
libpq-dev \
|
||||
libpq-dev \
|
||||
wait-for-it \
|
||||
# Translations dependencies
|
||||
gettext \
|
||||
# cleaning up unused files
|
||||
|
|
|
@ -13,4 +13,4 @@ echo 'Starting flower'
|
|||
|
||||
exec watchfiles --filter python celery.__main__.main \
|
||||
--args \
|
||||
"-A config.celery_app -b \"${CELERY_BROKER_URL}\" flower --basic_auth=\"${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}\""
|
||||
"-A config.celery_app -b \"${REDIS_URL}\" flower --basic_auth=\"${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}\""
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# define an alias for the specific python version used in this file.
|
||||
FROM docker.io/python:3.12.6-slim-bookworm AS python
|
||||
FROM docker.io/python:3.12.9-slim-bookworm AS python
|
||||
|
||||
|
||||
# Python build stage
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM docker.io/node:22-bookworm-slim
|
||||
FROM docker.io/node:22.14-bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM docker.io/amazon/aws-cli:2.17.0
|
||||
FROM docker.io/amazon/aws-cli:2.25.0
|
||||
|
||||
# Clear entrypoint from the base image, otherwise it's always calling the aws CLI
|
||||
ENTRYPOINT []
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% if cookiecutter.frontend_pipeline in ['Gulp', 'Webpack'] -%}
|
||||
FROM docker.io/node:20-bookworm-slim AS client-builder
|
||||
FROM docker.io/node:22.14-bookworm-slim AS client-builder
|
||||
|
||||
ARG APP_HOME=/app
|
||||
WORKDIR ${APP_HOME}
|
||||
|
@ -25,7 +25,7 @@ RUN npm run build
|
|||
|
||||
{%- endif %}
|
||||
# define an alias for the specific python version used in this file.
|
||||
FROM docker.io/python:3.12.6-slim-bookworm AS python
|
||||
FROM docker.io/python:3.12.9-slim-bookworm AS python
|
||||
|
||||
# Python build stage
|
||||
FROM python AS python-build-stage
|
||||
|
@ -39,6 +39,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||
# psycopg dependencies
|
||||
libpq-dev
|
||||
|
||||
|
||||
# Requirements are installed here to ensure they will be cached.
|
||||
COPY ./requirements .
|
||||
|
||||
|
@ -60,7 +61,7 @@ ENV BUILD_ENV=${BUILD_ENVIRONMENT}
|
|||
WORKDIR ${APP_HOME}
|
||||
|
||||
RUN addgroup --system django \
|
||||
&& adduser --system --ingroup django django
|
||||
&& adduser --system --ingroup django django
|
||||
|
||||
|
||||
# Install required system dependencies
|
||||
|
@ -69,6 +70,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||
libpq-dev \
|
||||
# Translations dependencies
|
||||
gettext \
|
||||
# entrypoint
|
||||
wait-for-it \
|
||||
# cleaning up unused files
|
||||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
@ -122,9 +125,6 @@ RUN chown -R django:django ${APP_HOME}
|
|||
USER django
|
||||
|
||||
RUN DATABASE_URL="" \
|
||||
{%- if cookiecutter.use_celery == "y" %}
|
||||
CELERY_BROKER_URL="" \
|
||||
{%- endif %}
|
||||
DJANGO_SETTINGS_MODULE="config.settings.test" \
|
||||
python manage.py compilemessages
|
||||
|
||||
|
|
|
@ -14,6 +14,6 @@ echo 'Starting flower'
|
|||
|
||||
exec celery \
|
||||
-A config.celery_app \
|
||||
-b "${CELERY_BROKER_URL}" \
|
||||
-b "${REDIS_URL}" \
|
||||
flower \
|
||||
--basic_auth="${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}"
|
||||
|
|
|
@ -4,45 +4,13 @@ set -o errexit
|
|||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
|
||||
{% if cookiecutter.use_celery == 'y' %}
|
||||
# N.B. If only .env files supported variable expansion...
|
||||
export CELERY_BROKER_URL="${REDIS_URL}"
|
||||
{% endif %}
|
||||
|
||||
if [ -z "${POSTGRES_USER}" ]; then
|
||||
base_postgres_image_default_user='postgres'
|
||||
export POSTGRES_USER="${base_postgres_image_default_user}"
|
||||
fi
|
||||
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
|
||||
|
||||
python << END
|
||||
import sys
|
||||
import time
|
||||
|
||||
import psycopg
|
||||
|
||||
suggest_unrecoverable_after = 30
|
||||
start = time.time()
|
||||
|
||||
while True:
|
||||
try:
|
||||
psycopg.connect(
|
||||
dbname="${POSTGRES_DB}",
|
||||
user="${POSTGRES_USER}",
|
||||
password="${POSTGRES_PASSWORD}",
|
||||
host="${POSTGRES_HOST}",
|
||||
port="${POSTGRES_PORT}",
|
||||
)
|
||||
break
|
||||
except psycopg.OperationalError as error:
|
||||
sys.stderr.write("Waiting for PostgreSQL to become available...\n")
|
||||
|
||||
if time.time() - start > suggest_unrecoverable_after:
|
||||
sys.stderr.write(" This is taking longer than expected. The following exception may be indicative of an unrecoverable error: '{}'\n".format(error))
|
||||
|
||||
time.sleep(1)
|
||||
END
|
||||
wait-for-it "${POSTGRES_HOST}:${POSTGRES_PORT}" -t 30
|
||||
|
||||
>&2 echo 'PostgreSQL is available'
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM docker.io/traefik:3.1.4
|
||||
FROM docker.io/traefik:3.3.5
|
||||
RUN mkdir -p /etc/traefik/acme \
|
||||
&& touch /etc/traefik/acme/acme.json \
|
||||
&& chmod 600 /etc/traefik/acme/acme.json
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# ruff: noqa
|
||||
"""
|
||||
ASGI config for {{ cookiecutter.project_name }} project.
|
||||
|
||||
|
@ -25,12 +24,9 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
|||
|
||||
# This application object is used by any ASGI server configured to use this file.
|
||||
django_application = get_asgi_application()
|
||||
# Apply ASGI middleware here.
|
||||
# from helloworld.asgi import HelloWorldApplication
|
||||
# application = HelloWorldApplication(application)
|
||||
|
||||
# Import websocket application here, so apps from django_application are loaded first
|
||||
from config.websocket import websocket_application
|
||||
from config.websocket import websocket_application # noqa: E402
|
||||
|
||||
|
||||
async def application(scope, receive, send):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
|
||||
from celery import Celery
|
||||
from celery.signals import setup_logging
|
||||
|
||||
# set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||
|
@ -13,5 +14,15 @@ app = Celery("{{cookiecutter.project_slug}}")
|
|||
# should have a `CELERY_` prefix.
|
||||
app.config_from_object("django.conf:settings", namespace="CELERY")
|
||||
|
||||
|
||||
@setup_logging.connect
|
||||
def config_loggers(*args, **kwargs):
|
||||
from logging.config import dictConfig
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
dictConfig(settings.LOGGING)
|
||||
|
||||
|
||||
# Load task modules from all registered Django app configs.
|
||||
app.autodiscover_tasks()
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# ruff: noqa: ERA001, E501
|
||||
"""Base settings to build other settings files upon."""
|
||||
|
||||
{% if cookiecutter.use_celery == 'y' -%}
|
||||
import ssl
|
||||
{%- endif %}
|
||||
from pathlib import Path
|
||||
|
||||
import environ
|
||||
|
@ -282,6 +285,9 @@ LOGGING = {
|
|||
"root": {"level": "INFO", "handlers": ["console"]},
|
||||
}
|
||||
|
||||
REDIS_URL = env("REDIS_URL", default="redis://{% if cookiecutter.use_docker == 'y' %}redis{%else%}localhost{% endif %}:6379/0")
|
||||
REDIS_SSL = REDIS_URL.startswith("rediss://")
|
||||
|
||||
{% if cookiecutter.use_celery == 'y' -%}
|
||||
# Celery
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -289,9 +295,13 @@ if USE_TZ:
|
|||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-timezone
|
||||
CELERY_TIMEZONE = TIME_ZONE
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-broker_url
|
||||
CELERY_BROKER_URL = env("CELERY_BROKER_URL")
|
||||
CELERY_BROKER_URL = REDIS_URL
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#redis-backend-use-ssl
|
||||
CELERY_BROKER_USE_SSL = {"ssl_cert_reqs": ssl.CERT_NONE} if REDIS_SSL else None
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std:setting-result_backend
|
||||
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
|
||||
CELERY_RESULT_BACKEND = REDIS_URL
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#redis-backend-use-ssl
|
||||
CELERY_REDIS_BACKEND_USE_SSL = CELERY_BROKER_USE_SSL
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-extended
|
||||
CELERY_RESULT_EXTENDED = True
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#result-backend-always-retry
|
||||
|
@ -317,18 +327,20 @@ CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
|
|||
CELERY_WORKER_SEND_TASK_EVENTS = True
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#std-setting-task_send_sent_event
|
||||
CELERY_TASK_SEND_SENT_EVENT = True
|
||||
# https://docs.celeryq.dev/en/stable/userguide/configuration.html#worker-hijack-root-logger
|
||||
CELERY_WORKER_HIJACK_ROOT_LOGGER = False
|
||||
|
||||
{%- endif %}
|
||||
# django-allauth
|
||||
# ------------------------------------------------------------------------------
|
||||
ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True)
|
||||
# https://docs.allauth.org/en/latest/account/configuration.html
|
||||
ACCOUNT_AUTHENTICATION_METHOD = "{{cookiecutter.username_type}}"
|
||||
ACCOUNT_LOGIN_METHODS = {"{{cookiecutter.username_type}}"}
|
||||
# https://docs.allauth.org/en/latest/account/configuration.html
|
||||
ACCOUNT_EMAIL_REQUIRED = True
|
||||
{%- if cookiecutter.username_type == "email" %}
|
||||
# https://docs.allauth.org/en/latest/account/configuration.html
|
||||
ACCOUNT_USERNAME_REQUIRED = False
|
||||
{%- if cookiecutter.username_type == "username" %}
|
||||
ACCOUNT_SIGNUP_FIELDS = ["email*", "username*", "password1*", "password2*"]
|
||||
{%- else %}
|
||||
ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"]
|
||||
# https://docs.allauth.org/en/latest/account/configuration.html
|
||||
ACCOUNT_USER_MODEL_USERNAME_FIELD = None
|
||||
{%- endif %}
|
||||
|
|
|
@ -16,6 +16,7 @@ from sentry_sdk.integrations.redis import RedisIntegration
|
|||
from .base import * # noqa: F403
|
||||
from .base import DATABASES
|
||||
from .base import INSTALLED_APPS
|
||||
from .base import REDIS_URL
|
||||
{%- if cookiecutter.use_drf == "y" %}
|
||||
from .base import SPECTACULAR_SETTINGS
|
||||
{%- endif %}
|
||||
|
@ -37,10 +38,10 @@ DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60)
|
|||
CACHES = {
|
||||
"default": {
|
||||
"BACKEND": "django_redis.cache.RedisCache",
|
||||
"LOCATION": env("REDIS_URL"),
|
||||
"LOCATION": REDIS_URL,
|
||||
"OPTIONS": {
|
||||
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||
# Mimicing memcache behavior.
|
||||
# Mimicking memcache behavior.
|
||||
# https://github.com/jazzband/django-redis#memcached-exceptions-behavior
|
||||
"IGNORE_EXCEPTIONS": True,
|
||||
},
|
||||
|
@ -170,7 +171,7 @@ STORAGES = {
|
|||
"BACKEND": "storages.backends.azure_storage.AzureStorage",
|
||||
"OPTIONS": {
|
||||
"location": "media",
|
||||
"file_overwrite": False,
|
||||
"overwrite_files": False,
|
||||
},
|
||||
},
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
|
@ -323,7 +324,7 @@ COMPRESS_FILTERS = {
|
|||
"js": ["compressor.filters.jsmin.JSMinFilter"],
|
||||
}
|
||||
{% endif %}
|
||||
{%- if cookiecutter.use_whitenoise == 'n' -%}
|
||||
{%- if cookiecutter.use_whitenoise == 'n' and cookiecutter.cloud_provider in ('AWS', 'GCP') -%}
|
||||
# Collectfasta
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://github.com/jasongi/collectfasta#installation
|
||||
|
|
|
@ -33,7 +33,7 @@ TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore[index]
|
|||
# MEDIA
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#media-url
|
||||
MEDIA_URL = "http://media.testserver"
|
||||
MEDIA_URL = "http://media.testserver/"
|
||||
|
||||
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
||||
# django-webpack-loader
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# ruff: noqa
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
|
@ -43,7 +42,7 @@ urlpatterns += [
|
|||
# API base url
|
||||
path("api/", include("config.api_router")),
|
||||
# DRF auth token
|
||||
path("api/auth-token/", obtain_auth_token),
|
||||
path("api/auth-token/", obtain_auth_token, name="obtain_auth_token"),
|
||||
path("api/schema/", SpectacularAPIView.as_view(), name="api-schema"),
|
||||
path(
|
||||
"api/docs/",
|
||||
|
@ -77,4 +76,7 @@ if settings.DEBUG:
|
|||
if "debug_toolbar" in settings.INSTALLED_APPS:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns
|
||||
urlpatterns = [
|
||||
path("__debug__/", include(debug_toolbar.urls)),
|
||||
*urlpatterns,
|
||||
]
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# ruff: noqa
|
||||
"""
|
||||
WSGI config for {{ cookiecutter.project_name }} project.
|
||||
|
||||
|
@ -25,16 +24,9 @@ from django.core.wsgi import get_wsgi_application
|
|||
# {{ cookiecutter.project_slug }} directory.
|
||||
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
|
||||
sys.path.append(str(BASE_DIR / "{{ cookiecutter.project_slug }}"))
|
||||
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
||||
# if running multiple sites in the same mod_wsgi process. To fix this, use
|
||||
# mod_wsgi daemon mode with each site in its own daemon process, or use
|
||||
# os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production"
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
|
||||
|
||||
# This application object is used by any WSGI server configured to use this
|
||||
# file. This includes Django's development server, if the WSGI_APPLICATION
|
||||
# setting points here.
|
||||
application = get_wsgi_application()
|
||||
# Apply WSGI middleware here.
|
||||
# from helloworld.wsgi import HelloWorldApplication
|
||||
# application = HelloWorldApplication(application)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# ruff: noqa
|
||||
# ruff: noqa: ERA001, PTH100
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
|
@ -13,9 +13,10 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import django
|
||||
|
||||
if os.getenv("READTHEDOCS", default=False) == "True":
|
||||
if os.getenv("READTHEDOCS", default="False") == "True":
|
||||
sys.path.insert(0, os.path.abspath(".."))
|
||||
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
|
||||
os.environ["USE_DOCKER"] = "no"
|
||||
|
@ -26,16 +27,13 @@ else:
|
|||
sys.path.insert(0, os.path.abspath(".."))
|
||||
{%- endif %}
|
||||
os.environ["DATABASE_URL"] = "sqlite:///readthedocs.db"
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379")
|
||||
{%- endif %}
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||
django.setup()
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = "{{ cookiecutter.project_name }}"
|
||||
copyright = """{% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}"""
|
||||
copyright = """{% now 'utc', '%Y' %}, {{ cookiecutter.author_name }}""" # noqa: A001
|
||||
author = "{{ cookiecutter.author_name }}"
|
||||
|
||||
|
||||
|
|
|
@ -3,28 +3,32 @@
|
|||
////////////////////////////////
|
||||
|
||||
// Gulp and package
|
||||
const { src, dest, parallel, series, watch } = require('gulp');
|
||||
const pjson = require('./package.json');
|
||||
import { src, dest, parallel, series, task, watch } from 'gulp';
|
||||
import pjson from './package.json' with {type: 'json'};
|
||||
|
||||
// Plugins
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const browserSync = require('browser-sync').create();
|
||||
const concat = require('gulp-concat');
|
||||
const tildeImporter = require('node-sass-tilde-importer');
|
||||
const cssnano = require('cssnano');
|
||||
const imagemin = require('gulp-imagemin');
|
||||
const pixrem = require('pixrem');
|
||||
const plumber = require('gulp-plumber');
|
||||
const postcss = require('gulp-postcss');
|
||||
import autoprefixer from 'autoprefixer';
|
||||
import browserSyncLib from 'browser-sync';
|
||||
import concat from 'gulp-concat';
|
||||
import tildeImporter from 'node-sass-tilde-importer';
|
||||
import cssnano from 'cssnano';
|
||||
import pixrem from 'pixrem';
|
||||
import plumber from 'gulp-plumber';
|
||||
import postcss from 'gulp-postcss';
|
||||
import rename from 'gulp-rename';
|
||||
import gulpSass from 'gulp-sass';
|
||||
import * as dartSass from 'sass';
|
||||
import gulUglifyES from 'gulp-uglify-es';
|
||||
import { spawn } from 'node:child_process';
|
||||
|
||||
const browserSync = browserSyncLib.create();
|
||||
const reload = browserSync.reload;
|
||||
const rename = require('gulp-rename');
|
||||
const sass = require('gulp-sass')(require('sass'));
|
||||
const spawn = require('child_process').spawn;
|
||||
const uglify = require('gulp-uglify-es').default;
|
||||
const sass = gulpSass(dartSass);
|
||||
const uglify = gulUglifyES.default;
|
||||
|
||||
// Relative paths function
|
||||
function pathsConfig(appName) {
|
||||
this.app = `./${pjson.name}`;
|
||||
function pathsConfig() {
|
||||
const appName = `./${pjson.name}`;
|
||||
const vendorsRoot = 'node_modules';
|
||||
|
||||
return {
|
||||
|
@ -32,13 +36,13 @@ function pathsConfig(appName) {
|
|||
`${vendorsRoot}/@popperjs/core/dist/umd/popper.js`,
|
||||
`${vendorsRoot}/bootstrap/dist/js/bootstrap.js`,
|
||||
],
|
||||
app: this.app,
|
||||
templates: `${this.app}/templates`,
|
||||
css: `${this.app}/static/css`,
|
||||
sass: `${this.app}/static/sass`,
|
||||
fonts: `${this.app}/static/fonts`,
|
||||
images: `${this.app}/static/images`,
|
||||
js: `${this.app}/static/js`,
|
||||
app: appName,
|
||||
templates: `${appName}/templates`,
|
||||
css: `${appName}/static/css`,
|
||||
sass: `${appName}/static/sass`,
|
||||
fonts: `${appName}/static/fonts`,
|
||||
images: `${appName}/static/images`,
|
||||
js: `${appName}/static/js`,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -95,7 +99,8 @@ function vendorScripts() {
|
|||
}
|
||||
|
||||
// Image compression
|
||||
function imgCompression() {
|
||||
async function imgCompression() {
|
||||
const imagemin = (await import("gulp-imagemin")).default;
|
||||
return src(`${paths.images}/*`)
|
||||
.pipe(imagemin()) // Compresses PNG, JPEG, GIF and SVG images
|
||||
.pipe(dest(paths.images));
|
||||
|
@ -163,7 +168,7 @@ function watchPaths() {
|
|||
}
|
||||
|
||||
// Generate all assets
|
||||
const generateAssets = parallel(styles, scripts, vendorScripts, imgCompression);
|
||||
const build = parallel(styles, scripts, vendorScripts, imgCompression);
|
||||
|
||||
// Set up dev environment
|
||||
{%- if cookiecutter.use_docker == 'n' %}
|
||||
|
@ -176,6 +181,6 @@ const dev = parallel(runServer, initBrowserSync, watchPaths);
|
|||
const dev = parallel(initBrowserSync, watchPaths);
|
||||
{%- endif %}
|
||||
|
||||
exports.default = series(generateAssets, dev);
|
||||
exports['generate-assets'] = generateAssets;
|
||||
exports['dev'] = dev;
|
||||
task('default', series(build, dev));
|
||||
task('build', build);
|
||||
task('dev', dev);
|
38
{{cookiecutter.project_slug}}/justfile
Normal file
38
{{cookiecutter.project_slug}}/justfile
Normal file
|
@ -0,0 +1,38 @@
|
|||
export COMPOSE_FILE := "docker-compose.local.yml"
|
||||
|
||||
## Just does not yet manage signals for subprocesses reliably, which can lead to unexpected behavior.
|
||||
## Exercise caution before expanding its usage in production environments.
|
||||
## For more information, see https://github.com/casey/just/issues/2473 .
|
||||
|
||||
|
||||
# Default command to list all available commands.
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# build: Build python image.
|
||||
build:
|
||||
@echo "Building python image..."
|
||||
@docker compose build
|
||||
|
||||
# up: Start up containers.
|
||||
up:
|
||||
@echo "Starting up containers..."
|
||||
@docker compose up -d --remove-orphans
|
||||
|
||||
# down: Stop containers.
|
||||
down:
|
||||
@echo "Stopping containers..."
|
||||
@docker compose down
|
||||
|
||||
# prune: Remove containers and their volumes.
|
||||
prune *args:
|
||||
@echo "Killing containers and removing volumes..."
|
||||
@docker compose down -v {{ "{{args}}" }}
|
||||
|
||||
# logs: View container logs
|
||||
logs *args:
|
||||
@docker compose logs -f {{ "{{args}}" }}
|
||||
|
||||
# manage: Executes `manage.py` command.
|
||||
manage +args:
|
||||
@docker compose run --rm django python ./manage.py {{ "{{args}}" }}
|
|
@ -1,6 +1,6 @@
|
|||
# Translations
|
||||
|
||||
Start by configuring the `LANGUAGES` settings in `base.py`, by uncommenting languages you are willing to support. Then, translations strings will be placed in this folder when running:
|
||||
Start by configuring the `LANGUAGES` settings in `base.py`, by uncommenting languages you are willing to support. Then, translation strings will be placed in this folder when running:
|
||||
|
||||
```bash
|
||||
{% if cookiecutter.use_docker == 'y' %}docker compose -f docker-compose.local.yml run --rm django {% endif %}python manage.py makemessages --all --no-location
|
||||
|
@ -19,7 +19,7 @@ Once all translations are done, they need to be compiled into `.mo` files (stand
|
|||
{% if cookiecutter.use_docker == 'y' %}docker compose -f docker-compose.local.yml run --rm django {% endif %}python manage.py compilemessages
|
||||
```
|
||||
|
||||
Note that the `.po` files are NOT used by the application directly, so if the `.mo` files are out of dates, the content won't appear as translated even if the `.po` files are up-to-date.
|
||||
Note that the `.po` files are NOT used by the application directly, so if the `.mo` files are out of date, the content won't appear as translated even if the `.po` files are up-to-date.
|
||||
|
||||
## Production
|
||||
|
||||
|
|
|
@ -1,28 +1,22 @@
|
|||
#!/usr/bin/env python
|
||||
# ruff: noqa
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError:
|
||||
# The above import may fail for some other reason. Ensure that the
|
||||
# issue is really that Django is missing to avoid masking other
|
||||
# exceptions on Python 2.
|
||||
try:
|
||||
import django
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"Couldn't import Django. Are you sure it's installed and "
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?"
|
||||
)
|
||||
|
||||
raise
|
||||
except ImportError as exc:
|
||||
raise ImportError( # noqa: TRY003
|
||||
"Couldn't import Django. Are you sure it's installed and " # noqa: EM101
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?",
|
||||
) from exc
|
||||
|
||||
# This allows easy placement of apps within the interior
|
||||
# {{ cookiecutter.project_slug }} directory.
|
||||
|
@ -30,3 +24,7 @@ if __name__ == "__main__":
|
|||
sys.path.append(str(current_path / "{{ cookiecutter.project_slug }}"))
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
# ruff: noqa
|
||||
import os
|
||||
from collections.abc import Sequence
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -19,7 +17,7 @@ def merge(
|
|||
merged_content = ""
|
||||
for merge_file in files_to_merge:
|
||||
merged_content += merge_file.read_text()
|
||||
merged_content += os.linesep
|
||||
merged_content += "\n"
|
||||
output_file.write_text(merged_content)
|
||||
|
||||
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
"@babel/preset-env": "^7.16.5",
|
||||
"@popperjs/core": "^2.10.2",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"babel-loader": "^9.1.2",
|
||||
"babel-loader": "^10.0.0",
|
||||
"bootstrap": "^5.2.3",
|
||||
"browser-sync": "^3.0.2",
|
||||
"css-loader": "^7.1.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"concurrently": "^9.0.0",
|
||||
"cssnano": "^7.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-imagemin": "^7.1.0",
|
||||
"gulp": "^5.0.0",
|
||||
"gulp-imagemin": "^9.1.0",
|
||||
"gulp-plumber": "^1.2.1",
|
||||
"gulp-postcss": "^10.0.0",
|
||||
"gulp-rename": "^2.0.0",
|
||||
|
@ -26,16 +26,16 @@
|
|||
"postcss": "^8.3.11",
|
||||
"postcss-loader": "^8.0.0",
|
||||
"postcss-preset-env": "^10.0.3",
|
||||
"sass": "^1.43.4",
|
||||
"sass": "1.77.6",
|
||||
"sass-loader": "^16.0.1",
|
||||
"webpack": "^5.65.0",
|
||||
"webpack": "^5.82.0",
|
||||
"webpack-bundle-tracker": "^3.0.1",
|
||||
"webpack-cli": "^5.0.1",
|
||||
"webpack-cli": "^6.0.1",
|
||||
"webpack-dev-server": "^5.0.2",
|
||||
"webpack-merge": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "22"
|
||||
"node": "22.14"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 2 versions"
|
||||
|
|
|
@ -106,7 +106,7 @@ select = [
|
|||
"SLOT",
|
||||
"SIM",
|
||||
"TID",
|
||||
"TCH",
|
||||
"TC",
|
||||
"INT",
|
||||
# "ARG", # Unused function argument
|
||||
"PTH",
|
||||
|
@ -135,7 +135,7 @@ ignore = [
|
|||
# The fixes in extend-unsafe-fixes will require
|
||||
# provide the `--unsafe-fixes` flag when fixing.
|
||||
extend-unsafe-fixes = [
|
||||
"UP038",
|
||||
"UP038",
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
python-slugify==8.0.4 # https://github.com/un33k/python-slugify
|
||||
Pillow==10.4.0 # https://github.com/python-pillow/Pillow
|
||||
Pillow==11.1.0 # pyup: != 11.2.0 # https://github.com/python-pillow/Pillow
|
||||
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
|
||||
{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}
|
||||
rcssmin==1.1.2 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
|
||||
|
@ -9,42 +9,42 @@ rcssmin==1.1.2 # https://github.com/ndparker/rcssmin
|
|||
{%- endif %}
|
||||
argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
whitenoise==6.7.0 # https://github.com/evansd/whitenoise
|
||||
whitenoise==6.9.0 # https://github.com/evansd/whitenoise
|
||||
{%- endif %}
|
||||
redis==5.1.0 # https://github.com/redis/redis-py
|
||||
redis==5.2.1 # https://github.com/redis/redis-py
|
||||
{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %}
|
||||
hiredis==3.0.0 # https://github.com/redis/hiredis-py
|
||||
hiredis==3.1.0 # https://github.com/redis/hiredis-py
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_celery == "y" %}
|
||||
celery==5.4.0 # pyup: < 6.0 # https://github.com/celery/celery
|
||||
celery==5.5.0 # pyup: < 6.0 # https://github.com/celery/celery
|
||||
django-celery-beat==2.7.0 # https://github.com/celery/django-celery-beat
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
flower==2.0.1 # https://github.com/mher/flower
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_async == 'y' %}
|
||||
uvicorn[standard]==0.31.0 # https://github.com/encode/uvicorn
|
||||
uvicorn-worker==0.2.0 # https://github.com/Kludex/uvicorn-worker
|
||||
uvicorn[standard]==0.34.0 # https://github.com/encode/uvicorn
|
||||
uvicorn-worker==0.3.0 # https://github.com/Kludex/uvicorn-worker
|
||||
{%- endif %}
|
||||
|
||||
# Django
|
||||
# ------------------------------------------------------------------------------
|
||||
django==5.0.9 # pyup: < 5.1 # https://www.djangoproject.com/
|
||||
django-environ==0.11.2 # https://github.com/joke2k/django-environ
|
||||
django==5.1.8 # pyup: < 5.2 # https://www.djangoproject.com/
|
||||
django-environ==0.12.0 # https://github.com/joke2k/django-environ
|
||||
django-model-utils==5.0.0 # https://github.com/jazzband/django-model-utils
|
||||
django-allauth[mfa]==65.0.2 # https://github.com/pennersr/django-allauth
|
||||
django-allauth[mfa]==65.7.0 # https://github.com/pennersr/django-allauth
|
||||
django-crispy-forms==2.3 # https://github.com/django-crispy-forms/django-crispy-forms
|
||||
crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5
|
||||
crispy-bootstrap5==2025.4 # https://github.com/django-crispy-forms/crispy-bootstrap5
|
||||
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
|
||||
django-compressor==4.5.1 # https://github.com/django-compressor/django-compressor
|
||||
{%- endif %}
|
||||
django-redis==5.4.0 # https://github.com/jazzband/django-redis
|
||||
{%- if cookiecutter.use_drf == 'y' %}
|
||||
# Django REST Framework
|
||||
djangorestframework==3.15.2 # https://github.com/encode/django-rest-framework
|
||||
django-cors-headers==4.4.0 # https://github.com/adamchainz/django-cors-headers
|
||||
djangorestframework==3.16.0 # https://github.com/encode/django-rest-framework
|
||||
django-cors-headers==4.7.0 # https://github.com/adamchainz/django-cors-headers
|
||||
# DRF-spectacular for api documentation
|
||||
drf-spectacular==0.27.2 # https://github.com/tfranzel/drf-spectacular
|
||||
drf-spectacular==0.28.0 # https://github.com/tfranzel/drf-spectacular
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
||||
django-webpack-loader==3.1.1 # https://github.com/django-webpack/django-webpack-loader
|
||||
|
|
|
@ -1,44 +1,43 @@
|
|||
-r production.txt
|
||||
|
||||
watchdog==4.0.2 # https://github.com/gorakhargosh/watchdog
|
||||
Werkzeug[watchdog]==3.0.4 # https://github.com/pallets/werkzeug
|
||||
Werkzeug[watchdog]==3.1.3 # https://github.com/pallets/werkzeug
|
||||
ipdb==0.13.13 # https://github.com/gotcha/ipdb
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
psycopg[c]==3.2.3 # https://github.com/psycopg/psycopg
|
||||
psycopg[c]==3.2.6 # https://github.com/psycopg/psycopg
|
||||
{%- else %}
|
||||
psycopg[binary]==3.2.3 # https://github.com/psycopg/psycopg
|
||||
psycopg[binary]==3.2.6 # https://github.com/psycopg/psycopg
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %}
|
||||
watchfiles==0.24.0 # https://github.com/samuelcolvin/watchfiles
|
||||
watchfiles==1.0.4 # https://github.com/samuelcolvin/watchfiles
|
||||
{%- endif %}
|
||||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
mypy==1.11.2 # https://github.com/python/mypy
|
||||
django-stubs[compatible-mypy]==5.1.0 # https://github.com/typeddjango/django-stubs
|
||||
pytest==8.3.3 # https://github.com/pytest-dev/pytest
|
||||
pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar
|
||||
mypy==1.15.0 # https://github.com/python/mypy
|
||||
django-stubs[compatible-mypy]==5.1.3 # https://github.com/typeddjango/django-stubs
|
||||
pytest==8.3.5 # https://github.com/pytest-dev/pytest
|
||||
pytest-sugar==1.0.0 # https://github.com/Teemu/pytest-sugar
|
||||
{%- if cookiecutter.use_drf == "y" %}
|
||||
djangorestframework-stubs==3.15.1 # https://github.com/typeddjango/djangorestframework-stubs
|
||||
djangorestframework-stubs==3.15.3 # https://github.com/typeddjango/djangorestframework-stubs
|
||||
{%- endif %}
|
||||
|
||||
# Documentation
|
||||
# ------------------------------------------------------------------------------
|
||||
sphinx==7.4.7 # https://github.com/sphinx-doc/sphinx
|
||||
sphinx-autobuild==2024.9.19 # https://github.com/GaretJax/sphinx-autobuild
|
||||
sphinx==8.2.3 # pyup: != 8.3.0 # https://github.com/sphinx-doc/sphinx
|
||||
sphinx-autobuild==2024.10.3 # https://github.com/GaretJax/sphinx-autobuild
|
||||
|
||||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
ruff==0.6.8 # https://github.com/astral-sh/ruff
|
||||
coverage==7.6.1 # https://github.com/nedbat/coveragepy
|
||||
djlint==1.35.2 # https://github.com/Riverside-Healthcare/djLint
|
||||
pre-commit==3.8.0 # https://github.com/pre-commit/pre-commit
|
||||
ruff==0.11.4 # https://github.com/astral-sh/ruff
|
||||
coverage==7.8.0 # https://github.com/nedbat/coveragepy
|
||||
djlint==1.36.4 # https://github.com/Riverside-Healthcare/djLint
|
||||
pre-commit==4.2.0 # https://github.com/pre-commit/pre-commit
|
||||
|
||||
# Django
|
||||
# ------------------------------------------------------------------------------
|
||||
factory-boy==3.3.1 # https://github.com/FactoryBoy/factory_boy
|
||||
factory-boy==3.3.2 # https://github.com/FactoryBoy/factory_boy
|
||||
|
||||
django-debug-toolbar==4.4.6 # https://github.com/jazzband/django-debug-toolbar
|
||||
django-debug-toolbar==5.1.0 # https://github.com/jazzband/django-debug-toolbar
|
||||
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
|
||||
django-coverage-plugin==3.1.0 # https://github.com/nedbat/django_coverage_plugin
|
||||
pytest-django==4.9.0 # https://github.com/pytest-dev/pytest-django
|
||||
pytest-django==4.11.1 # https://github.com/pytest-dev/pytest-django
|
||||
|
|
|
@ -3,42 +3,42 @@
|
|||
-r base.txt
|
||||
|
||||
gunicorn==23.0.0 # https://github.com/benoitc/gunicorn
|
||||
psycopg[c]==3.2.3 # https://github.com/psycopg/psycopg
|
||||
{%- if cookiecutter.use_whitenoise == 'n' %}
|
||||
Collectfasta==3.2.0 # https://github.com/jasongi/collectfasta
|
||||
psycopg[c]==3.2.6 # https://github.com/psycopg/psycopg
|
||||
{%- if cookiecutter.use_whitenoise == 'n'and cookiecutter.cloud_provider in ('AWS', 'GCP') %}
|
||||
Collectfasta==3.2.1 # https://github.com/jasongi/collectfasta
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_sentry == "y" %}
|
||||
sentry-sdk==2.14.0 # https://github.com/getsentry/sentry-python
|
||||
sentry-sdk==2.25.1 # https://github.com/getsentry/sentry-python
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %}
|
||||
hiredis==3.0.0 # https://github.com/redis/hiredis-py
|
||||
hiredis==3.1.0 # https://github.com/redis/hiredis-py
|
||||
{%- endif %}
|
||||
|
||||
# Django
|
||||
# ------------------------------------------------------------------------------
|
||||
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
||||
django-storages[s3]==1.14.4 # https://github.com/jschneier/django-storages
|
||||
django-storages[s3]==1.14.6 # https://github.com/jschneier/django-storages
|
||||
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
||||
django-storages[google]==1.14.4 # https://github.com/jschneier/django-storages
|
||||
django-storages[google]==1.14.6 # https://github.com/jschneier/django-storages
|
||||
{%- elif cookiecutter.cloud_provider == 'Azure' %}
|
||||
django-storages[azure]==1.14.4 # https://github.com/jschneier/django-storages
|
||||
django-storages[azure]==1.14.6 # https://github.com/jschneier/django-storages
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.mail_service == 'Mailgun' %}
|
||||
django-anymail[mailgun]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[mailgun]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Amazon SES' %}
|
||||
django-anymail[amazon-ses]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[amazon-ses]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Mailjet' %}
|
||||
django-anymail[mailjet]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[mailjet]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Mandrill' %}
|
||||
django-anymail[mandrill]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[mandrill]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Postmark' %}
|
||||
django-anymail[postmark]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[postmark]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Sendgrid' %}
|
||||
django-anymail[sendgrid]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[sendgrid]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Brevo' %}
|
||||
django-anymail[brevo]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[brevo]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'SparkPost' %}
|
||||
django-anymail[sparkpost]==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail[sparkpost]==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- elif cookiecutter.mail_service == 'Other SMTP' %}
|
||||
django-anymail==12.0 # https://github.com/anymail/django-anymail
|
||||
django-anymail==13.0 # https://github.com/anymail/django-anymail
|
||||
{%- endif %}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
python-3.12.6
|
23
{{cookiecutter.project_slug}}/utility/requirements-noble.apt
Normal file
23
{{cookiecutter.project_slug}}/utility/requirements-noble.apt
Normal file
|
@ -0,0 +1,23 @@
|
|||
##basic build dependencies of various Django apps for Debian Bookworm 12.x
|
||||
#build-essential metapackage install: make, gcc, g++,
|
||||
build-essential
|
||||
#required to translate
|
||||
gettext
|
||||
python3-dev
|
||||
|
||||
##shared dependencies of:
|
||||
##Pillow, pylibmc
|
||||
zlib1g-dev
|
||||
|
||||
##Postgresql and psycopg dependencies
|
||||
libpq-dev
|
||||
|
||||
##Pillow dependencies
|
||||
libtiff5-dev
|
||||
libjpeg62-turbo-dev
|
||||
libfreetype6-dev
|
||||
liblcms2-dev
|
||||
libwebp-dev
|
||||
|
||||
##django-extensions
|
||||
libgraphviz-dev
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
To understand why this file is here, please read:
|
||||
|
||||
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
"""
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
To understand why this file is here, please read:
|
||||
|
||||
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
"""
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"""
|
||||
To understand why this file is here, please read:
|
||||
|
||||
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
"""
|
||||
from django.conf import settings
|
||||
from django.db import migrations
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
To understand why this file is here, please read:
|
||||
|
||||
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
https://cookiecutter-django.readthedocs.io/en/latest/5-help/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
|
||||
"""
|
||||
|
|
|
@ -17,7 +17,7 @@ class UserAdminChangeForm(admin_forms.UserChangeForm):
|
|||
{%- endif %}
|
||||
|
||||
|
||||
class UserAdminCreationForm(admin_forms.UserCreationForm):
|
||||
class UserAdminCreationForm(admin_forms.AdminUserCreationForm): # type: ignore[name-defined] # django-stubs is missing the class, thats why the error is thrown: typeddjango/django-stubs#2555
|
||||
"""
|
||||
Form for User Creation in the Admin Area.
|
||||
To change user signup, see UserSignupForm and UserSocialSignupForm.
|
||||
|
|
|
@ -4,14 +4,14 @@ import pytest
|
|||
from django.urls import reverse
|
||||
|
||||
|
||||
def test_swagger_accessible_by_admin(admin_client):
|
||||
def test_api_docs_accessible_by_admin(admin_client):
|
||||
url = reverse("api-docs")
|
||||
response = admin_client.get(url)
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_swagger_ui_not_accessible_by_normal_user(client):
|
||||
def test_api_docs_not_accessible_by_anonymous_users(client):
|
||||
url = reverse("api-docs")
|
||||
response = client.get(url)
|
||||
assert response.status_code == HTTPStatus.FORBIDDEN
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user