diff --git a/.github/contributors.json b/.github/contributors.json index 057309a52..b47a56246 100644 --- a/.github/contributors.json +++ b/.github/contributors.json @@ -1523,5 +1523,20 @@ "name": "Paul Wulff", "github_login": "mtmpaulwulff", "twitter_username": "" + }, + { + "name": "Mounir", + "github_login": "mounirmesselmeni", + "twitter_username": "" + }, + { + "name": "JAEGYUN JUNG", + "github_login": "TGoddessana", + "twitter_username": "" + }, + { + "name": "Simeon Emanuilov", + "github_login": "s-emanuilov", + "twitter_username": "s_emanuilov" } ] \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e6590469a..3582a2125 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,6 +3,22 @@ version: 2 updates: + # Update Python deps for the template (not the generated project) + - package-ecosystem: "pip" + 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: "/" diff --git a/.pyup.yml b/.pyup.yml index e5d4752e4..13d336d57 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -14,8 +14,6 @@ pin: True label_prs: update requirements: - - "requirements.txt" - - "docs/requirements.txt" - "{{cookiecutter.project_slug}}/requirements/base.txt" - "{{cookiecutter.project_slug}}/requirements/local.txt" - "{{cookiecutter.project_slug}}/requirements/production.txt" diff --git a/CHANGELOG.md b/CHANGELOG.md index b8ad3f6bf..8cf537eb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,78 @@ All enhancements and patches to Cookiecutter Django will be documented in this f +## 2024.03.03 + + +### Updated + +- Update django-celery-beat to 2.6.0 ([#4899](https://github.com/cookiecutter/cookiecutter-django/pull/4899)) + +## 2024.03.01 + + +### Changed + +- Add a maintainer guide to the docs ([#4884](https://github.com/cookiecutter/cookiecutter-django/pull/4884)) + +### Updated + +- Auto-update pre-commit hooks ([#4897](https://github.com/cookiecutter/cookiecutter-django/pull/4897)) + +- Update ruff to 0.3.0 ([#4896](https://github.com/cookiecutter/cookiecutter-django/pull/4896)) + +## 2024.02.28 + + +### Fixed + +- Fix invalid HTML in django-allauth field element template ([#4894](https://github.com/cookiecutter/cookiecutter-django/pull/4894)) + +- Fix permissions for media files when served by nginx ([#4889](https://github.com/cookiecutter/cookiecutter-django/pull/4889)) + +### Documentation + +- Fix broken "Two scoops of django" link in FAQ ([#4892](https://github.com/cookiecutter/cookiecutter-django/pull/4892)) + +### Updated + +- Update redis to 5.0.2 ([#4895](https://github.com/cookiecutter/cookiecutter-django/pull/4895)) + +- Update sentry-sdk to 1.40.6 ([#4893](https://github.com/cookiecutter/cookiecutter-django/pull/4893)) + +## 2024.02.26 + + +### Changed + +- Allauth elements & MFA ([#4843](https://github.com/cookiecutter/cookiecutter-django/pull/4843)) + +### Updated + +- Update pytest to 8.0.2 ([#4890](https://github.com/cookiecutter/cookiecutter-django/pull/4890)) + +- Update crispy-bootstrap5 to 2024.2 ([#4891](https://github.com/cookiecutter/cookiecutter-django/pull/4891)) + +## 2024.02.24 + + +### Updated + +- Update coverage to 7.4.3 ([#4888](https://github.com/cookiecutter/cookiecutter-django/pull/4888)) + +## 2024.02.23 + + +### Changed + +- Switch to local imports within app ([#4883](https://github.com/cookiecutter/cookiecutter-django/pull/4883)) + +- Install ruff extension in `devcontainer.json` ([#4887](https://github.com/cookiecutter/cookiecutter-django/pull/4887)) + +### Updated + +- Bump webpack-dev-server to 5.0.2 ([#4875](https://github.com/cookiecutter/cookiecutter-django/pull/4875)) + ## 2024.02.21 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 734900362..c14c0ea3b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1048,6 +1048,13 @@ Listed in alphabetical order. + + JAEGYUN JUNG + + TGoddessana + + + Jakub Boukal @@ -1552,6 +1559,13 @@ Listed in alphabetical order. + + Mounir + + mounirmesselmeni + + + mozillazg @@ -1832,6 +1846,13 @@ Listed in alphabetical order. shywn_mrk + + Simeon Emanuilov + + s-emanuilov + + s_emanuilov + Simon Rey diff --git a/docs/faq.rst b/docs/faq.rst index 52a99467c..9f0b52a7d 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -22,6 +22,6 @@ TODO Why doesn't this follow the layout from Two Scoops of Django? ------------------------------------------------------------- -You may notice that some elements of this project do not exactly match what we describe in chapter 3 of `Two Scoops of Django 1.11`_. The reason for that is this project, amongst other things, serves as a test bed for trying out new ideas and concepts. Sometimes they work, sometimes they don't, but the end result is that it won't necessarily match precisely what is described in the book I co-authored. +You may notice that some elements of this project do not exactly match what we describe in chapter 3 of `Two Scoops of Django 3.x`_. The reason for that is this project, amongst other things, serves as a test bed for trying out new ideas and concepts. Sometimes they work, sometimes they don't, but the end result is that it won't necessarily match precisely what is described in the book I co-authored. -.. _Two Scoops of Django 1.11: https://www.feldroy.com/collections/django/products/two-scoops-of-django-1-11 +.. _Two Scoops of Django 3.x: https://www.feldroy.com/books/two-scoops-of-django-3-x diff --git a/docs/index.rst b/docs/index.rst index da5186487..70daa1852 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -28,6 +28,7 @@ Contents faq troubleshooting contributing + maintainer-guide Indices and tables ------------------ diff --git a/docs/maintainer-guide.md b/docs/maintainer-guide.md new file mode 100644 index 000000000..9baac688a --- /dev/null +++ b/docs/maintainer-guide.md @@ -0,0 +1,104 @@ +# Maintainer guide + +This document is intended for maintainers of the template. + +## Automated updates + +We use 2 separate services to keep our dependencies up-to-date: + +- Dependabot, which manages updates of Python deps of the template, GitHub actions, npm packages and Docker images. +- PyUp, which manages the Python deps for the generated project. + +We don't use Dependabot for the generated project deps because our requirements files are templated, and Dependabot fails to parse them. PyUp is -AFAIK- the only service out there that supports having Jinja tags in the requirements file. + +Updates for the template should be labelled as `project infrastructure` while the ones about the generated project should be labelled as `update`. This is use to work in conjunction with our changelog script (see later). + +## Automation scripts + +We have a few workflows which have been automated over time. They usually run using GitHub actions and might need a few small manual actions to work nicely. Some have a few limitations which we should document here. + +### CI + +`ci.yml` + +The CI workflow tries to cover 2 main aspects of the template: + +- Check all combinations to make sure that valid files are generated with no major linting issues. Issues which are fixed by an auto-formatter after generation aren't considered major, and only aim for best effort. This is under the `test` job. +- Run more in-depth tests on a few combinations, by installing dependencies, running type checker and the test suite of the generated project. We try to cover docker (`docker` job) and non-docker (`bare` job) setups. + +We also run the deployment checks, but we don't do much more beyond that for testing the production setup. + +### Django issue checker + +`django-issue-checker.yml` + +This workflow runs daily, on schedule, and checks if there is a new major version of Django (not in the pure SemVer sense) released that we are not running, and list our dependencies compatibility. + +For example, at time of writing, we use Django 4.2, but the latest version of Django is 5.0, so the workflow created a ["Django 5.0" issue](https://github.com/cookiecutter/cookiecutter-django/issues/4724) in GitHub, with a compatibility table and keeps it up to date every day. + +#### Limitations + +Here are a few current and past limitations of the script + +- When a new dependency is added to the template, the script fails to update an existing issue +- Not sure what happens when a deps is removed +- ~~Unable to parse classifiers without minor version~~ +- ~~Creates an issue even if we are on the latest version~~ + +### Issue manager + +`issue-manager.yml` + +A workflow that uses [Sebastian Ramirez' issue-manager](https://github.com/tiangolo/issue-manager) to help us automate issue management. The tag line from the repo explains it well: + +> Automatically close issues or Pull Requests that have a label, after a custom delay, if no one replies back. + +It runs on a schedule as well as when some actions are taken on issues and pull requests. + +We wait 10 days before closing issues, and we have a few customised reasons, which are configured in the workflow itself. The config should be fairly self-explanatory. + +### Pre-commit auto-update + +`pre-commit-autoupdate.yml` + +Run daily, to do `pre-commit autoupdate` on the template as well as the generated project, and opens a pull request with the changes. + +#### Limitations + +- The PR is open as GitHub action which means that CI does NOT run. The documentation for create-pull-request action [explains why](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs). +- Some hooks are also installed as local dependencies (via `requirements/local.txt`), but these are updated separately via PyUP. + +### Update changelog + +`update-changelog.yml` + +Run daily at 2AM to update our changelog and create a GitHub release. This runs a custom script which: + +- List all pull requests merged the day before +- The release name is calendar based, so `YYYY.MM.DD` +- For each PR: + - Get the PR title to summarize the change + - Look at the PR labels to classify it in a section of the release notes: + - anything labelled `project infrastructure` is excluded + - label `update` goes in section "Updated" + - label `bug` goes in section "Fixed" + - label `docs` goes in section "Documentation" + - Default to section "Changed" + +With that in mind, when merging changes, it's a good idea to set the labels and rename the PR title to give a good summary of the change, in the context of the changelog. + +#### Limitations + +- Dependabot updates for npm & Docker have a verbose title, try to rename them to be more readable: `Bump webpack-dev-server from 4.15.1 to 5.0.2 in /{{cookiecutter.project_slug}}` -> `Bump webpack-dev-server to 5.0.2` +- ~~Dependencies updates for the template repo (tox, cookiecutter, etc...) don't need to appear in changelog, and need to be labelled as `project infrastructure` manually. By default, they come from PyUp labelled as `update`.~~ + +### Update contributors + +`update-contributors.yml` + +Runs on each push to master branch. List the 5 most recently merged pull requests and extract their author. If any of the authors is a new one, updates the `.github/contributors.json`, regenerate the `CONTRIBUTORS.md` from it, and push back the changes to master. + +#### Limitations + +- If you merge a pull request from a new contributor, and merge another one right after, the push to master will fail as the remote will be out of date. +- If you merge more than 5 pull requests in a row like this, the new contributor might fail to be added. diff --git a/requirements.txt b/requirements.txt index 138744a26..4fcc7bb8c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ binaryornot==0.4.4 # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.2 +ruff==0.3.0 django-upgrade==1.16.0 djlint==1.34.1 pre-commit==3.6.2 @@ -12,7 +12,7 @@ pre-commit==3.6.2 # Testing # ------------------------------------------------------------------------------ tox==4.13.0 -pytest==8.0.1 +pytest==8.1.0 pytest-xdist==3.5.0 pytest-cookies==0.7.0 pytest-instafail==0.5.0 diff --git a/scripts/update_contributors.py b/scripts/update_contributors.py index 09a7082c0..7f7b48d76 100644 --- a/scripts/update_contributors.py +++ b/scripts/update_contributors.py @@ -40,8 +40,8 @@ def iter_recent_authors(): """ Fetch users who opened recently merged pull requests. - Use Github API to fetch recent authors rather than - git CLI to work with Github usernames. + Use GitHub API to fetch recent authors rather than + git CLI to work with GitHub usernames. """ repo = Github(login_or_token=GITHUB_TOKEN, per_page=5).get_repo(GITHUB_REPO) recent_pulls = repo.get_pulls(state="closed", sort="updated", direction="desc").get_page(0) diff --git a/setup.py b/setup.py index 62b38573d..6e1ea0727 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: from distutils.core import setup # We use calendar versioning -version = "2024.02.21" +version = "2024.03.03" with open("README.md") as readme_file: long_description = readme_file.read() diff --git a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json index 7fcd62872..e16d06a20 100644 --- a/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json +++ b/{{cookiecutter.project_slug}}/.devcontainer/devcontainer.json @@ -35,7 +35,7 @@ "analysis.typeCheckingMode": "basic", "defaultInterpreterPath": "/usr/local/bin/python", "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "always" }, "editor.defaultFormatter": "charliermarsh.ruff", "languageServer": "Pylance", @@ -54,8 +54,7 @@ // python "ms-python.python", "ms-python.vscode-pylance", - "ms-python.isort", - "ms-python.black-formatter", + "charliermarsh.ruff", // django "batisteo.vscode-django" ] diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 1d06c042f..d95f5390d 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: # Run the Ruff linter. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 + rev: v0.3.0 hooks: # Linter - id: ruff diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index fb7fec50f..8c000016a 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -117,7 +117,7 @@ COPY --chown=django:django . ${APP_HOME} {%- endif %} # make django owner of the WORKDIR directory as well. -RUN chown django:django ${APP_HOME} +RUN chown -R django:django ${APP_HOME} USER django diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 55a064e74..b7eb7e80f 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -84,6 +84,7 @@ THIRD_PARTY_APPS = [ "crispy_bootstrap5", "allauth", "allauth.account", + "allauth.mfa", "allauth.socialaccount", {%- if cookiecutter.use_celery == 'y' %} "django_celery_beat", diff --git a/{{cookiecutter.project_slug}}/package.json b/{{cookiecutter.project_slug}}/package.json index efa2136e5..9ca728208 100644 --- a/{{cookiecutter.project_slug}}/package.json +++ b/{{cookiecutter.project_slug}}/package.json @@ -31,7 +31,7 @@ "webpack": "^5.65.0", "webpack-bundle-tracker": "^3.0.1", "webpack-cli": "^5.0.1", - "webpack-dev-server": "^4.6.0", + "webpack-dev-server": "^5.0.2", "webpack-merge": "^5.8.0" }, "engines": { diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index f090018ef..3aad4c947 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -11,13 +11,13 @@ argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==6.6.0 # https://github.com/evansd/whitenoise {%- endif %} -redis==5.0.1 # https://github.com/redis/redis-py +redis==5.0.2 # https://github.com/redis/redis-py {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py {%- endif %} {%- if cookiecutter.use_celery == "y" %} celery==5.3.6 # pyup: < 6.0 # https://github.com/celery/celery -django-celery-beat==2.5.0 # https://github.com/celery/django-celery-beat +django-celery-beat==2.6.0 # https://github.com/celery/django-celery-beat {%- if cookiecutter.use_docker == 'y' %} flower==2.0.1 # https://github.com/mher/flower {%- endif %} @@ -28,12 +28,12 @@ uvicorn[standard]==0.27.1 # https://github.com/encode/uvicorn # Django # ------------------------------------------------------------------------------ -django==4.2.10 # pyup: < 5.0 # https://www.djangoproject.com/ +django==4.2.11 # pyup: < 5.0 # https://www.djangoproject.com/ django-environ==0.11.2 # https://github.com/joke2k/django-environ django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils -django-allauth==0.61.1 # https://github.com/pennersr/django-allauth +django-allauth[mfa]==0.61.1 # https://github.com/pennersr/django-allauth django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms -crispy-bootstrap5==2023.10 # https://github.com/django-crispy-forms/crispy-bootstrap5 +crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5 {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} django-compressor==4.4 # https://github.com/django-compressor/django-compressor {%- endif %} diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 8225dab0f..4acd2c4dd 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -15,7 +15,7 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles # ------------------------------------------------------------------------------ mypy==1.7.1 # https://github.com/python/mypy django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs -pytest==8.0.1 # https://github.com/pytest-dev/pytest +pytest==8.1.0 # https://github.com/pytest-dev/pytest pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddjango/djangorestframework-stubs @@ -28,8 +28,8 @@ sphinx-autobuild==2024.2.4 # https://github.com/GaretJax/sphinx-autobuild # Code quality # ------------------------------------------------------------------------------ -ruff==0.2.2 # https://github.com/astral-sh/ruff -coverage==7.4.1 # https://github.com/nedbat/coveragepy +ruff==0.3.0 # https://github.com/astral-sh/ruff +coverage==7.4.3 # https://github.com/nedbat/coveragepy djlint==1.34.1 # https://github.com/Riverside-Healthcare/djLint pre-commit==3.6.2 # https://github.com/pre-commit/pre-commit diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index 4d96e86e1..d813a8fc4 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -8,7 +8,7 @@ psycopg[c]==3.1.18 # https://github.com/psycopg/psycopg Collectfast==2.2.0 # https://github.com/antonagestam/collectfast {%- endif %} {%- if cookiecutter.use_sentry == "y" %} -sentry-sdk==1.40.5 # https://github.com/getsentry/sentry-python +sentry-sdk==1.40.6 # https://github.com/getsentry/sentry-python {%- endif %} {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} hiredis==2.3.2 # https://github.com/redis/hiredis-py diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 1f79d441f..cf3b80423 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -python-3.11.7 +python-3.11.8 diff --git a/{{cookiecutter.project_slug}}/webpack/dev.config.js b/{{cookiecutter.project_slug}}/webpack/dev.config.js index 8276c3489..7c774185e 100644 --- a/{{cookiecutter.project_slug}}/webpack/dev.config.js +++ b/{{cookiecutter.project_slug}}/webpack/dev.config.js @@ -6,13 +6,16 @@ module.exports = merge(commonConfig, { devtool: 'inline-source-map', devServer: { port: 3000, - proxy: { - {%- if cookiecutter.use_docker == 'n' %} - '/': 'http://0.0.0.0:8000', - {%- else %} - '/': 'http://django:8000', - {%- endif %} - }, + proxy: [ + { + context: ['/'], + {%- if cookiecutter.use_docker == 'n' %} + target: 'http://0.0.0.0:8000', + {%- else %} + target: 'http://django:8000', + {%- endif %} + }, + ], client: { overlay: { errors: true, diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html deleted file mode 100644 index a9112cf09..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/account_inactive.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Account Inactive" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Account Inactive" %}

-

{% translate "This account is inactive." %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html deleted file mode 100644 index 057618257..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base.html +++ /dev/null @@ -1,14 +0,0 @@ -{% raw %}{% extends "base.html" %} - -{% block title %} - {% block head_title %} - {% endblock head_title %} -{% endblock title %} -{% block content %} -
-
- {% block inner %}{% endblock inner %} -
-
-{% endblock content %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html new file mode 100644 index 000000000..515f5244a --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/base_manage_password.html @@ -0,0 +1,11 @@ +{% raw %}{% extends "account/base_manage.html" %} + +{% block main %} +
+
+ {% block content %} + {% endblock content %} +
+
+{% endblock main %}{% endraw %} + diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html deleted file mode 100644 index 37770f00c..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email.html +++ /dev/null @@ -1,80 +0,0 @@ -{% raw %} -{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Account" %} -{% endblock head_title %} -{% block inner %} -

{% translate "E-mail Addresses" %}

- {% if user.emailaddress_set.all %} -

{% translate "The following e-mail addresses are associated with your account:" %}

-
- {% csrf_token %} -
- {% for emailaddress in user.emailaddress_set.all %} -
- -
- {% endfor %} -
- - - -
-
-
- {% else %} -

- {% translate "Warning:" %} {% translate "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %} -

- {% endif %} -

{% translate "Add E-mail Address" %}

-
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock inner %} -{% block inline_javascript %} - {{ block.super }} - -{% endblock inline_javascript %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html deleted file mode 100644 index 40ca4a47b..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/email_confirm.html +++ /dev/null @@ -1,28 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} - -{% block head_title %} - {% translate "Confirm E-mail Address" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Confirm E-mail Address" %}

- {% if confirmation %} - {% user_display confirmation.email_address.user as user_display %} -

- {% blocktranslate with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktranslate %} -

-
- {% csrf_token %} - -
- {% else %} - {% url 'account_email' as email_url %} -

- {% blocktranslate %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktranslate %} -

- {% endif %} -{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html deleted file mode 100644 index 5737afc06..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/login.html +++ /dev/null @@ -1,53 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account socialaccount %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Sign In" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign In" %}

- {% get_providers as socialaccount_providers %} - {% if socialaccount_providers %} -

- {% translate "Please sign in with one of your existing third party accounts:" %} - {% if ACCOUNT_ALLOW_REGISTRATION %} - {% blocktranslate trimmed %} - Or, sign up - for a {{ site_name }} account and sign in below: - {% endblocktranslate %} - {% endif %} -

-
- -
{% translate "or" %}
-
- {% include "socialaccount/snippets/login_extra.html" %} - {% else %} - {% if ACCOUNT_ALLOW_REGISTRATION %} -

- {% blocktranslate trimmed %} - If you have not created an account yet, then please - sign up first. - {% endblocktranslate %} -

- {% endif %} - {% endif %} -
- {% csrf_token %} - {{ form|crispy }} - {% if redirect_field_value %} - - {% endif %} - {% translate "Forgot Password?" %} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html deleted file mode 100644 index 43ae9ed38..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/logout.html +++ /dev/null @@ -1,21 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Sign Out" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign Out" %}

-

{% translate "Are you sure you want to sign out?" %}

-
- {% csrf_token %} - {% if redirect_field_value %} - - {% endif %} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html deleted file mode 100644 index 2e6110d5d..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_change.html +++ /dev/null @@ -1,19 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Change Password" %}

-
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html deleted file mode 100644 index 0c184269a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset.html +++ /dev/null @@ -1,29 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Password Reset" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Password Reset" %}

- {% if user.is_authenticated %} - {% include "account/snippets/already_logged_in.html" %} - {% endif %} -

- {% translate "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %} -

-
- {% csrf_token %} - {{ form|crispy }} - -
-

{% blocktranslate %}Please contact us if you have any trouble resetting your password.{% endblocktranslate %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html deleted file mode 100644 index a596425bb..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_done.html +++ /dev/null @@ -1,18 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load account %} - -{% block head_title %} - {% translate "Password Reset" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Password Reset" %}

- {% if user.is_authenticated %} - {% include "account/snippets/already_logged_in.html" %} - {% endif %} -

- {% blocktranslate %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} -

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html deleted file mode 100644 index a958ba089..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key.html +++ /dev/null @@ -1,37 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -

- {% if token_fail %} - {% translate "Bad Token" %} - {% else %} - {% translate "Change Password" %} - {% endif %} -

- {% if token_fail %} - {% url 'account_reset_password' as passwd_reset_url %} -

- {% blocktranslate %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktranslate %} -

- {% else %} - {% if form %} -
- {% csrf_token %} - {{ form|crispy }} - -
- {% else %} -

{% translate "Your password is now changed." %}

- {% endif %} - {% endif %} -{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html deleted file mode 100644 index ee399b404..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_reset_from_key_done.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Change Password" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Change Password" %}

-

{% translate "Your password is now changed." %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html deleted file mode 100644 index 3efc30874..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/password_set.html +++ /dev/null @@ -1,22 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Set Password" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Set Password" %}

-
- {% csrf_token %} - {{ form|crispy }} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html deleted file mode 100644 index 54150a474..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup.html +++ /dev/null @@ -1,28 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} -{% load crispy_forms_tags %} - -{% block head_title %} - {% translate "Signup" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign Up" %}

-

- {% blocktranslate %}Already have an account? Then please sign in.{% endblocktranslate %} -

-
- {% csrf_token %} - {{ form|crispy }} - {% if redirect_field_value %} - - {% endif %} - -
-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html deleted file mode 100644 index b3472ed6d..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/signup_closed.html +++ /dev/null @@ -1,12 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Sign Up Closed" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Sign Up Closed" %}

-

{% translate "We are sorry, but the sign up is currently closed." %}

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html deleted file mode 100644 index d71bbc41a..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verification_sent.html +++ /dev/null @@ -1,14 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Verify Your E-mail Address" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Verify Your E-mail Address" %}

-

- {% blocktranslate %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktranslate %} -

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html deleted file mode 100644 index b736581ce..000000000 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/account/verified_email_required.html +++ /dev/null @@ -1,25 +0,0 @@ -{% raw %}{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %} - {% translate "Verify Your E-mail Address" %} -{% endblock head_title %} -{% block inner %} -

{% translate "Verify Your E-mail Address" %}

- {% url 'account_email' as email_url %} -

- {% blocktranslate %}This part of the site requires us to verify that -you are who you claim to be. For this purpose, we require that you -verify ownership of your e-mail address. {% endblocktranslate %} -

-

- {% blocktranslate %}We have sent an e-mail to you for -verification. Please click on the link inside this e-mail. Please -contact us if you do not receive it within a few minutes.{% endblocktranslate %} -

-

- {% blocktranslate %}Note: you can still change your e-mail address.{% endblocktranslate %} -

-{% endblock inner %} -{%- endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html new file mode 100644 index 000000000..090c2cbf6 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/alert.html @@ -0,0 +1,7 @@ +{% raw %}{% load i18n %} +{% load allauth %} + +
+ {% slot message %} +{% endslot %} +
{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html new file mode 100644 index 000000000..7093939da --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/badge.html @@ -0,0 +1,6 @@ +{% raw %}{% load allauth %} + + + {% slot %} +{% endslot %} +{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html new file mode 100644 index 000000000..1c0ae4b99 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/button.html @@ -0,0 +1,20 @@ +{% raw %}{% load allauth %} + +{% comment %} djlint:off {% endcomment %} +<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %} + {% if attrs.form %}form="{{ attrs.form }}"{% endif %} + {% if attrs.id %}id="{{ attrs.id }}"{% endif %} + {% if attrs.name %}name="{{ attrs.name }}"{% endif %} + {% if attrs.type %}type="{{ attrs.type }}"{% endif %} + class="btn +{% if 'success' in attrs.tags %}btn-success +{% elif 'warning' in attrs.tags %}btn-warning +{% elif 'secondary' in attrs.tags %}btn-secondary +{% elif 'danger' in attrs.tags %}btn-danger +{% elif 'primary' in attrs.tags %}btn-primary +{% else %}btn-primary +{% endif %}" +> + {% slot %} + {% endslot %} + {% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html new file mode 100644 index 000000000..8585f7a4d --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/field.html @@ -0,0 +1,66 @@ +{% raw %}{% load allauth %} +{% load crispy_forms_tags %} + +{% if attrs.type == "textarea" %} +
+
+ +
+ +
+{% elif attrs.type == "radio" %} +
+
+
+ + +
+
+
+{% else %} +
+ +
+
+ +
+{% endif %} +{% if slots.help_text %} +
{% slot help_text %}{% endslot %}
+{% endif %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html new file mode 100644 index 000000000..6a2f3c2cb --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/fields.html @@ -0,0 +1,3 @@ +{% raw %}{% load crispy_forms_tags %} + +{{ attrs.form|crispy }}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html new file mode 100644 index 000000000..ce179b587 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/panel.html @@ -0,0 +1,19 @@ +{% raw %}{% load allauth %} + +
+
+
+

+ {% slot title %} + {% endslot %} +

+ {% slot body %} + {% endslot %} + {% if slots.actions %} +
    + {% for action in slots.actions %}
  • {{ action }}
  • {% endfor %} +
+ {% endif %} +
+
+
{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html new file mode 100644 index 000000000..7ceb9234d --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/elements/table.html @@ -0,0 +1,6 @@ +{% raw %}{% load allauth %} + + + {% slot %} +{% endslot %} +
{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html new file mode 100644 index 000000000..91cbaba3f --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/entrance.html @@ -0,0 +1,29 @@ +{% raw %}{% extends "base.html" %} +{% load i18n %} +{% block bodyclass %}bg-light{% endblock bodyclass %} + +{% block css %}{{ block.super }}{% endblock css %} +{% block title %} + {% block head_title %} + {% trans "Sign In" %} + {% endblock head_title %} +{% endblock title %} +{% block body %} +
+
+ {% if messages %} + {% for message in messages %} +
+ {{ message }} + +
+ {% endfor %} + {% endif %} + {% block content %} + {% endblock content %} +
+
+{% endblock body %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html new file mode 100644 index 000000000..b7ff36ba2 --- /dev/null +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/allauth/layouts/manage.html @@ -0,0 +1,6 @@ +{% raw %}{% extends "base.html" %} + +{% block main %} + {% block content %} + {% endblock content %} +{% endblock main %}{% endraw %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 421973e57..ec873c801 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -111,7 +111,8 @@ {% raw %} {% endblock javascript %} - + + {% block body %}
+ {% endblock body %} {% block modal %} {% endblock modal %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html index ab36ba56b..2dc7bfdc7 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/users/user_detail.html @@ -41,6 +41,9 @@ E-Mail + MFA diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py index d0d1488f8..70f829256 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/admin.py @@ -4,9 +4,9 @@ from django.contrib.auth import admin as auth_admin from django.contrib.auth.decorators import login_required from django.utils.translation import gettext_lazy as _ -from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm -from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm -from {{ cookiecutter.project_slug }}.users.models import User +from .forms import UserAdminChangeForm +from .forms import UserAdminCreationForm +from .models import User if settings.DJANGO_ADMIN_FORCE_ALLAUTH: # Force the `admin` sign in process to go through the `django-allauth` workflow: diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py index 2d18de208..830fca60d 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py @@ -6,7 +6,7 @@ from django.forms import EmailField {%- endif %} from django.utils.translation import gettext_lazy as _ -from {{ cookiecutter.project_slug }}.users.models import User +from .models import User class UserAdminChangeForm(admin_forms.UserChangeForm): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py index c75c0e970..d8beaa48e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/managers.py @@ -4,7 +4,7 @@ from django.contrib.auth.hashers import make_password from django.contrib.auth.models import UserManager as DjangoUserManager if TYPE_CHECKING: - from {{ cookiecutter.project_slug }}.users.models import User # noqa: F401 + from .models import User # noqa: F401 class UserManager(DjangoUserManager["User"]): diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py index fd78c26a8..4a870cc28 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/models.py @@ -11,7 +11,7 @@ from django.urls import reverse from django.utils.translation import gettext_lazy as _ {%- if cookiecutter.username_type == "email" %} -from {{ cookiecutter.project_slug }}.users.managers import UserManager +from .managers import UserManager {%- endif %} diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py index 2afd4d4bd..ca51cd740 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tasks.py @@ -1,6 +1,6 @@ from celery import shared_task -from {{ cookiecutter.project_slug }}.users.models import User +from .models import User @shared_task() diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py index 40719ed21..74d65da1e 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/urls.py @@ -1,8 +1,8 @@ from django.urls import path -from {{ cookiecutter.project_slug }}.users.views import user_detail_view -from {{ cookiecutter.project_slug }}.users.views import user_redirect_view -from {{ cookiecutter.project_slug }}.users.views import user_update_view +from .views import user_detail_view +from .views import user_redirect_view +from .views import user_update_view app_name = "users" urlpatterns = [