diff --git a/{{cookiecutter.project_slug}}/.envs/.local/.django b/{{cookiecutter.project_slug}}/.envs/.local/.django index ef581a1c0..520925848 100644 --- a/{{cookiecutter.project_slug}}/.envs/.local/.django +++ b/{{cookiecutter.project_slug}}/.envs/.local/.django @@ -10,6 +10,7 @@ REDIS_URL=redis://redis:6379/0 # Celery # ------------------------------------------------------------------------------ +CELERY_BROKER_URL="${REDIS_URL}" # Flower CELERY_FLOWER_USER=!!!SET CELERY_FLOWER_USER!!! diff --git a/{{cookiecutter.project_slug}}/.envs/.local/.postgres b/{{cookiecutter.project_slug}}/.envs/.local/.postgres index f190db8e6..9a2c58713 100644 --- a/{{cookiecutter.project_slug}}/.envs/.local/.postgres +++ b/{{cookiecutter.project_slug}}/.envs/.local/.postgres @@ -5,3 +5,4 @@ POSTGRES_PORT=5432 POSTGRES_DB={{ cookiecutter.project_slug }} POSTGRES_USER=!!!SET POSTGRES_USER!!! POSTGRES_PASSWORD=!!!SET POSTGRES_PASSWORD!!! +DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index e7e8461c9..bd70b9c47 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -64,6 +64,7 @@ REDIS_URL=redis://redis:6379/0 {% if cookiecutter.use_celery == 'y' %} # Celery # ------------------------------------------------------------------------------ +CELERY_BROKER_URL="${REDIS_URL}" # Flower CELERY_FLOWER_USER=!!!SET CELERY_FLOWER_USER!!! diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.postgres b/{{cookiecutter.project_slug}}/.envs/.production/.postgres index f190db8e6..9a2c58713 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.postgres +++ b/{{cookiecutter.project_slug}}/.envs/.production/.postgres @@ -5,3 +5,4 @@ POSTGRES_PORT=5432 POSTGRES_DB={{ cookiecutter.project_slug }} POSTGRES_USER=!!!SET POSTGRES_USER!!! POSTGRES_PASSWORD=!!!SET POSTGRES_PASSWORD!!! +DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index be331a526..8fb4bb57e 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -25,7 +25,7 @@ DEBUG = env.bool("DJANGO_DEBUG", False) # In Windows, this must be set to your system time zone. TIME_ZONE = "{{ cookiecutter.timezone }}" # https://docs.djangoproject.com/en/dev/ref/settings/#language-code -LANGUAGE_CODE = "en-us" +LANGUAGE_CODE = "es-MX" # https://docs.djangoproject.com/en/dev/ref/settings/#site-id SITE_ID = 1 # https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n @@ -89,6 +89,8 @@ THIRD_PARTY_APPS = [ "corsheaders", "drf_spectacular", {%- endif %} + "fontawesomefree", + "import_export", ] LOCAL_APPS = [ @@ -312,6 +314,8 @@ ACCOUNT_EMAIL_REQUIRED = True # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_VERIFICATION = "mandatory" # https://django-allauth.readthedocs.io/en/latest/configuration.html +ACCOUNT_MAX_EMAIL_ADDRESSES = 1 +# https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_LOGOUT_ON_GET = True # https://django-allauth.readthedocs.io/en/latest/configuration.html SOCIALACCOUNT_LOGIN_ON_GET = True diff --git a/{{cookiecutter.project_slug}}/config/settings/local.py b/{{cookiecutter.project_slug}}/config/settings/local.py index a5fe0f71c..f7ea3a1df 100644 --- a/{{cookiecutter.project_slug}}/config/settings/local.py +++ b/{{cookiecutter.project_slug}}/config/settings/local.py @@ -50,34 +50,34 @@ EMAIL_BACKEND = env( INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405 {% endif %} -# django-debug-toolbar -# ------------------------------------------------------------------------------ -# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites -INSTALLED_APPS += ["debug_toolbar"] # noqa F405 -# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware -MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405 -# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config -DEBUG_TOOLBAR_CONFIG = { - "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"], - "SHOW_TEMPLATE_CONTEXT": True, -} -# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips -INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"] -{% if cookiecutter.use_docker == 'y' -%} -if env("USE_DOCKER") == "yes": - import socket - - hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) - INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] - {%- if cookiecutter.frontend_pipeline == 'Gulp' %} - try: - _, _, ips = socket.gethostbyname_ex("node") - INTERNAL_IPS.extend(ips) - except socket.gaierror: - # The node container isn't started (yet?) - pass - {%- endif %} -{%- endif %} +# # django-debug-toolbar +# # ------------------------------------------------------------------------------ +# # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites +# INSTALLED_APPS += ["debug_toolbar"] # noqa F405 +# # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware +# MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405 +# # https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config +# DEBUG_TOOLBAR_CONFIG = { +# "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"], +# "SHOW_TEMPLATE_CONTEXT": True, +# } +# # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips +# INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"] +# {% if cookiecutter.use_docker == 'y' -%} +# if env("USE_DOCKER") == "yes": +# import socket +# +# hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) +# INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips] +# {%- if cookiecutter.frontend_pipeline == 'Gulp' %} +# try: +# _, _, ips = socket.gethostbyname_ex("node") +# INTERNAL_IPS.extend(ips) +# except socket.gaierror: +# # The node container isn't started (yet?) +# pass +# {%- endif %} +# {%- endif %} # django-extensions # ------------------------------------------------------------------------------ diff --git a/{{cookiecutter.project_slug}}/local.yml b/{{cookiecutter.project_slug}}/local.yml index fb203acd6..83433c992 100644 --- a/{{cookiecutter.project_slug}}/local.yml +++ b/{{cookiecutter.project_slug}}/local.yml @@ -38,6 +38,8 @@ services: volumes: - {{ cookiecutter.project_slug }}_local_postgres_data:/var/lib/postgresql/data:Z - {{ cookiecutter.project_slug }}_local_postgres_data_backups:/backups:z + ports: + - "5432:5432" env_file: - ./.envs/.local/.postgres diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 2d65dc0c0..c75d0a161 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -44,5 +44,10 @@ django-redis==5.2.0 # https://github.com/jazzband/django-redis djangorestframework==3.13.1 # https://github.com/encode/django-rest-framework django-cors-headers==3.13.0 # https://github.com/adamchainz/django-cors-headers # DRF-spectacular for api documentation -drf-spectacular==0.22.1 # https://github.com/tfranzel/drf-spectacular +drf-spectacular==0.22.1 # https://github.com/tfranzel/drf-spectacular {%- endif %} + +# Project +# ------------------------------------------------------------------------------ +fontawesomefree==6.1.1 +django-import-export==2.7.1 diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index cd82050c6..8ffa6a222 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -25,6 +25,7 @@ djangorestframework-stubs==1.6.0 # https://github.com/typeddjango/djangorestfra # ------------------------------------------------------------------------------ sphinx==5.0.1 # https://github.com/sphinx-doc/sphinx sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild +sphinx-rtd-theme==1.0.0 # https://pypi.org/project/sphinx-rtd-theme/ # Code quality # ------------------------------------------------------------------------------