From f2a7c719e278c0ae0d8baeca64898595b2f72d6e Mon Sep 17 00:00:00 2001 From: browniebroke Date: Thu, 30 Apr 2020 12:00:30 +0100 Subject: [PATCH 1/2] Update redis from 3.4.1 to 3.5.0 --- {{cookiecutter.project_slug}}/requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index c2d5babf..4c1b55e1 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -8,7 +8,7 @@ argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi {%- if cookiecutter.use_whitenoise == 'y' %} whitenoise==5.0.1 # https://github.com/evansd/whitenoise {%- endif %} -redis==3.4.1 # https://github.com/andymccurdy/redis-py +redis==3.5.0 # https://github.com/andymccurdy/redis-py {%- if cookiecutter.use_celery == "y" %} celery==4.4.2 # pyup: < 5.0 # https://github.com/celery/celery django-celery-beat==2.0.0 # https://github.com/celery/django-celery-beat From 1247f0639552355a17fb74c816adb4f754151932 Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrionuevo da Luz" Date: Wed, 29 Apr 2020 19:07:21 -0300 Subject: [PATCH 2/2] Make sure to resolve symbolic links, uses an absolute path in ROOT_DIR and raise an error if the path does not exist by using the "resolve" method. Use "parent.parent.parent" instead of "parents[2]" --- {{cookiecutter.project_slug}}/config/asgi.py | 4 ++-- {{cookiecutter.project_slug}}/config/settings/base.py | 4 ++-- {{cookiecutter.project_slug}}/config/wsgi.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/asgi.py b/{{cookiecutter.project_slug}}/config/asgi.py index 562ecf40..8c99bbf5 100644 --- a/{{cookiecutter.project_slug}}/config/asgi.py +++ b/{{cookiecutter.project_slug}}/config/asgi.py @@ -15,8 +15,8 @@ from django.core.asgi import get_asgi_application # This allows easy placement of apps within the interior # {{ cookiecutter.project_slug }} directory. -app_path = Path(__file__).parents[1].resolve() -sys.path.append(str(app_path / "{{ cookiecutter.project_slug }}")) +ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent +sys.path.append(str(ROOT_DIR / "{{ cookiecutter.project_slug }}")) # If DJANGO_SETTINGS_MODULE is unset, default to the local settings os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 390f2252..7f339fad 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -5,8 +5,8 @@ from pathlib import Path import environ -ROOT_DIR = Path(__file__).parents[2] -# {{ cookiecutter.project_slug }}/) +ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent +# {{ cookiecutter.project_slug }}/ APPS_DIR = ROOT_DIR / "{{ cookiecutter.project_slug }}" env = environ.Env() diff --git a/{{cookiecutter.project_slug}}/config/wsgi.py b/{{cookiecutter.project_slug}}/config/wsgi.py index fccfea35..a7de581c 100644 --- a/{{cookiecutter.project_slug}}/config/wsgi.py +++ b/{{cookiecutter.project_slug}}/config/wsgi.py @@ -21,8 +21,8 @@ from django.core.wsgi import get_wsgi_application # This allows easy placement of apps within the interior # {{ cookiecutter.project_slug }} directory. -app_path = Path(__file__).parents[1].resolve() -sys.path.append(str(app_path / "{{ cookiecutter.project_slug }}")) +ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent +sys.path.append(str(ROOT_DIR / "{{ cookiecutter.project_slug }}")) # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks # if running multiple sites in the same mod_wsgi process. To fix this, use # mod_wsgi daemon mode with each site in its own daemon process, or use