diff --git a/cookiecutter.json b/cookiecutter.json index 029103c1..118bb766 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,6 +1,7 @@ { "project_slug": "django", "email": "", + "project_version": "0.0.0-dev", "_copy_without_render": [ "*.py-tpl", ".circleci/config.yml" diff --git a/{{cookiecutter.project_slug}}/.flake8 b/{{cookiecutter.project_slug}}/.flake8 deleted file mode 100644 index 47e09f1e..00000000 --- a/{{cookiecutter.project_slug}}/.flake8 +++ /dev/null @@ -1,9 +0,0 @@ -[flake8] -ignore = E501, E265, F811, PT001, DJ05, SIM113, SIM102 -max-line-length = 160 -exclude = - static, - migrations, - frontend, - .git, - __pycache__ diff --git a/{{cookiecutter.project_slug}}/.isort.cfg b/{{cookiecutter.project_slug}}/.isort.cfg deleted file mode 100644 index d765c2d5..00000000 --- a/{{cookiecutter.project_slug}}/.isort.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[settings] -profile=google -line_length = 119 -extra_standard_library=pytest -known_django=django,restframework -sections=FUTURE,STDLIB,THIRDPARTY,DJANGO,FIRSTPARTY,LOCALFOLDER diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index 12bd0577..0e906369 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -5,10 +5,10 @@ install-deps: deps pip-sync requirements.txt deps: - pip-compile requirements.in + pip-compile --output-file=requirements.txt pyproject.toml dev-deps: deps - pip-compile dev-requirements.in + pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml lint: dotenv-linter src/app/.env.ci diff --git a/{{cookiecutter.project_slug}}/dev-requirements.in b/{{cookiecutter.project_slug}}/dev-requirements.in deleted file mode 100644 index 2f5fb91e..00000000 --- a/{{cookiecutter.project_slug}}/dev-requirements.in +++ /dev/null @@ -1,49 +0,0 @@ --c requirements.txt - -ipython - -pytest-django>=3.9 -pytest-deadfixtures -pytest-env -pytest-freezegun -pytest-mock -pytest-randomly - -dotenv-linter - - -freezegun -mixer - -jedi -flake8-absolute-import -flake8-aaa -flake8-bugbear -flake8-cognitive-complexity -flake8-commas -flake8-django -flake8-eradicate -flake8-isort>=4.0.0 -flake8-fixme -flake8-mock -flake8-multiline-containers -flake8-mutable -flake8-pep3101 -flake8-pie -flake8-print -flake8-printf-formatting -flake8-pytest -flake8-pytest-style -flake8-quotes -flake8-simplify -flake8-todo -flake8-use-fstring -flake8-variables-names -flake8-walrus - - -mypy -django-stubs -djangorestframework-stubs -types-freezegun -types-Pillow diff --git a/{{cookiecutter.project_slug}}/dev-requirements.txt b/{{cookiecutter.project_slug}}/dev-requirements.txt index ff5c356d..84b27bd4 100644 --- a/{{cookiecutter.project_slug}}/dev-requirements.txt +++ b/{{cookiecutter.project_slug}}/dev-requirements.txt @@ -1,73 +1,123 @@ # -# This file is autogenerated by pip-compile with python 3.9 +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # -# pip-compile dev-requirements.in +# pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml # -asgiref==3.5.0 - # via - # -c requirements.txt - # django +appnope==0.1.3 + # via ipython +asgiref==3.5.2 + # via django astor==0.8.1 # via flake8-simplify -asttokens==2.0.5 +asttokens==2.1.0 # via # flake8-aaa # stack-data -attrs==21.4.0 +async-timeout==4.0.2 + # via redis +attrs==22.1.0 # via - # -c requirements.txt # dotenv-linter # flake8-bugbear # flake8-eradicate # flake8-multiline-containers + # jsonschema # pytest backcall==0.2.0 # via ipython -certifi==2021.10.8 +bcrypt==4.0.1 + # via django (pyproject.toml) +certifi==2022.9.24 # via - # -c requirements.txt + # django-healthchecks # requests -charset-normalizer==2.0.12 - # via - # -c requirements.txt - # requests -click==8.0.4 + # sentry-sdk +cffi==1.15.1 + # via cryptography +charset-normalizer==2.1.1 + # via requests +click==8.1.3 # via # click-default-group # dotenv-linter click-default-group==1.2.2 # via dotenv-linter -cognitive-complexity==1.2.0 +cognitive-complexity==1.3.0 # via flake8-cognitive-complexity coreapi==2.3.3 # via djangorestframework-stubs coreschema==0.0.4 # via coreapi +cryptography==38.0.3 + # via pyjwt decorator==5.1.1 # via ipython -django==3.2.14 +deprecated==1.2.13 + # via redis +django==3.2.16 # via - # -c requirements.txt + # django (pyproject.toml) + # django-axes + # django-filter + # django-healthchecks + # django-storages # django-stubs # django-stubs-ext -django-stubs==1.9.0 + # djangorestframework + # drf-jwt + # drf-spectacular + # drf-spectacular-sidecar +django-axes==5.39.0 + # via django (pyproject.toml) +django-behaviors==0.5.1 + # via django (pyproject.toml) +django-environ==0.9.0 + # via django (pyproject.toml) +django-filter==22.1 + # via django (pyproject.toml) +django-healthchecks==1.5.0 + # via django (pyproject.toml) +django-ipware==4.0.2 + # via + # django (pyproject.toml) + # django-axes +django-split-settings==1.2.0 + # via django (pyproject.toml) +django-storages==1.13.1 + # via django (pyproject.toml) +django-stubs==1.12.0 # via - # -r dev-requirements.in + # django (pyproject.toml) # djangorestframework-stubs -django-stubs-ext==0.3.1 +django-stubs-ext==0.5.0 # via django-stubs -djangorestframework-stubs==1.4.0 - # via -r dev-requirements.in -dotenv-linter==0.3.0 - # via -r dev-requirements.in -eradicate==2.0.0 +djangorestframework==3.14.0 + # via + # django (pyproject.toml) + # drf-jwt + # drf-spectacular +djangorestframework-camel-case==1.3.0 + # via django (pyproject.toml) +djangorestframework-stubs==1.7.0 + # via django (pyproject.toml) +dotenv-linter==0.4.0 + # via django (pyproject.toml) +drf-jwt==1.19.2 + # via django (pyproject.toml) +drf-spectacular[sidecar]==0.24.2 + # via django (pyproject.toml) +drf-spectacular-sidecar==2022.11.1 + # via drf-spectacular +eradicate==2.1.0 # via flake8-eradicate -executing==0.8.3 +exceptiongroup==1.0.0 + # via pytest +executing==1.2.0 # via stack-data -faker==8.16.0 +faker==12.0.1 # via mixer -flake8==3.9.2 +flake8==5.0.4 # via # flake8-absolute-import # flake8-bugbear @@ -76,138 +126,142 @@ flake8==3.9.2 # flake8-eradicate # flake8-isort # flake8-multiline-containers - # flake8-mutable # flake8-pep3101 # flake8-print # flake8-printf-formatting + # flake8-pyproject # flake8-pytest # flake8-quotes # flake8-simplify # flake8-use-fstring # flake8-walrus flake8-aaa==0.12.2 - # via -r dev-requirements.in + # via django (pyproject.toml) flake8-absolute-import==1.0.0.1 - # via -r dev-requirements.in -flake8-bugbear==22.1.11 - # via -r dev-requirements.in + # via django (pyproject.toml) +flake8-bugbear==22.10.27 + # via django (pyproject.toml) flake8-cognitive-complexity==0.1.0 - # via -r dev-requirements.in + # via django (pyproject.toml) flake8-commas==2.1.0 - # via -r dev-requirements.in -flake8-django==1.1.2 - # via -r dev-requirements.in -flake8-eradicate==1.2.0 - # via -r dev-requirements.in + # via django (pyproject.toml) +flake8-django==1.1.5 + # via django (pyproject.toml) +flake8-eradicate==1.4.0 + # via django (pyproject.toml) flake8-fixme==1.1.1 - # via -r dev-requirements.in -flake8-isort==4.1.1 - # via -r dev-requirements.in -flake8-mock==0.3 - # via -r dev-requirements.in -flake8-multiline-containers==0.0.18 - # via -r dev-requirements.in -flake8-mutable==1.2.0 - # via -r dev-requirements.in -flake8-pep3101==1.3.0 - # via -r dev-requirements.in -flake8-pie==0.15.0 - # via -r dev-requirements.in + # via django (pyproject.toml) +flake8-isort==5.0.0 + # via django (pyproject.toml) +flake8-multiline-containers==0.0.19 + # via django (pyproject.toml) +flake8-pep3101==2.0.0 + # via django (pyproject.toml) +flake8-pie==0.16.0 + # via django (pyproject.toml) flake8-plugin-utils==1.3.2 # via flake8-pytest-style -flake8-print==4.0.0 - # via -r dev-requirements.in +flake8-print==5.0.0 + # via django (pyproject.toml) flake8-printf-formatting==1.1.2 - # via -r dev-requirements.in -flake8-pytest==1.3 - # via -r dev-requirements.in + # via django (pyproject.toml) +flake8-pyproject==1.1.0.post0 + # via django (pyproject.toml) +flake8-pytest==1.4 + # via django (pyproject.toml) flake8-pytest-style==1.6.0 - # via -r dev-requirements.in + # via django (pyproject.toml) flake8-quotes==3.3.1 - # via -r dev-requirements.in -flake8-simplify==0.18.1 - # via -r dev-requirements.in + # via django (pyproject.toml) +flake8-simplify==0.19.3 + # via django (pyproject.toml) flake8-todo==0.7 - # via -r dev-requirements.in -flake8-use-fstring==1.3 - # via -r dev-requirements.in + # via django (pyproject.toml) +flake8-use-fstring==1.4 + # via django (pyproject.toml) flake8-variables-names==0.0.5 - # via -r dev-requirements.in -flake8-walrus==1.1.0 - # via -r dev-requirements.in -freezegun==1.2.1 + # via django (pyproject.toml) +flake8-walrus==1.2.0 + # via django (pyproject.toml) +freezegun==1.2.2 # via - # -r dev-requirements.in + # django (pyproject.toml) # pytest-freezegun -idna==3.3 - # via - # -c requirements.txt - # requests +idna==3.4 + # via requests +inflection==0.5.1 + # via drf-spectacular iniconfig==1.1.1 # via pytest -ipython==8.1.1 - # via -r dev-requirements.in +ipython==8.6.0 + # via django (pyproject.toml) isort==5.10.1 # via flake8-isort itypes==1.2.0 # via coreapi jedi==0.18.1 # via - # -r dev-requirements.in + # django (pyproject.toml) # ipython -jinja2==3.0.3 +jinja2==3.1.2 # via coreschema +jsonschema==4.17.0 + # via drf-spectacular markupsafe==2.1.1 # via jinja2 -matplotlib-inline==0.1.3 +matplotlib-inline==0.1.6 # via ipython -mccabe==0.6.1 +mccabe==0.7.0 # via flake8 -mixer==7.2.1 - # via -r dev-requirements.in -mypy==0.941 +mixer==7.2.2 + # via django (pyproject.toml) +mypy==0.982 # via - # -r dev-requirements.in + # django (pyproject.toml) # django-stubs # djangorestframework-stubs mypy-extensions==0.4.3 # via mypy packaging==21.3 # via - # -c requirements.txt # pytest + # redis parso==0.8.3 # via jedi pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython +pillow==9.3.0 + # via django (pyproject.toml) pluggy==1.0.0 # via pytest ply==3.11 # via dotenv-linter -prompt-toolkit==3.0.28 +prompt-toolkit==3.0.31 # via ipython ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -py==1.11.0 - # via pytest -pycodestyle==2.7.0 +pycodestyle==2.9.1 # via # flake8 # flake8-print # flake8-todo -pyflakes==2.3.1 +pycparser==2.21 + # via cffi +pyflakes==2.5.0 # via flake8 -pygments==2.11.2 +pygments==2.13.0 # via ipython -pyparsing==3.0.7 - # via - # -c requirements.txt - # packaging -pytest==7.1.1 +pyjwt[crypto]==2.6.0 + # via drf-jwt +pyparsing==3.0.9 + # via packaging +pyrsistent==0.19.1 + # via jsonschema +pytest==7.2.0 # via # pytest-deadfixtures # pytest-django @@ -216,65 +270,71 @@ pytest==7.1.1 # pytest-mock # pytest-randomly pytest-deadfixtures==2.2.1 - # via -r dev-requirements.in + # via django (pyproject.toml) pytest-django==4.5.2 - # via -r dev-requirements.in -pytest-env==0.6.2 - # via -r dev-requirements.in + # via django (pyproject.toml) +pytest-env==0.8.1 + # via django (pyproject.toml) pytest-freezegun==0.4.2 - # via -r dev-requirements.in -pytest-mock==3.7.0 - # via -r dev-requirements.in -pytest-randomly==3.11.0 - # via -r dev-requirements.in + # via django (pyproject.toml) +pytest-mock==3.10.0 + # via django (pyproject.toml) +pytest-randomly==3.12.0 + # via django (pyproject.toml) python-dateutil==2.8.2 # via # faker # freezegun -pytz==2021.3 +pytz==2022.6 # via - # -c requirements.txt # django -requests==2.27.1 + # djangorestframework +pyyaml==6.0 + # via drf-spectacular +redis==4.3.4 + # via django (pyproject.toml) +requests==2.28.1 # via - # -c requirements.txt # coreapi + # django-healthchecks # djangorestframework-stubs +sentry-sdk==1.10.1 + # via django (pyproject.toml) six==1.16.0 # via - # -c requirements.txt # asttokens - # flake8-print # python-dateutil -sqlparse==0.4.2 - # via - # -c requirements.txt - # django -stack-data==0.2.0 +sqlparse==0.4.3 + # via django +stack-data==0.6.0 # via ipython -testfixtures==6.18.5 - # via flake8-isort -text-unidecode==1.3 - # via faker -toml==0.10.2 - # via django-stubs tomli==2.0.1 # via + # django-stubs + # flake8-pyproject # mypy # pytest -traitlets==5.1.1 +traitlets==5.5.0 # via # ipython # matplotlib-inline -types-freezegun==1.1.7 - # via -r dev-requirements.in -types-pillow==9.0.8 - # via -r dev-requirements.in -types-pytz==2021.3.6 - # via django-stubs -types-pyyaml==6.0.5 +types-freezegun==1.1.10 + # via django (pyproject.toml) +types-markdown==3.4.2.1 + # via djangorestframework-stubs +types-pillow==9.3.0.0 + # via django (pyproject.toml) +types-pytz==2022.6.0.1 # via django-stubs -typing-extensions==3.10.0.2 +types-pyyaml==6.0.12.1 + # via + # django-stubs + # djangorestframework-stubs +types-requests==2.28.11.2 + # via djangorestframework-stubs +types-urllib3==1.26.25.1 + # via types-requests +typing-extensions==4.4.0 # via # django-stubs # django-stubs-ext @@ -282,16 +342,20 @@ typing-extensions==3.10.0.2 # dotenv-linter # flake8-pie # mypy -uritemplate==3.0.1 +uritemplate==4.1.1 # via - # -c requirements.txt # coreapi -urllib3==1.26.9 + # drf-spectacular +urllib3==1.26.12 # via - # -c requirements.txt # requests + # sentry-sdk wcwidth==0.2.5 # via prompt-toolkit +whitenoise==6.2.0 + # via django (pyproject.toml) +wrapt==1.14.1 + # via deprecated # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml new file mode 100644 index 00000000..36760538 --- /dev/null +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -0,0 +1,100 @@ +[project] +name = "{{cookiecutter.project_slug}}" +version = "{{cookiecutter.project_version}}" +dependencies = [ + "Django<3.3", + "bcrypt", + "django-behaviors", + "django-environ", + "django-ipware", + "django-axes", + "whitenoise", + "django-storages", + "djangorestframework", + "djangorestframework-camel-case", + "drf-jwt", + "drf-spectacular[sidecar]", + "django-filter", + "django-split-settings", + "django-healthchecks", + "redis", + "sentry-sdk", + "Pillow", +] + + +[project.optional-dependencies] +dev = [ + "ipython", + + "pytest-django>=3.9", + "pytest-deadfixtures", + "pytest-env", + "pytest-freezegun", + "pytest-mock", + "pytest-randomly", + + "dotenv-linter", + + "freezegun", + "mixer", + + "jedi", + "flake8-absolute-import", + "flake8-aaa", + "flake8-bugbear", + "flake8-cognitive-complexity", + "flake8-commas", + "flake8-django", + "flake8-eradicate", + "flake8-isort>=4.0.0", + "flake8-fixme", + "flake8-multiline-containers", + "flake8-pep3101", + "flake8-pie", + "flake8-print", + "flake8-printf-formatting", + "flake8-pytest", + "flake8-pytest-style", + "flake8-quotes", + "flake8-simplify", + "flake8-todo", + "flake8-use-fstring", + "flake8-variables-names", + "flake8-walrus", + "flake8-pyproject", + + "mypy", + "django-stubs", + "djangorestframework-stubs", + "types-freezegun", + "types-Pillow", +] + + +[tool.flake8] +max-line-length = 160 +ignore = [ + "DJ05", # URLs include() should set a namespace + "E501", # Line too long + "E265", # Block comments should have one space before the pound sign (#) and the comment itself + "F811", # Redefinition of unused name from line n + "PT001", # Use @pytest.fixture() over @pytest.fixture + "SIM102", # Use a single if-statement instead of nested if-statements + "SIM113", # Use enumerate instead of manually incrementing a counter +] +exclude = [ + "static", + "migrations", + "frontend", + ".git", + "__pycache__", +] + + +[tool.isort] +profile = "google" +line_length = 160 +extra_standard_library = ["pytest"] +known_django = ["django", "restframework"] +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "DJANGO", "FIRSTPARTY", "LOCALFOLDER"] diff --git a/{{cookiecutter.project_slug}}/requirements.in b/{{cookiecutter.project_slug}}/requirements.in deleted file mode 100644 index 4cf2456f..00000000 --- a/{{cookiecutter.project_slug}}/requirements.in +++ /dev/null @@ -1,18 +0,0 @@ -Django<3.3 -bcrypt -django-behaviors -django-environ -django-ipware -django-axes -whitenoise -django-storages -djangorestframework -djangorestframework-camel-case -drf-jwt -drf-spectacular[sidecar] -django-filter -django-split-settings -django-healthchecks -redis -sentry-sdk -Pillow diff --git a/{{cookiecutter.project_slug}}/requirements.txt b/{{cookiecutter.project_slug}}/requirements.txt index 8d1a5a02..6f178a25 100644 --- a/{{cookiecutter.project_slug}}/requirements.txt +++ b/{{cookiecutter.project_slug}}/requirements.txt @@ -2,31 +2,32 @@ # This file is autogenerated by pip-compile with python 3.10 # To update, run: # -# pip-compile requirements.in +# pip-compile --output-file=requirements.txt pyproject.toml # -asgiref==3.5.0 +asgiref==3.5.2 # via django -attrs==21.4.0 +async-timeout==4.0.2 + # via redis +attrs==22.1.0 # via jsonschema -bcrypt==3.2.0 - # via -r requirements.in -certifi==2021.10.8 +bcrypt==4.0.1 + # via django (pyproject.toml) +certifi==2022.9.24 # via + # django-healthchecks # requests # sentry-sdk -cffi==1.15.0 - # via - # bcrypt - # cryptography -charset-normalizer==2.0.12 +cffi==1.15.1 + # via cryptography +charset-normalizer==2.1.1 # via requests -cryptography==3.4.8 +cryptography==38.0.3 # via pyjwt deprecated==1.2.13 # via redis -django==3.2.14 +django==3.2.16 # via - # -r requirements.in + # django (pyproject.toml) # django-axes # django-filter # django-healthchecks @@ -35,82 +36,78 @@ django==3.2.14 # drf-jwt # drf-spectacular # drf-spectacular-sidecar -django-axes==5.31.0 - # via -r requirements.in +django-axes==5.39.0 + # via django (pyproject.toml) django-behaviors==0.5.1 - # via -r requirements.in -django-environ==0.8.1 - # via -r requirements.in -django-filter==2.4.0 - # via -r requirements.in -django-healthchecks==1.4.2 - # via -r requirements.in -django-ipware==3.0.7 + # via django (pyproject.toml) +django-environ==0.9.0 + # via django (pyproject.toml) +django-filter==22.1 + # via django (pyproject.toml) +django-healthchecks==1.5.0 + # via django (pyproject.toml) +django-ipware==4.0.2 # via - # -r requirements.in + # django (pyproject.toml) # django-axes -django-split-settings==1.1.0 - # via -r requirements.in -django-storages==1.12.3 - # via -r requirements.in -djangorestframework==3.13.1 +django-split-settings==1.2.0 + # via django (pyproject.toml) +django-storages==1.13.1 + # via django (pyproject.toml) +djangorestframework==3.14.0 # via - # -r requirements.in + # django (pyproject.toml) # drf-jwt # drf-spectacular djangorestframework-camel-case==1.3.0 - # via -r requirements.in + # via django (pyproject.toml) drf-jwt==1.19.2 - # via -r requirements.in -drf-spectacular[sidecar]==0.21.2 - # via -r requirements.in -drf-spectacular-sidecar==2022.3.14 + # via django (pyproject.toml) +drf-spectacular[sidecar]==0.24.2 + # via django (pyproject.toml) +drf-spectacular-sidecar==2022.11.1 # via drf-spectacular -idna==3.3 +idna==3.4 # via requests inflection==0.5.1 # via drf-spectacular -jsonschema==4.4.0 +jsonschema==4.17.0 # via drf-spectacular packaging==21.3 # via redis -pillow==9.0.1 - # via -r requirements.in +pillow==9.3.0 + # via django (pyproject.toml) pycparser==2.21 # via cffi -pyjwt[crypto]==2.3.0 +pyjwt[crypto]==2.6.0 # via drf-jwt -pyparsing==3.0.7 +pyparsing==3.0.9 # via packaging -pyrsistent==0.18.1 +pyrsistent==0.19.1 # via jsonschema -pytz==2021.3 +pytz==2022.6 # via # django # djangorestframework pyyaml==6.0 # via drf-spectacular -redis==4.1.4 - # via -r requirements.in -requests==2.27.1 +redis==4.3.4 + # via django (pyproject.toml) +requests==2.28.1 # via django-healthchecks -sentry-sdk==1.5.8 - # via -r requirements.in -six==1.16.0 - # via - # bcrypt - # django-healthchecks -sqlparse==0.4.2 +sentry-sdk==1.10.1 + # via django (pyproject.toml) +sqlparse==0.4.3 # via django -uritemplate==3.0.1 +uritemplate==4.1.1 # via drf-spectacular -urllib3==1.26.9 +urllib3==1.26.12 # via # requests # sentry-sdk -whitenoise==6.0.0 - # via -r requirements.in -wrapt==1.14.0 +whitenoise==6.2.0 + # via django (pyproject.toml) +wrapt==1.14.1 # via deprecated # The following packages are considered to be unsafe in a requirements file: diff --git a/{{cookiecutter.project_slug}}/src/app/management/commands/makemigrations.py b/{{cookiecutter.project_slug}}/src/app/management/commands/makemigrations.py index fbf8e7fe..e0549429 100644 --- a/{{cookiecutter.project_slug}}/src/app/management/commands/makemigrations.py +++ b/{{cookiecutter.project_slug}}/src/app/management/commands/makemigrations.py @@ -1,14 +1,16 @@ -import sys - +from django.core.management.base import CommandError from django.core.management.commands.makemigrations import Command as BaseCommand +class MakemigrationsError(CommandError): + pass + + class Command(BaseCommand): """Disable automatic names for django migrations, thanks https://adamj.eu/tech/2020/02/24/how-to-disallow-auto-named-django-migrations/ """ def handle(self, *app_labels, **options): if options['name'] is None and not any([options['dry_run'], options['check_changes']]): - print('Migration name (-n/--name) is required.', file=sys.stderr) # noqa: T001 - sys.exit(1) + raise MakemigrationsError('Migration name is required. Run again with `-n/--name` argument and specify name explicitly.') super().handle(*app_labels, **options)