Merge branch 'master' into fix/i18n

This commit is contained in:
Bruno Alla 2023-06-08 17:11:54 +01:00
commit 4912c81239
No known key found for this signature in database
14 changed files with 69 additions and 12 deletions

View File

@ -3,6 +3,27 @@ All enhancements and patches to Cookiecutter Django will be documented in this f
<!-- GENERATOR_PLACEHOLDER --> <!-- GENERATOR_PLACEHOLDER -->
## 2023.06.07
### Changed
- Replace `runserver` with `runserver_plus` ([#4373](https://github.com/cookiecutter/cookiecutter-django/pull/4373))
- Add translations for Brazilian Portuguese ([#4367](https://github.com/cookiecutter/cookiecutter-django/pull/4367))
### Updated
- Update sentry-sdk to 1.25.1 ([#4376](https://github.com/cookiecutter/cookiecutter-django/pull/4376))
- Update django-extensions to 3.2.3 ([#4372](https://github.com/cookiecutter/cookiecutter-django/pull/4372))
- Update djangorestframework-stubs to 3.14.1 ([#4366](https://github.com/cookiecutter/cookiecutter-django/pull/4366))
- Update django-stubs to 4.2.1 ([#4365](https://github.com/cookiecutter/cookiecutter-django/pull/4365))
- Update mypy to 1.3.0 ([#4327](https://github.com/cookiecutter/cookiecutter-django/pull/4327))
## 2023.06.02 ## 2023.06.02

View File

@ -1,3 +1,3 @@
sphinx==6.2.1 sphinx==6.2.1
sphinx-rtd-theme==1.2.1 sphinx-rtd-theme==1.2.2
myst-parser==1.0.0 myst-parser==1.0.0

View File

@ -190,7 +190,9 @@ def handle_js_runner(choice, use_docker, use_async):
"gulp-uglify-es", "gulp-uglify-es",
] ]
if not use_docker: if not use_docker:
dev_django_cmd = "uvicorn config.asgi:application --reload" if use_async else "python manage.py runserver" dev_django_cmd = (
"uvicorn config.asgi:application --reload" if use_async else "python manage.py runserver_plus"
)
scripts.update( scripts.update(
{ {
"dev": "concurrently npm:dev:*", "dev": "concurrently npm:dev:*",

View File

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

View File

@ -0,0 +1,33 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="runserver_plus" type="Python.DjangoServer" factoryName="Django server" singleton="true">
<module name="{{ cookiecutter.project_slug }}" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.local" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<PathMappingSettings>
<option name="pathMappings">
<list>
<mapping local-root="$PROJECT_DIR$" remote-root="/app" />
</list>
</option>
</PathMappingSettings>
<option name="launchJavascriptDebuger" value="false" />
<option name="port" value="8000" />
<option name="host" value="0.0.0.0" />
<option name="additionalOptions" value="" />
<option name="browserUrl" value="" />
<option name="runTestServer" value="false" />
<option name="runNoReload" value="false" />
<option name="useCustomRunCommand" value="true" />
<option name="customRunCommand" value="runserver_plus" />
<method />
</configuration>
</component>

View File

@ -1,5 +1,5 @@
# define an alias for the specific python version used in this file. # define an alias for the specific python version used in this file.
FROM python:3.11.3-slim-bullseye as python FROM python:3.11.4-slim-bullseye as python
# Python build stage # Python build stage
FROM python as python-build-stage FROM python as python-build-stage

View File

@ -9,5 +9,5 @@ python manage.py migrate
{%- if cookiecutter.use_async == 'y' %} {%- if cookiecutter.use_async == 'y' %}
exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html' exec uvicorn config.asgi:application --host 0.0.0.0 --reload --reload-include '*.html'
{%- else %} {%- else %}
exec python manage.py runserver 0.0.0.0:8000 exec python manage.py runserver_plus 0.0.0.0:8000
{%- endif %} {%- endif %}

View File

@ -1,5 +1,5 @@
# define an alias for the specific python version used in this file. # define an alias for the specific python version used in this file.
FROM python:3.11.3-slim-bullseye as python FROM python:3.11.4-slim-bullseye as python
# Python build stage # Python build stage

View File

@ -25,7 +25,7 @@ RUN npm run build
{%- endif %} {%- endif %}
# define an alias for the specific python version used in this file. # define an alias for the specific python version used in this file.
FROM python:3.11.3-slim-bullseye as python FROM python:3.11.4-slim-bullseye as python
# Python build stage # Python build stage
FROM python as python-build-stage FROM python as python-build-stage

View File

@ -16,7 +16,7 @@ redis==4.5.5 # https://github.com/redis/redis-py
hiredis==2.2.3 # https://github.com/redis/hiredis-py hiredis==2.2.3 # https://github.com/redis/hiredis-py
{%- endif %} {%- endif %}
{%- if cookiecutter.use_celery == "y" %} {%- if cookiecutter.use_celery == "y" %}
celery==5.2.7 # pyup: < 6.0 # https://github.com/celery/celery celery==5.3.0 # 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.5.0 # https://github.com/celery/django-celery-beat
{%- if cookiecutter.use_docker == 'y' %} {%- if cookiecutter.use_docker == 'y' %}
flower==1.2.0 # https://github.com/mher/flower flower==1.2.0 # https://github.com/mher/flower

View File

@ -1,6 +1,6 @@
-r base.txt -r base.txt
Werkzeug[watchdog]==2.3.4 # https://github.com/pallets/werkzeug Werkzeug[watchdog]==2.3.5 # https://github.com/pallets/werkzeug
ipdb==0.13.13 # https://github.com/gotcha/ipdb ipdb==0.13.13 # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %} {%- if cookiecutter.use_docker == 'y' %}
psycopg2==2.9.6 # https://github.com/psycopg/psycopg2 psycopg2==2.9.6 # https://github.com/psycopg/psycopg2

View File

@ -8,7 +8,7 @@ psycopg2==2.9.6 # 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.25.0 # https://github.com/getsentry/sentry-python sentry-sdk==1.25.1 # 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.2.3 # https://github.com/redis/hiredis-py hiredis==2.2.3 # https://github.com/redis/hiredis-py

View File

@ -1 +1 @@
python-3.11.3 python-3.11.4

View File

@ -7,6 +7,7 @@ from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest, HttpResponseRedirect from django.http import HttpRequest, HttpResponseRedirect
from django.test import RequestFactory from django.test import RequestFactory
from django.urls import reverse from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm
from {{ cookiecutter.project_slug }}.users.models import User from {{ cookiecutter.project_slug }}.users.models import User
@ -72,7 +73,7 @@ class TestUserUpdateView:
view.form_valid(form) view.form_valid(form)
messages_sent = [m.message for m in messages.get_messages(request)] messages_sent = [m.message for m in messages.get_messages(request)]
assert messages_sent == ["Information successfully updated"] assert messages_sent == [_("Information successfully updated")]
class TestUserRedirectView: class TestUserRedirectView: