Merge branch 'master' into djangoissuer

# Conflicts:
#	requirements.txt
This commit is contained in:
Bruno Alla 2021-11-09 00:30:57 +00:00
commit d42d57e949
35 changed files with 670 additions and 428 deletions

View File

@ -51,7 +51,7 @@ labels: bug
Logs: Logs:
<details> <details>
<pre> <pre>
$ cookiecutter https://github.com/pydanny/cookiecutter-django $ cookiecutter https://github.com/cookiecutter/cookiecutter-django
project_name [Project Name]: ... project_name [Project Name]: ...
</pre> </pre>
</details> </details>

View File

@ -3,7 +3,7 @@ name: Paid Support Request
about: Ask Core Team members to help you out about: Ask Core Team members to help you out
--- ---
Provided your question goes beyond [regular support](https://github.com/pydanny/cookiecutter-django/issues/new?template=question.md), and/or the task at hand is of timely/high priority nature use the below information to reach out for contributors directly. Provided your question goes beyond [regular support](https://github.com/cookiecutter/cookiecutter-django/issues/new?template=question.md), and/or the task at hand is of timely/high priority nature use the below information to reach out for contributors directly.
* Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB. * Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB.

View File

@ -3,7 +3,7 @@
{%- if pulls %} {%- if pulls %}
### {{ change_type }} ### {{ change_type }}
{%- for pull_request in pulls %} {%- for pull_request in pulls %}
- {{ pull_request.title }} ([#{{ pull_request.number }}]({{ pull_request.url }})) - {{ pull_request.title }} ([#{{ pull_request.number }}]({{ pull_request.html_url }}))
{%- endfor -%} {%- endfor -%}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}

View File

@ -1137,5 +1137,35 @@
"name": "Floyd Hightower", "name": "Floyd Hightower",
"github_login": "fhightower", "github_login": "fhightower",
"twitter_username": "" "twitter_username": ""
},
{
"name": "Manjit Pardeshi",
"github_login": "Manjit2003",
"twitter_username": ""
},
{
"name": "Meraj ",
"github_login": "ichbinmeraj",
"twitter_username": "merajsafari"
},
{
"name": "dalrrard",
"github_login": "dalrrard",
"twitter_username": ""
},
{
"name": "Liam Brenner",
"github_login": "SableWalnut",
"twitter_username": ""
},
{
"name": "Noah H",
"github_login": "nthall",
"twitter_username": ""
},
{
"name": "Diego Montes",
"github_login": "d57montes",
"twitter_username": ""
} }
] ]

View File

@ -17,7 +17,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2.2.2 - uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Install dependencies - name: Install dependencies
@ -44,7 +44,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2.2.2 - uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Docker ${{ matrix.script.name }} - name: Docker ${{ matrix.script.name }}
@ -78,7 +78,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2.2.2 - uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Bare Metal ${{ matrix.script.name }} - name: Bare Metal ${{ matrix.script.name }}

View File

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2.2.2 - uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
@ -26,7 +26,7 @@ jobs:
run: pre-commit autoupdate run: pre-commit autoupdate
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v3.10.1 uses: peter-evans/create-pull-request@v3.11.0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate branch: update/pre-commit-autoupdate

View File

@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Install dependencies - name: Install dependencies
@ -28,7 +28,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes - name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4.11.0 uses: stefanzweifel/git-auto-commit-action@v4.12.0
with: with:
commit_message: Update Changelog commit_message: Update Changelog
file_pattern: CHANGELOG.md file_pattern: CHANGELOG.md

View File

@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Install dependencies - name: Install dependencies
@ -24,7 +24,7 @@ jobs:
run: python scripts/update_contributors.py run: python scripts/update_contributors.py
- name: Commit changes - name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4.11.0 uses: stefanzweifel/git-auto-commit-action@v4.12.0
with: with:
commit_message: Update Contributors commit_message: Update Contributors
file_pattern: CONTRIBUTORS.md .github/contributors.json file_pattern: CONTRIBUTORS.md .github/contributors.json

View File

@ -15,6 +15,7 @@ label_prs: update
requirements: requirements:
- "requirements.txt" - "requirements.txt"
- "docs/requirements.txt"
- "{{cookiecutter.project_slug}}/requirements/base.txt" - "{{cookiecutter.project_slug}}/requirements/base.txt"
- "{{cookiecutter.project_slug}}/requirements/local.txt" - "{{cookiecutter.project_slug}}/requirements/local.txt"
- "{{cookiecutter.project_slug}}/requirements/production.txt" - "{{cookiecutter.project_slug}}/requirements/production.txt"

15
.readthedocs.yaml Normal file
View File

@ -0,0 +1,15 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Version of Python and requirements required to build the docs
python:
version: "3.8"
install:
- requirements: docs/requirements.txt

File diff suppressed because it is too large Load Diff

View File

@ -502,6 +502,13 @@ Listed in alphabetical order.
</td> </td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>dalrrard</td>
<td>
<a href="https://github.com/dalrrard">dalrrard</a>
</td>
<td></td>
</tr>
<tr> <tr>
<td>Dan Shultz</td> <td>Dan Shultz</td>
<td> <td>
@ -607,6 +614,13 @@ Listed in alphabetical order.
</td> </td>
<td>purplediane88</td> <td>purplediane88</td>
</tr> </tr>
<tr>
<td>Diego Montes</td>
<td>
<a href="https://github.com/d57montes">d57montes</a>
</td>
<td></td>
</tr>
<tr> <tr>
<td>Dong Huynh</td> <td>Dong Huynh</td>
<td> <td>
@ -1069,6 +1083,13 @@ Listed in alphabetical order.
</td> </td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>Liam Brenner</td>
<td>
<a href="https://github.com/SableWalnut">SableWalnut</a>
</td>
<td></td>
</tr>
<tr> <tr>
<td>Lin Xianyi</td> <td>Lin Xianyi</td>
<td> <td>
@ -1104,6 +1125,13 @@ Listed in alphabetical order.
</td> </td>
<td>flyudvik</td> <td>flyudvik</td>
</tr> </tr>
<tr>
<td>Manjit Pardeshi</td>
<td>
<a href="https://github.com/Manjit2003">Manjit2003</a>
</td>
<td></td>
</tr>
<tr> <tr>
<td>Martin Blech</td> <td>Martin Blech</td>
<td> <td>
@ -1188,6 +1216,13 @@ Listed in alphabetical order.
</td> </td>
<td></td> <td></td>
</tr> </tr>
<tr>
<td>Meraj </td>
<td>
<a href="https://github.com/ichbinmeraj">ichbinmeraj</a>
</td>
<td>merajsafari</td>
</tr>
<tr> <tr>
<td>Mesut Yılmaz</td> <td>Mesut Yılmaz</td>
<td> <td>
@ -1244,6 +1279,13 @@ Listed in alphabetical order.
</td> </td>
<td>moby_dick91</td> <td>moby_dick91</td>
</tr> </tr>
<tr>
<td>Noah H</td>
<td>
<a href="https://github.com/nthall">nthall</a>
</td>
<td></td>
</tr>
<tr> <tr>
<td>Oleg Russkin</td> <td>Oleg Russkin</td>
<td> <td>

View File

@ -1,23 +1,24 @@
Cookiecutter Django Cookiecutter Django
=================== ===================
.. image:: https://img.shields.io/github/workflow/status/pydanny/cookiecutter-django/CI/master .. image:: https://img.shields.io/github/workflow/status/cookiecutter/cookiecutter-django/CI/master
:target: https://github.com/pydanny/cookiecutter-django/actions?query=workflow%3ACI :target: https://github.com/cookiecutter/cookiecutter-django/actions?query=workflow%3ACI
:alt: Build Status :alt: Build Status
.. image:: https://readthedocs.org/projects/cookiecutter-django/badge/?version=latest .. image:: https://readthedocs.org/projects/cookiecutter-django/badge/?version=latest
:target: https://cookiecutter-django.readthedocs.io/en/latest/?badge=latest :target: https://cookiecutter-django.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status :alt: Documentation Status
.. image:: https://pyup.io/repos/github/pydanny/cookiecutter-django/shield.svg .. image:: https://pyup.io/repos/github/cookiecutter/cookiecutter-django/shield.svg
:target: https://pyup.io/repos/github/pydanny/cookiecutter-django/ :target: https://pyup.io/repos/github/cookiecutter/cookiecutter-django/
:alt: Updates :alt: Updates
.. image:: https://img.shields.io/badge/cookiecutter-Join%20on%20Slack-green?style=flat&logo=slack .. image:: https://img.shields.io/badge/Discord-cookiecutter-5865F2?style=flat&logo=discord&logoColor=white
:target: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U :target: https://discord.gg/bTfDa6Zz
:alt: Join our Discord
.. image:: https://www.codetriage.com/pydanny/cookiecutter-django/badges/users.svg .. image:: https://www.codetriage.com/cookiecutter/cookiecutter-django/badges/users.svg
:target: https://www.codetriage.com/pydanny/cookiecutter-django :target: https://www.codetriage.com/cookiecutter/cookiecutter-django
:alt: Code Helpers Badge :alt: Code Helpers Badge
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
@ -34,8 +35,8 @@ production-ready Django projects quickly.
.. _Troubleshooting: https://cookiecutter-django.readthedocs.io/en/latest/troubleshooting.html .. _Troubleshooting: https://cookiecutter-django.readthedocs.io/en/latest/troubleshooting.html
.. _528: https://github.com/pydanny/cookiecutter-django/issues/528#issuecomment-212650373 .. _528: https://github.com/cookiecutter/cookiecutter-django/issues/528#issuecomment-212650373
.. _issues: https://github.com/pydanny/cookiecutter-django/issues/new .. _issues: https://github.com/cookiecutter/cookiecutter-django/issues/new
Features Features
--------- ---------
@ -145,7 +146,7 @@ First, get Cookiecutter. Trust me, it's awesome::
Now run it against this repo:: Now run it against this repo::
$ cookiecutter https://github.com/pydanny/cookiecutter-django $ cookiecutter https://github.com/cookiecutter/cookiecutter-django
You'll be prompted for some values. Provide them, then a Django project will be created for you. You'll be prompted for some values. Provide them, then a Django project will be created for you.
@ -234,7 +235,7 @@ Community
* For anything else, you can chat with us on `Slack`_. * For anything else, you can chat with us on `Slack`_.
.. _`Stack Overflow`: http://stackoverflow.com/questions/tagged/cookiecutter-django .. _`Stack Overflow`: http://stackoverflow.com/questions/tagged/cookiecutter-django
.. _`issue`: https://github.com/pydanny/cookiecutter-django/issues .. _`issue`: https://github.com/cookiecutter/cookiecutter-django/issues
.. _`Slack`: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U .. _`Slack`: https://join.slack.com/t/cookie-cutter/shared_invite/enQtNzI0Mzg5NjE5Nzk5LTRlYWI2YTZhYmQ4YmU1Y2Q2NmE1ZjkwOGM0NDQyNTIwY2M4ZTgyNDVkNjMxMDdhZGI5ZGE5YmJjM2M3ODJlY2U
For Readers of Two Scoops of Django For Readers of Two Scoops of Django
@ -257,7 +258,7 @@ Scattered throughout the Python and HTML of this project are places marked with
Releases Releases
-------- --------
Need a stable release? You can find them at https://github.com/pydanny/cookiecutter-django/releases Need a stable release? You can find them at https://github.com/cookiecutter/cookiecutter-django/releases
Not Exactly What You Want? Not Exactly What You Want?

View File

@ -18,7 +18,7 @@ Prerequisites
* Docker; if you don't have it yet, follow the `installation instructions`_; * Docker; if you don't have it yet, follow the `installation instructions`_;
* Docker Compose; refer to the official documentation for the `installation guide`_. * Docker Compose; refer to the official documentation for the `installation guide`_.
* Pre-commit; refer to the official documentation for the `installation guide`_. * Pre-commit; refer to the official documentation for the [pre-commit](https://pre-commit.com/#install).
.. _`installation instructions`: https://docs.docker.com/install/#supported-platforms .. _`installation instructions`: https://docs.docker.com/install/#supported-platforms
.. _`installation guide`: https://docs.docker.com/compose/install/ .. _`installation guide`: https://docs.docker.com/compose/install/

View File

@ -26,7 +26,7 @@ First things first.
#. Install cookiecutter-django: :: #. Install cookiecutter-django: ::
$ cookiecutter gh:pydanny/cookiecutter-django $ cookiecutter gh:cookiecutter/cookiecutter-django
#. Install development requirements: :: #. Install development requirements: ::
@ -87,7 +87,7 @@ or if you're running asynchronously: ::
.. _Redis: https://redis.io/download .. _Redis: https://redis.io/download
.. _CookieCutter: https://github.com/cookiecutter/cookiecutter .. _CookieCutter: https://github.com/cookiecutter/cookiecutter
.. _createdb: https://www.postgresql.org/docs/current/static/app-createdb.html .. _createdb: https://www.postgresql.org/docs/current/static/app-createdb.html
.. _initial PostgreSQL set up: http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html .. _initial PostgreSQL set up: http://web.archive.org/web/20190303010033/http://suite.opengeo.org/docs/latest/dataadmin/pgGettingStarted/firstconnect.html
.. _postgres documentation: https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html .. _postgres documentation: https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
.. _pre-commit: https://pre-commit.com/ .. _pre-commit: https://pre-commit.com/
.. _direnv: https://direnv.net/ .. _direnv: https://direnv.net/
@ -145,9 +145,9 @@ when developing locally. If you have the appropriate setup on your local machine
in ``config/settings/local.py``:: in ``config/settings/local.py``::
CELERY_TASK_ALWAYS_EAGER = False CELERY_TASK_ALWAYS_EAGER = False
To run Celery locally, make sure redis-server is installed (instructions are available at https://redis.io/topics/quickstart), run the server in one terminal with `redis-server`, and then start celery in another terminal with the following command:: To run Celery locally, make sure redis-server is installed (instructions are available at https://redis.io/topics/quickstart), run the server in one terminal with `redis-server`, and then start celery in another terminal with the following command::
celery -A config.celery_app worker --loglevel=info celery -A config.celery_app worker --loglevel=info

View File

@ -10,7 +10,7 @@ It is there to add a migration so you don't have to manually change the ``sites.
See `0003_set_site_domain_and_name.py`_. See `0003_set_site_domain_and_name.py`_.
.. _`0003_set_site_domain_and_name.py`: https://github.com/pydanny/cookiecutter-django/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/%7B%7Bcookiecutter.project_slug%7D%7D/contrib/sites/migrations/0003_set_site_domain_and_name.py .. _`0003_set_site_domain_and_name.py`: https://github.com/cookiecutter/cookiecutter-django/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/%7B%7Bcookiecutter.project_slug%7D%7D/contrib/sites/migrations/0003_set_site_domain_and_name.py
Why aren't you using just one configuration file (12-Factor App) Why aren't you using just one configuration file (12-Factor App)

1
docs/requirements.txt Normal file
View File

@ -0,0 +1 @@
sphinx==4.2.0

View File

@ -47,5 +47,5 @@ Others
#. New apps not getting created in project root: This is the expected behavior, because cookiecutter-django does not change the way that django startapp works, you'll have to fix this manually (see `#1725`_) #. New apps not getting created in project root: This is the expected behavior, because cookiecutter-django does not change the way that django startapp works, you'll have to fix this manually (see `#1725`_)
.. _#528: https://github.com/pydanny/cookiecutter-django/issues/528#issuecomment-212650373 .. _#528: https://github.com/cookiecutter/cookiecutter-django/issues/528#issuecomment-212650373
.. _#1725: https://github.com/pydanny/cookiecutter-django/issues/1725#issuecomment-407493176 .. _#1725: https://github.com/cookiecutter/cookiecutter-django/issues/1725#issuecomment-407493176

View File

@ -4,22 +4,22 @@ binaryornot==0.4.4
# Code quality # Code quality
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
black==21.8b0 black==21.9b0
isort==5.9.3 isort==5.10.0
flake8==3.9.2 flake8==4.0.1
flake8-isort==4.0.0 flake8-isort==4.1.1
pre-commit==2.15.0 pre-commit==2.15.0
# Testing # Testing
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
tox==3.24.3 tox==3.24.4
pytest==6.2.5 pytest==6.2.5
pytest-cookies==0.6.1 pytest-cookies==0.6.1
pytest-instafail==0.4.2 pytest-instafail==0.4.2
pyyaml==5.4.1 pyyaml==6.0
# Scripting # Scripting
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
PyGithub==1.55 PyGithub==1.55
jinja2==3.0.1 jinja2==3.0.2
requests==2.25.1 requests==2.25.1

View File

@ -39,7 +39,9 @@ def main() -> None:
def iter_pulls(): def iter_pulls():
"""Fetch merged pull requests at the date we're interested in.""" """Fetch merged pull requests at the date we're interested in."""
repo = Github(login_or_token=GITHUB_TOKEN).get_repo("pydanny/cookiecutter-django") repo = Github(login_or_token=GITHUB_TOKEN).get_repo(
"cookiecutter/cookiecutter-django"
)
recent_pulls = repo.get_pulls( recent_pulls = repo.get_pulls(
state="closed", sort="updated", direction="desc" state="closed", sort="updated", direction="desc"
).get_page(0) ).get_page(0)

View File

@ -39,7 +39,7 @@ def iter_recent_authors():
Use Github API to fetch recent authors rather than Use Github API to fetch recent authors rather than
git CLI to work with Github usernames. git CLI to work with Github usernames.
""" """
repo = Github(per_page=5).get_repo("pydanny/cookiecutter-django") repo = Github(per_page=5).get_repo("cookiecutter/cookiecutter-django")
recent_pulls = repo.get_pulls( recent_pulls = repo.get_pulls(
state="closed", sort="updated", direction="desc" state="closed", sort="updated", direction="desc"
).get_page(0) ).get_page(0)

View File

@ -27,7 +27,7 @@ setup(
long_description=long_description, long_description=long_description,
author="Daniel Roy Greenfeld", author="Daniel Roy Greenfeld",
author_email="pydanny@gmail.com", author_email="pydanny@gmail.com",
url="https://github.com/pydanny/cookiecutter-django", url="https://github.com/cookiecutter/cookiecutter-django",
packages=[], packages=[],
license="BSD", license="BSD",
zip_safe=False, zip_safe=False,

View File

@ -11,12 +11,12 @@ repos:
- id: check-yaml - id: check-yaml
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 21.8b0 rev: 21.10b0
hooks: hooks:
- id: black - id: black
- repo: https://github.com/timothycrosley/isort - repo: https://github.com/timothycrosley/isort
rev: 5.9.3 rev: 5.10.0
hooks: hooks:
- id: isort - id: isort

View File

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

View File

@ -4,7 +4,7 @@
{{cookiecutter.description}} {{cookiecutter.description}}
.. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter .. image:: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter
:target: https://github.com/pydanny/cookiecutter-django/ :target: https://github.com/cookiecutter/cookiecutter-django/
:alt: Built with Cookiecutter Django :alt: Built with Cookiecutter Django
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black :target: https://github.com/ambv/black

View File

@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.9-slim-buster ARG PYTHON_VERSION=3.9-slim-bullseye
# define an alias for the specfic python version used in this file. # define an alias for the specfic python version used in this file.
FROM python:${PYTHON_VERSION} as python FROM python:${PYTHON_VERSION} as python

View File

@ -1,4 +1,4 @@
FROM python:3.9-slim-buster FROM python:3.9-slim-bullseye
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONDONTWRITEBYTECODE 1

View File

@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.9-slim-buster ARG PYTHON_VERSION=3.9-slim-bullseye
{% if cookiecutter.js_task_runner == 'Gulp' -%} {% if cookiecutter.js_task_runner == 'Gulp' -%}
FROM node:10-stretch-slim as client-builder FROM node:10-stretch-slim as client-builder

View File

@ -4,7 +4,7 @@
# You can set these variables from the command line, and also # You can set these variables from the command line, and also
# from the environment for the first two. # from the environment for the first two.
SPHINXOPTS ?= SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build -c . SPHINXBUILD ?= sphinx-build
SOURCEDIR = . SOURCEDIR = .
BUILDDIR = ./_build BUILDDIR = ./_build
{%- if cookiecutter.use_docker == 'y' %} {%- if cookiecutter.use_docker == 'y' %}
@ -17,7 +17,7 @@ APP = ../{{cookiecutter.project_slug}}
# Put it first so that "make" without argument is like "make help". # Put it first so that "make" without argument is like "make help".
help: help:
@$(SPHINXBUILD) help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -c .
# Build, watch and serve docs with live reload # Build, watch and serve docs with live reload
livehtml: livehtml:
@ -28,13 +28,9 @@ livehtml:
# Outputs rst files from django application code # Outputs rst files from django application code
apidocs: apidocs:
{%- if cookiecutter.use_docker == 'y' %} sphinx-apidoc -o $(SOURCEDIR)/api $(APP)
sphinx-apidoc -o $(SOURCEDIR)/api /app
{%- else %}
sphinx-apidoc -o $(SOURCEDIR)/api ../{{cookiecutter.project_slug}}
{%- endif %}
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile %: Makefile
@$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -c .

View File

@ -1,6 +1,6 @@
pytz==2021.1 # https://github.com/stub42/pytz pytz==2021.3 # https://github.com/stub42/pytz
python-slugify==5.0.2 # https://github.com/un33k/python-slugify python-slugify==5.0.2 # https://github.com/un33k/python-slugify
Pillow==8.3.2 # https://github.com/python-pillow/Pillow Pillow==8.4.0 # https://github.com/python-pillow/Pillow
{%- if cookiecutter.use_compressor == "y" %} {%- if cookiecutter.use_compressor == "y" %}
{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %}
rcssmin==1.0.6 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin rcssmin==1.0.6 --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin
@ -30,10 +30,10 @@ uvicorn[standard]==0.15.0 # https://github.com/encode/uvicorn
# Django # Django
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
django==3.1.13 # pyup: < 3.2 # https://www.djangoproject.com/ django==3.1.13 # pyup: < 3.2 # https://www.djangoproject.com/
django-environ==0.7.0 # https://github.com/joke2k/django-environ django-environ==0.8.1 # https://github.com/joke2k/django-environ
django-model-utils==4.1.1 # https://github.com/jazzband/django-model-utils django-model-utils==4.2.0 # https://github.com/jazzband/django-model-utils
django-allauth==0.45.0 # https://github.com/pennersr/django-allauth django-allauth==0.45.0 # https://github.com/pennersr/django-allauth
django-crispy-forms==1.12.0 # https://github.com/django-crispy-forms/django-crispy-forms django-crispy-forms==1.13.0 # https://github.com/django-crispy-forms/django-crispy-forms
{%- if cookiecutter.use_compressor == "y" %} {%- if cookiecutter.use_compressor == "y" %}
django-compressor==2.4.1 # https://github.com/django-compressor/django-compressor django-compressor==2.4.1 # https://github.com/django-compressor/django-compressor
{%- endif %} {%- endif %}
@ -41,5 +41,5 @@ django-redis==5.0.0 # https://github.com/jazzband/django-redis
{%- if cookiecutter.use_drf == "y" %} {%- if cookiecutter.use_drf == "y" %}
# Django REST Framework # Django REST Framework
djangorestframework==3.12.4 # https://github.com/encode/django-rest-framework djangorestframework==3.12.4 # https://github.com/encode/django-rest-framework
django-cors-headers==3.8.0 # https://github.com/adamchainz/django-cors-headers django-cors-headers==3.10.0 # https://github.com/adamchainz/django-cors-headers
{%- endif %} {%- endif %}

View File

@ -1,6 +1,6 @@
-r base.txt -r base.txt
Werkzeug==1.0.1 # https://github.com/pallets/werkzeug Werkzeug==2.0.2 # https://github.com/pallets/werkzeug
ipdb==0.13.9 # https://github.com/gotcha/ipdb ipdb==0.13.9 # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %} {%- if cookiecutter.use_docker == 'y' %}
psycopg2==2.9.1 # https://github.com/psycopg/psycopg2 psycopg2==2.9.1 # https://github.com/psycopg/psycopg2
@ -17,18 +17,21 @@ mypy==0.910 # https://github.com/python/mypy
django-stubs==1.8.0 # https://github.com/typeddjango/django-stubs django-stubs==1.8.0 # https://github.com/typeddjango/django-stubs
pytest==6.2.5 # https://github.com/pytest-dev/pytest pytest==6.2.5 # https://github.com/pytest-dev/pytest
pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar pytest-sugar==0.9.4 # https://github.com/Frozenball/pytest-sugar
{%- if cookiecutter.use_drf == "y" %}
djangorestframework-stubs==1.4.0 # https://github.com/typeddjango/djangorestframework-stubs
{%- endif %}
# Documentation # Documentation
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
sphinx==4.1.2 # https://github.com/sphinx-doc/sphinx sphinx==4.2.0 # https://github.com/sphinx-doc/sphinx
sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild
# Code quality # Code quality
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
flake8==3.9.2 # https://github.com/PyCQA/flake8 flake8==4.0.1 # https://github.com/PyCQA/flake8
flake8-isort==4.0.0 # https://github.com/gforcada/flake8-isort flake8-isort==4.1.1 # https://github.com/gforcada/flake8-isort
coverage==5.5 # https://github.com/nedbat/coveragepy coverage==6.1.1 # https://github.com/nedbat/coveragepy
black==21.8b0 # https://github.com/psf/black black==21.9b0 # https://github.com/psf/black
pylint-django==2.4.4 # https://github.com/PyCQA/pylint-django pylint-django==2.4.4 # https://github.com/PyCQA/pylint-django
{%- if cookiecutter.use_celery == 'y' %} {%- if cookiecutter.use_celery == 'y' %}
pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery
@ -37,9 +40,9 @@ pre-commit==2.15.0 # https://github.com/pre-commit/pre-commit
# Django # Django
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
factory-boy==3.2.0 # https://github.com/FactoryBoy/factory_boy factory-boy==3.2.1 # https://github.com/FactoryBoy/factory_boy
django-debug-toolbar==3.2.2 # https://github.com/jazzband/django-debug-toolbar django-debug-toolbar==3.2.2 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.1.3 # https://github.com/django-extensions/django-extensions django-extensions==3.1.5 # https://github.com/django-extensions/django-extensions
django-coverage-plugin==2.0.0 # https://github.com/nedbat/django_coverage_plugin django-coverage-plugin==2.0.1 # https://github.com/nedbat/django_coverage_plugin
pytest-django==4.4.0 # https://github.com/pytest-dev/pytest-django pytest-django==4.4.0 # https://github.com/pytest-dev/pytest-django

View File

@ -8,7 +8,7 @@ psycopg2==2.9.1 # https://github.com/psycopg/psycopg2
Collectfast==2.2.0 # https://github.com/antonagestam/collectfast Collectfast==2.2.0 # https://github.com/antonagestam/collectfast
{%- endif %} {%- endif %}
{%- if cookiecutter.use_sentry == "y" %} {%- if cookiecutter.use_sentry == "y" %}
sentry-sdk==1.3.1 # https://github.com/getsentry/sentry-python sentry-sdk==1.4.3 # https://github.com/getsentry/sentry-python
{%- endif %} {%- endif %}
{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %}
hiredis==2.0.0 # https://github.com/redis/hiredis-py 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 # Django
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
{%- if cookiecutter.cloud_provider == 'AWS' %} {%- if cookiecutter.cloud_provider == 'AWS' %}
django-storages[boto3]==1.11.1 # https://github.com/jschneier/django-storages django-storages[boto3]==1.12.3 # https://github.com/jschneier/django-storages
{%- elif cookiecutter.cloud_provider == 'GCP' %} {%- elif cookiecutter.cloud_provider == 'GCP' %}
django-storages[google]==1.11.1 # https://github.com/jschneier/django-storages django-storages[google]==1.12.3 # https://github.com/jschneier/django-storages
{%- endif %} {%- endif %}
{%- if cookiecutter.mail_service == 'Mailgun' %} {%- if cookiecutter.mail_service == 'Mailgun' %}
django-anymail[mailgun]==8.4 # https://github.com/anymail/django-anymail django-anymail[mailgun]==8.4 # https://github.com/anymail/django-anymail

View File

@ -24,7 +24,7 @@ ignore_missing_imports = True
warn_unused_ignores = True warn_unused_ignores = True
warn_redundant_casts = True warn_redundant_casts = True
warn_unused_configs = True warn_unused_configs = True
plugins = mypy_django_plugin.main plugins = mypy_django_plugin.main{% if cookiecutter.use_drf == "y" %}, mypy_drf_plugin.main{% endif %}
[mypy.plugins.django-stubs] [mypy.plugins.django-stubs]
django_settings_module = config.settings.test django_settings_module = config.settings.test

View File

@ -0,0 +1,23 @@
##basic build dependencies of various Django apps for Debian Bullseye 11.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 psycopg2 dependencies
libpq-dev
##Pillow dependencies
libtiff5-dev
libjpeg62-turbo-dev
libfreetype6-dev
liblcms2-dev
libwebp-dev
##django-extensions
libgraphviz-dev

View File

@ -16,6 +16,7 @@ class UserViewSet(RetrieveModelMixin, ListModelMixin, UpdateModelMixin, GenericV
lookup_field = "username" lookup_field = "username"
def get_queryset(self, *args, **kwargs): def get_queryset(self, *args, **kwargs):
assert isinstance(self.request.user.id, int)
return self.queryset.filter(id=self.request.user.id) return self.queryset.filter(id=self.request.user.id)
@action(detail=False, methods=["GET"]) @action(detail=False, methods=["GET"])