Merge pull request #1 from cookiecutter/master

MERGE: Update the main repo
This commit is contained in:
Jimmy Gitonga 2022-09-09 13:02:59 +03:00 committed by GitHub
commit d307dce124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 267 additions and 92 deletions

View File

@ -1262,5 +1262,30 @@
"name": "Naveen",
"github_login": "naveensrinivasan",
"twitter_username": "snaveen"
},
{
"name": "Nikita Sobolev",
"github_login": "sobolevn",
"twitter_username": ""
},
{
"name": "Sebastian Reyes Espinosa",
"github_login": "sebastian-code",
"twitter_username": "sebastianreyese"
},
{
"name": "jugglinmike",
"github_login": "jugglinmike",
"twitter_username": ""
},
{
"name": "monosans",
"github_login": "monosans",
"twitter_username": ""
},
{
"name": "Marcio Mazza",
"github_login": "marciomazza",
"twitter_username": "marciomazza"
}
]

View File

@ -9,14 +9,14 @@ repos:
- id: check-yaml
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py39-plus]
exclude: hooks/
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black
@ -26,7 +26,7 @@ repos:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8

View File

@ -3,6 +3,129 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
<!-- GENERATOR_PLACEHOLDER -->
## 2022.09.05
### Updated
- Update sentry-sdk to 1.9.8 ([#3861](https://github.com/cookiecutter/cookiecutter-django/pull/3861))
## 2022.09.02
### Updated
- Update pytest to 7.1.3 ([#3860](https://github.com/cookiecutter/cookiecutter-django/pull/3860))
- Update sentry-sdk to 1.9.7 ([#3859](https://github.com/cookiecutter/cookiecutter-django/pull/3859))
## 2022.09.01
### Changed
- Add article to README about how to use a hosted DB ([#3844](https://github.com/cookiecutter/cookiecutter-django/pull/3844))
### Updated
- Update sentry-sdk to 1.9.6 ([#3856](https://github.com/cookiecutter/cookiecutter-django/pull/3856))
- Auto-update pre-commit hooks ([#3858](https://github.com/cookiecutter/cookiecutter-django/pull/3858))
- Update black to 22.8.0 ([#3857](https://github.com/cookiecutter/cookiecutter-django/pull/3857))
## 2022.08.26
### Changed
- Fix formatting in docs ([#3850](https://github.com/cookiecutter/cookiecutter-django/pull/3850))
## 2022.08.24
### Updated
- Update django-debug-toolbar to 3.6.0 ([#3847](https://github.com/cookiecutter/cookiecutter-django/pull/3847))
- Update werkzeug to 2.2.2 ([#3846](https://github.com/cookiecutter/cookiecutter-django/pull/3846))
- Update coverage to 6.4.4 ([#3842](https://github.com/cookiecutter/cookiecutter-django/pull/3842))
- Update uvicorn to 0.18.3 ([#3845](https://github.com/cookiecutter/cookiecutter-django/pull/3845))
- Update sentry-sdk to 1.9.5 ([#3841](https://github.com/cookiecutter/cookiecutter-django/pull/3841))
- Update flower to 1.2.0 ([#3836](https://github.com/cookiecutter/cookiecutter-django/pull/3836))
- Update django-storages to 1.13.1 ([#3833](https://github.com/cookiecutter/cookiecutter-django/pull/3833))
## 2022.08.15
### Updated
- Update coverage to 6.4.3 ([#3835](https://github.com/cookiecutter/cookiecutter-django/pull/3835))
- Update pytz to 2022.2.1 ([#3840](https://github.com/cookiecutter/cookiecutter-django/pull/3840))
- Update sentry-sdk to 1.9.4 ([#3838](https://github.com/cookiecutter/cookiecutter-django/pull/3838))
## 2022.08.09
### Updated
- Update sentry-sdk to 1.9.3 ([#3837](https://github.com/cookiecutter/cookiecutter-django/pull/3837))
## 2022.08.05
### Updated
- Update sentry-sdk to 1.9.2 ([#3832](https://github.com/cookiecutter/cookiecutter-django/pull/3832))
## 2022.08.04
### Updated
- Auto-update pre-commit hooks ([#3816](https://github.com/cookiecutter/cookiecutter-django/pull/3816))
- Update flake8 to 5.0.4 ([#3829](https://github.com/cookiecutter/cookiecutter-django/pull/3829))
- Update django-compressor to 4.1 ([#3823](https://github.com/cookiecutter/cookiecutter-django/pull/3823))
- Update flake8-isort to 4.2.0 ([#3828](https://github.com/cookiecutter/cookiecutter-django/pull/3828))
## 2022.08.03
### Updated
- Update django to 3.2.15 ([#3822](https://github.com/cookiecutter/cookiecutter-django/pull/3822))
## 2022.07.29
### Updated
- Update sentry-sdk to 1.9.0 ([#3815](https://github.com/cookiecutter/cookiecutter-django/pull/3815))
## 2022.07.28
### Updated
- Update werkzeug to 2.2.1 ([#3814](https://github.com/cookiecutter/cookiecutter-django/pull/3814))
## 2022.07.27
### Updated
- Update werkzeug to 2.2.0 ([#3813](https://github.com/cookiecutter/cookiecutter-django/pull/3813))
- Update sphinx to 5.1.1 ([#3811](https://github.com/cookiecutter/cookiecutter-django/pull/3811))
- Update drf-spectacular to 0.23.1 ([#3812](https://github.com/cookiecutter/cookiecutter-django/pull/3812))
## 2022.07.26
### Changed
- Switch from `watchgod` to `watchfiles` ([#3791](https://github.com/cookiecutter/cookiecutter-django/pull/3791))
- Change Django settings file used by pylint ([#3806](https://github.com/cookiecutter/cookiecutter-django/pull/3806))
- Simplify database access in tests ([#3807](https://github.com/cookiecutter/cookiecutter-django/pull/3807))
- Provide more context when wating for PostgreSQL takes too long ([#3782](https://github.com/cookiecutter/cookiecutter-django/pull/3782))
### Updated
- Update django-compressor to 4.0 ([#3802](https://github.com/cookiecutter/cookiecutter-django/pull/3802))
- Update flake8-isort to 4.1.2.post0 ([#3809](https://github.com/cookiecutter/cookiecutter-django/pull/3809))
- Update sphinx to 5.1.0 ([#3808](https://github.com/cookiecutter/cookiecutter-django/pull/3808))
- Update sh to 1.14.3 ([#3798](https://github.com/cookiecutter/cookiecutter-django/pull/3798))
- Auto-update pre-commit hooks ([#3780](https://github.com/cookiecutter/cookiecutter-django/pull/3780))
## 2022.07.22
### Updated
- Update pytest-sugar to 0.9.5 ([#3800](https://github.com/cookiecutter/cookiecutter-django/pull/3800))
- Update sphinx to 5.0.2 ([#3801](https://github.com/cookiecutter/cookiecutter-django/pull/3801))
- Update pillow to 9.2.0 ([#3799](https://github.com/cookiecutter/cookiecutter-django/pull/3799))
- Update werkzeug to 2.1.2 ([#3797](https://github.com/cookiecutter/cookiecutter-django/pull/3797))
## 2022.07.21
### Changed
- Set user to form instance in update user view test ([#3776](https://github.com/cookiecutter/cookiecutter-django/pull/3776))
- Fix warning from django-coverage-plugin in tests ([#3790](https://github.com/cookiecutter/cookiecutter-django/pull/3790))
- Always use `const` instead of `var` in `gulpfile.js` ([#3786](https://github.com/cookiecutter/cookiecutter-django/pull/3786))
### Updated
- Update flower to 1.1.0 ([#3796](https://github.com/cookiecutter/cookiecutter-django/pull/3796))
- Update coverage to 6.4.2 ([#3783](https://github.com/cookiecutter/cookiecutter-django/pull/3783))
- Update mypy to 0.971 ([#3788](https://github.com/cookiecutter/cookiecutter-django/pull/3788))
- Update sentry-sdk to 1.8.0 ([#3792](https://github.com/cookiecutter/cookiecutter-django/pull/3792))
- Update pre-commit to 2.20.0 ([#3779](https://github.com/cookiecutter/cookiecutter-django/pull/3779))
- Update django-extensions to 3.2.0 ([#3774](https://github.com/cookiecutter/cookiecutter-django/pull/3774))
- Update tox to 3.25.1 ([#3767](https://github.com/cookiecutter/cookiecutter-django/pull/3767))
- Update uvicorn to 0.18.2 ([#3762](https://github.com/cookiecutter/cookiecutter-django/pull/3762))
- Update redis to 4.3.4 ([#3763](https://github.com/cookiecutter/cookiecutter-django/pull/3763))
- Update requests to 2.28.1 ([#3766](https://github.com/cookiecutter/cookiecutter-django/pull/3766))
## 2022.07.10
### Changed

View File

@ -1006,6 +1006,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>jugglinmike</td>
<td>
<a href="https://github.com/jugglinmike">jugglinmike</a>
</td>
<td></td>
</tr>
<tr>
<td>Jules Cheron</td>
<td>
@ -1202,6 +1209,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>Marcio Mazza</td>
<td>
<a href="https://github.com/marciomazza">marciomazza</a>
</td>
<td>marciomazza</td>
</tr>
<tr>
<td>Martin Blech</td>
<td>
@ -1335,6 +1349,13 @@ Listed in alphabetical order.
</td>
<td></td>
</tr>
<tr>
<td>monosans</td>
<td>
<a href="https://github.com/monosans">monosans</a>
</td>
<td></td>
</tr>
<tr>
<td>mozillazg</td>
<td>
@ -1363,6 +1384,13 @@ Listed in alphabetical order.
</td>
<td>moby_dick91</td>
</tr>
<tr>
<td>Nikita Sobolev</td>
<td>
<a href="https://github.com/sobolevn">sobolevn</a>
</td>
<td></td>
</tr>
<tr>
<td>Noah H</td>
<td>
@ -1524,6 +1552,13 @@ Listed in alphabetical order.
</td>
<td>saschalalala</td>
</tr>
<tr>
<td>Sebastian Reyes Espinosa</td>
<td>
<a href="https://github.com/sebastian-code">sebastian-code</a>
</td>
<td>sebastianreyese</td>
</tr>
<tr>
<td>Simon Rey</td>
<td>

View File

@ -232,6 +232,7 @@ experience better.
## Articles
- [Cookiecutter Django With Amazon RDS](https://haseeburrehman.com/posts/cookiecutter-django-with-amazon-rds/) - Apr, 2, 2021
- [Using cookiecutter-django with Google Cloud Storage](https://ahhda.github.io/cloud/gce/django/2019/03/12/using-django-cookiecutter-cloud-storage.html) - Mar. 12, 2019
- [cookiecutter-django with Nginx, Route 53 and ELB](https://msaizar.com/blog/cookiecutter-django-nginx-route-53-and-elb/) - Feb. 12, 2018
- [cookiecutter-django and Amazon RDS](https://msaizar.com/blog/cookiecutter-django-and-amazon-rds/) - Feb. 7, 2018

View File

@ -6,7 +6,7 @@ FAQ
Why is there a django.contrib.sites directory in Cookiecutter Django?
---------------------------------------------------------------------
It is there to add a migration so you don't have to manually change the ``sites.Site`` record from ``example.com`` to whatever your domain is. Instead, your ``{{cookiecutter.domain_name}}`` and {{cookiecutter.project_name}} value is placed by **Cookiecutter** in the domain and name fields respectively.
It is there to add a migration so you don't have to manually change the ``sites.Site`` record from ``example.com`` to whatever your domain is. Instead, your ``{{cookiecutter.domain_name}}`` and ``{{cookiecutter.project_name}}`` value is placed by **Cookiecutter** in the domain and name fields respectively.
See `0003_set_site_domain_and_name.py`_.

View File

@ -1,2 +1,2 @@
sphinx==5.0.1
sphinx==5.1.1
sphinx-rtd-theme==1.0.0

View File

@ -1,19 +1,19 @@
cookiecutter==2.1.1
sh==1.14.2
sh==1.14.3; sys_platform != "win32"
binaryornot==0.4.4
# Code quality
# ------------------------------------------------------------------------------
black==22.6.0
black==22.8.0
isort==5.10.1
flake8==4.0.1
flake8-isort==4.1.1
pre-commit==2.19.0
flake8==5.0.4
flake8-isort==4.2.0
pre-commit==2.20.0
# Testing
# ------------------------------------------------------------------------------
tox==3.25.0
pytest==7.1.2
tox==3.25.1
pytest==7.1.3
pytest-cookies==0.6.1
pytest-instafail==0.4.2
pyyaml==6.0
@ -23,4 +23,4 @@ pyyaml==6.0
PyGithub==1.55
gitpython==3.1.27
jinja2==3.1.2
requests==2.28.0
requests==2.28.1

View File

@ -11,8 +11,9 @@ 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, Iterable, NamedTuple
from typing import TYPE_CHECKING, Any, NamedTuple
import requests
from github import Github

View File

@ -1,8 +1,8 @@
import datetime as dt
import os
import re
from collections.abc import Iterable
from pathlib import Path
from typing import Iterable
import git
import github.PullRequest

View File

@ -5,7 +5,7 @@ except ImportError:
from distutils.core import setup
# We use calendar versioning
version = "2022.07.10"
version = "2022.09.05"
with open("README.rst") as readme_file:
long_description = readme_file.read()

View File

@ -10,13 +10,13 @@ repos:
- id: check-yaml
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black
@ -26,7 +26,7 @@ repos:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
args: ["--config=setup.cfg"]

View File

@ -1,6 +1,6 @@
[MASTER]
load-plugins=pylint_django{% if cookiecutter.use_celery == "y" %}, pylint_celery{% endif %}
django-settings-module=config.settings.base
django-settings-module=config.settings.local
[FORMAT]
max-line-length=120

View File

@ -4,4 +4,4 @@ set -o errexit
set -o nounset
watchgod celery.__main__.main --args -A config.celery_app worker -l INFO
watchfiles celery.__main__.main --args '-A config.celery_app worker -l INFO'

View File

@ -16,13 +16,17 @@ if [ -z "${POSTGRES_USER}" ]; then
fi
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
postgres_ready() {
python << END
import sys
import time
import psycopg2
try:
suggest_unrecoverable_after = 30
start = time.time()
while True:
try:
psycopg2.connect(
dbname="${POSTGRES_DB}",
user="${POSTGRES_USER}",
@ -30,16 +34,16 @@ try:
host="${POSTGRES_HOST}",
port="${POSTGRES_PORT}",
)
except psycopg2.OperationalError:
sys.exit(-1)
sys.exit(0)
break
except psycopg2.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
}
until postgres_ready; do
>&2 echo 'Waiting for PostgreSQL to become available...'
sleep 1
done
>&2 echo 'PostgreSQL is available'
exec "$@"

View File

@ -25,5 +25,9 @@ PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
# DEBUGING FOR TEMPLATES
# ------------------------------------------------------------------------------
TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa F405
# Your stuff...
# ------------------------------------------------------------------------------

View File

@ -42,7 +42,7 @@ function pathsConfig(appName) {
}
}
var paths = pathsConfig()
const paths = pathsConfig()
////////////////////////////////
// Tasks
@ -50,12 +50,12 @@ var paths = pathsConfig()
// Styles autoprefixing and minification
function styles() {
var processCss = [
const processCss = [
autoprefixer(), // adds vendor prefixes
pixrem(), // add fallbacks for rem units
]
var minifyCss = [
const minifyCss = [
cssnano({ preset: 'default' }) // minify result
]
@ -104,7 +104,7 @@ function imgCompression() {
{%- if cookiecutter.use_async == 'y' -%}
// Run django server
function asyncRunServer() {
var cmd = spawn('gunicorn', [
const cmd = spawn('gunicorn', [
'config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'
], {stdio: 'inherit'}
)
@ -115,7 +115,7 @@ function asyncRunServer() {
{%- else %}
// Run django server
function runServer(cb) {
var cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'})
const cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'})
cmd.on('close', function(code) {
console.log('runServer exited with code ' + code)
cb(code)

View File

@ -1,6 +1,6 @@
import os
from collections.abc import Sequence
from pathlib import Path
from typing import Sequence
import pytest

View File

@ -1,6 +1,6 @@
pytz==2022.1 # https://github.com/stub42/pytz
pytz==2022.2.1 # https://github.com/stub42/pytz
python-slugify==6.1.2 # https://github.com/un33k/python-slugify
Pillow==9.1.1 # https://github.com/python-pillow/Pillow
Pillow==9.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.0 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
@ -12,7 +12,7 @@ argon2-cffi==21.3.0 # https://github.com/hynek/argon2_cffi
{%- if cookiecutter.use_whitenoise == 'y' %}
whitenoise==6.2.0 # https://github.com/evansd/whitenoise
{%- endif %}
redis==4.3.3 # https://github.com/redis/redis-py
redis==4.3.4 # https://github.com/redis/redis-py
{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %}
hiredis==2.0.0 # https://github.com/redis/hiredis-py
{%- endif %}
@ -20,23 +20,23 @@ hiredis==2.0.0 # https://github.com/redis/hiredis-py
celery==5.2.7 # pyup: < 6.0 # https://github.com/celery/celery
django-celery-beat==2.3.0 # https://github.com/celery/django-celery-beat
{%- if cookiecutter.use_docker == 'y' %}
flower==1.0.0 # https://github.com/mher/flower
flower==1.2.0 # https://github.com/mher/flower
{%- endif %}
{%- endif %}
{%- if cookiecutter.use_async == 'y' %}
uvicorn[standard]==0.17.6 # https://github.com/encode/uvicorn
uvicorn[standard]==0.18.3 # https://github.com/encode/uvicorn
{%- endif %}
# Django
# ------------------------------------------------------------------------------
django==3.2.14 # pyup: < 4.0 # https://www.djangoproject.com/
django==3.2.15 # pyup: < 4.0 # https://www.djangoproject.com/
django-environ==0.9.0 # https://github.com/joke2k/django-environ
django-model-utils==4.2.0 # https://github.com/jazzband/django-model-utils
django-allauth==0.51.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==1.14.0 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==0.6 # https://github.com/django-crispy-forms/crispy-bootstrap5
{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %}
django-compressor==3.1 # https://github.com/django-compressor/django-compressor
django-compressor==4.1 # https://github.com/django-compressor/django-compressor
{%- endif %}
django-redis==5.2.0 # https://github.com/jazzband/django-redis
{%- if cookiecutter.use_drf == 'y' %}
@ -44,5 +44,5 @@ django-redis==5.2.0 # https://github.com/jazzband/django-redis
djangorestframework==3.13.1 # https://github.com/encode/django-rest-framework
django-cors-headers==3.13.0 # https://github.com/adamchainz/django-cors-headers
# DRF-spectacular for api documentation
drf-spectacular==0.22.1 # https://github.com/tfranzel/drf-spectacular
drf-spectacular==0.23.1 # https://github.com/tfranzel/drf-spectacular
{%- endif %}

View File

@ -1,6 +1,6 @@
-r base.txt
Werkzeug[watchdog]==2.0.3 # https://github.com/pallets/werkzeug
Werkzeug[watchdog]==2.2.2 # https://github.com/pallets/werkzeug
ipdb==0.13.9 # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %}
psycopg2==2.9.3 # https://github.com/psycopg/psycopg2
@ -8,41 +8,41 @@ psycopg2==2.9.3 # https://github.com/psycopg/psycopg2
psycopg2-binary==2.9.3 # https://github.com/psycopg/psycopg2
{%- endif %}
{%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %}
watchgod==0.8.2 # https://github.com/samuelcolvin/watchgod
watchfiles==0.16.1 # https://github.com/samuelcolvin/watchfiles
{%- endif %}
# Testing
# ------------------------------------------------------------------------------
mypy==0.950 # https://github.com/python/mypy
mypy==0.971 # https://github.com/python/mypy
django-stubs==1.12.0 # https://github.com/typeddjango/django-stubs
pytest==7.1.2 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar
pytest==7.1.3 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.5 # https://github.com/Frozenball/pytest-sugar
{%- if cookiecutter.use_drf == "y" %}
djangorestframework-stubs==1.7.0 # https://github.com/typeddjango/djangorestframework-stubs
{%- endif %}
# Documentation
# ------------------------------------------------------------------------------
sphinx==5.0.1 # https://github.com/sphinx-doc/sphinx
sphinx==5.1.1 # https://github.com/sphinx-doc/sphinx
sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild
# Code quality
# ------------------------------------------------------------------------------
flake8==4.0.1 # https://github.com/PyCQA/flake8
flake8-isort==4.1.1 # https://github.com/gforcada/flake8-isort
coverage==6.4.1 # https://github.com/nedbat/coveragepy
black==22.6.0 # https://github.com/psf/black
flake8==5.0.4 # https://github.com/PyCQA/flake8
flake8-isort==4.2.0 # https://github.com/gforcada/flake8-isort
coverage==6.4.4 # https://github.com/nedbat/coveragepy
black==22.8.0 # https://github.com/psf/black
pylint-django==2.5.3 # https://github.com/PyCQA/pylint-django
{%- if cookiecutter.use_celery == 'y' %}
pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery
{%- endif %}
pre-commit==2.19.0 # https://github.com/pre-commit/pre-commit
pre-commit==2.20.0 # https://github.com/pre-commit/pre-commit
# Django
# ------------------------------------------------------------------------------
factory-boy==3.2.1 # https://github.com/FactoryBoy/factory_boy
django-debug-toolbar==3.5.0 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.1.5 # https://github.com/django-extensions/django-extensions
django-debug-toolbar==3.6.0 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.2.0 # https://github.com/django-extensions/django-extensions
django-coverage-plugin==2.0.3 # https://github.com/nedbat/django_coverage_plugin
pytest-django==4.5.2 # https://github.com/pytest-dev/pytest-django

View File

@ -8,7 +8,7 @@ psycopg2==2.9.3 # https://github.com/psycopg/psycopg2
Collectfast==2.2.0 # https://github.com/antonagestam/collectfast
{%- endif %}
{%- if cookiecutter.use_sentry == "y" %}
sentry-sdk==1.6.0 # https://github.com/getsentry/sentry-python
sentry-sdk==1.9.8 # https://github.com/getsentry/sentry-python
{%- endif %}
{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %}
hiredis==2.0.0 # https://github.com/redis/hiredis-py
@ -17,9 +17,9 @@ hiredis==2.0.0 # https://github.com/redis/hiredis-py
# Django
# ------------------------------------------------------------------------------
{%- if cookiecutter.cloud_provider == 'AWS' %}
django-storages[boto3]==1.12.3 # https://github.com/jschneier/django-storages
django-storages[boto3]==1.13.1 # https://github.com/jschneier/django-storages
{%- elif cookiecutter.cloud_provider == 'GCP' %}
django-storages[google]==1.12.3 # https://github.com/jschneier/django-storages
django-storages[google]==1.13.1 # https://github.com/jschneier/django-storages
{%- endif %}
{%- if cookiecutter.mail_service == 'Mailgun' %}
django-anymail[mailgun]==8.6 # https://github.com/anymail/django-anymail

View File

@ -1 +1 @@
python-3.9.9
python-3.9.13

View File

@ -10,5 +10,5 @@ def media_storage(settings, tmpdir):
@pytest.fixture
def user() -> User:
def user(db) -> User:
return UserFactory()

View File

@ -1,4 +1,5 @@
from typing import Any, Sequence
from collections.abc import Sequence
from typing import Any
from django.contrib.auth import get_user_model
from factory import Faker, post_generation

View File

@ -1,10 +1,7 @@
import pytest
from django.urls import reverse
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
class TestUserAdmin:
def test_changelist(self, admin_client):

View File

@ -1,10 +1,7 @@
import pytest
from django.urls import resolve, reverse
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
def test_user_detail(user: User):
assert (

View File

@ -1,11 +1,8 @@
import pytest
from django.test import RequestFactory
from {{ cookiecutter.project_slug }}.users.api.views import UserViewSet
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):

View File

@ -1,14 +1,11 @@
"""
Module for all Form Tests.
"""
import pytest
from django.utils.translation import gettext_lazy as _
from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
class TestUserAdminCreationForm:
"""

View File

@ -1,9 +1,5 @@
import pytest
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"

View File

@ -1,8 +1,6 @@
import pytest
from django.urls import reverse
pytestmark = pytest.mark.django_db
def test_swagger_accessible_by_admin(admin_client):
url = reverse("api-docs")
@ -10,6 +8,7 @@ def test_swagger_accessible_by_admin(admin_client):
assert response.status_code == 200
@pytest.mark.django_db
def test_swagger_ui_not_accessible_by_normal_user(client):
url = reverse("api-docs")
response = client.get(url)

View File

@ -1,10 +1,7 @@
import pytest
from django.urls import resolve, reverse
from {{ cookiecutter.project_slug }}.users.models import User
pytestmark = pytest.mark.django_db
def test_detail(user: User):
assert (

View File

@ -64,6 +64,7 @@ class TestUserUpdateView:
# Initialize the form
form = UserAdminChangeForm()
form.cleaned_data = {}
form.instance = user
view.form_valid(form)
messages_sent = [m.message for m in messages.get_messages(request)]