Update for custom CC-Django

This commit is contained in:
Alejandro Franco 2022-06-22 13:33:16 -05:00
parent d0849f275e
commit c722c8ea75
9 changed files with 46 additions and 30 deletions

View File

@ -10,6 +10,7 @@ REDIS_URL=redis://redis:6379/0
# Celery
# ------------------------------------------------------------------------------
CELERY_BROKER_URL="${REDIS_URL}"
# Flower
CELERY_FLOWER_USER=!!!SET CELERY_FLOWER_USER!!!

View File

@ -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}"

View File

@ -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!!!

View File

@ -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}"

View File

@ -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

View File

@ -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
# ------------------------------------------------------------------------------

View File

@ -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

View File

@ -46,3 +46,8 @@ 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
{%- endif %}
# Project
# ------------------------------------------------------------------------------
fontawesomefree==6.1.1
django-import-export==2.7.1

View File

@ -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
# ------------------------------------------------------------------------------