From 1399ab8b54e1341c5c3aaeca0972ffa2522d5c06 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 31 May 2020 10:52:37 +0000 Subject: [PATCH 01/13] Bump django-axes from 4.4.2 to 5.3.2 Bumps [django-axes](https://github.com/jazzband/django-axes) from 4.4.2 to 5.3.2. - [Release notes](https://github.com/jazzband/django-axes/releases) - [Changelog](https://github.com/jazzband/django-axes/blob/master/CHANGES.rst) - [Commits](https://github.com/jazzband/django-axes/compare/4.4.2...5.3.2) Signed-off-by: dependabot-preview[bot] --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 88321074..ba2b6503 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -3,7 +3,7 @@ psycopg2==2.8.5 Django==1.11.28 django-appconf==1.0.4 -django-axes==4.4.2 +django-axes==5.3.2 django-crispy-forms==1.9.1 django-ipware==2.1.0 From 567effce877748f79e70b1acd3495f1c84d8550b Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:22:56 +0300 Subject: [PATCH 02/13] Added fix for AXES, added ALLOWED --- src/ionescu77v2Project/settings/production.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/ionescu77v2Project/settings/production.py b/src/ionescu77v2Project/settings/production.py index f49fd231..77a6c702 100644 --- a/src/ionescu77v2Project/settings/production.py +++ b/src/ionescu77v2Project/settings/production.py @@ -24,7 +24,7 @@ # TEMPLATE_DEBUG = True # Deprecated see below TEMPLATES: DISQUS = True -ALLOWED_HOSTS = ['ionescu77.com'] +ALLOWED_HOSTS = ['ionescu77.com','www.ionescu77.com','staging.ionescu77.com'] INSTALLED_APPS += ( 'landing', @@ -51,3 +51,28 @@ AXES_VERBOSE = False AXES_LOCKOUT_TEMPLATE = 'lockout.html' + +# /////// +# ------- django-axes: CACHES enabled, 20181119 +# ------- django-axes: CACHES enabled, 20200531 +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + }, + 'axes_cache': { + 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', + } +} +# ------- # + +# /////// +# ------- django-axes: Settings for this: +AXES_CACHE = 'axes_cache' +AXES_VERBOSE = False +AXES_LOCKOUT_TEMPLATE = 'lockout.html' +AUTHENTICATION_BACKENDS = [ + 'axes.backends.AxesModelBackend', + 'django.contrib.auth.backends.ModelBackend', +] + +# ------- # From 9574a8bc9d3c525dde92266ceb3644bb7036d0e8 Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:24:54 +0300 Subject: [PATCH 03/13] added static handling --- src/ionescu77v2Project/settings/base.py | 5 +++++ src/ionescu77v2Project/settings/production.py | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index 0e083b8f..06176f48 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -103,3 +103,8 @@ # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' + +# Added to handle static +# +STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static") +MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media") diff --git a/src/ionescu77v2Project/settings/production.py b/src/ionescu77v2Project/settings/production.py index 77a6c702..035b7cac 100644 --- a/src/ionescu77v2Project/settings/production.py +++ b/src/ionescu77v2Project/settings/production.py @@ -43,9 +43,6 @@ #TEST_DATABASE_CHARSET=UTF8 #CHARSET=UTF8 # supported for PG and MySQL only -STATIC_ROOT = '/home/ionescu77/webapps/apollo13/ionescu77/static/' -MEDIA_ROOT = '/home/ionescu77/webapps/apollo13/ionescu77/media/' - CRISPY_TEMPLATE_PACK = 'bootstrap3' AXES_VERBOSE = False From aca432a9dabb4e065f08564c32d5b8bb95ca965f Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:40:54 +0300 Subject: [PATCH 04/13] Refactor settings, mainly for AXES --- src/ionescu77v2Project/settings/base.py | 42 +++++++++++++ src/ionescu77v2Project/settings/local.py | 29 +++++++++ src/ionescu77v2Project/settings/production.py | 17 +----- src/ionescu77v2Project/settings/razvansky.py | 59 ------------------- src/ionescu77v2Project/settings/staging.py | 22 ++----- 5 files changed, 78 insertions(+), 91 deletions(-) create mode 100644 src/ionescu77v2Project/settings/local.py delete mode 100644 src/ionescu77v2Project/settings/razvansky.py diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index 0e083b8f..5a87c93e 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -98,6 +98,48 @@ USE_TZ = True +# This should go into all settings files: +# +INSTALLED_APPS += ( + 'landing', + 'blogengine', + 'accounts', + 'django.contrib.sites', + 'django.contrib.flatpages', + 'django.contrib.syndication', + 'django.contrib.sitemaps', + 'crispy_forms', + 'axes', +) + + +# This is for django axes, we'll se how it works local +# +# /////// +# ------- django-axes: CACHES enabled, 20181119 +# ------- django-axes: CACHES enabled, 20200531 +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + }, + 'axes_cache': { + 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', + } +} +# ------- # + +# /////// +# ------- django-axes: Settings for this: +AXES_CACHE = 'axes_cache' +AXES_VERBOSE = False +AXES_LOCKOUT_TEMPLATE = 'lockout.html' +AUTHENTICATION_BACKENDS = [ + 'axes.backends.AxesModelBackend', + 'django.contrib.auth.backends.ModelBackend', +] + +# ------- # + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ diff --git a/src/ionescu77v2Project/settings/local.py b/src/ionescu77v2Project/settings/local.py new file mode 100644 index 00000000..0b2cc649 --- /dev/null +++ b/src/ionescu77v2Project/settings/local.py @@ -0,0 +1,29 @@ +import os +from .base import * + +SECRET_KEY=os.environ['SECRET_KEY_RAZ'] + +DEBUG = True +# TEMPLATE_DEBUG = True # Deprecated see below TEMPLATES: +DISQUS = False + + +ALLOWED_HOSTS = ['127.0.0.1'] + +SITE_ID = 2 + +#TEST_DATABASE_CHARSET=UTF8 +#CHARSET=UTF8 # supported for PG and MySQL only + + +INSTALLED_APPS += ('django_jenkins',) +JENKINS_TASKS = () + +PROJECT_APPS = ['blogengine'] + +CRISPY_TEMPLATE_PACK = 'bootstrap3' + +# /////// +# ------- django-axes: Settings for this: +AXES_VERBOSE = True +# ------- # diff --git a/src/ionescu77v2Project/settings/production.py b/src/ionescu77v2Project/settings/production.py index f49fd231..28df8350 100644 --- a/src/ionescu77v2Project/settings/production.py +++ b/src/ionescu77v2Project/settings/production.py @@ -26,18 +26,6 @@ ALLOWED_HOSTS = ['ionescu77.com'] -INSTALLED_APPS += ( - 'landing', - 'blogengine', - 'accounts', - 'django.contrib.sites', - 'django.contrib.flatpages', - 'django.contrib.syndication', - 'django.contrib.sitemaps', - 'crispy_forms', - 'axes', -) - SITE_ID = 1 #TEST_DATABASE_CHARSET=UTF8 @@ -48,6 +36,7 @@ CRISPY_TEMPLATE_PACK = 'bootstrap3' +# /////// +# ------- django-axes: Settings for this: AXES_VERBOSE = False - -AXES_LOCKOUT_TEMPLATE = 'lockout.html' +# ------- # diff --git a/src/ionescu77v2Project/settings/razvansky.py b/src/ionescu77v2Project/settings/razvansky.py deleted file mode 100644 index 007050ea..00000000 --- a/src/ionescu77v2Project/settings/razvansky.py +++ /dev/null @@ -1,59 +0,0 @@ -import os -from .base import * - -SECRET_KEY=os.environ['SECRET_KEY_RAZ'] - -DEBUG = True -# TEMPLATE_DEBUG = True # Deprecated see below TEMPLATES: -DISQUS = False - - -ALLOWED_HOSTS = ['127.0.0.1'] - -INSTALLED_APPS += ( - 'landing', - 'blogengine', - 'accounts', - 'django.contrib.sites', - 'django.contrib.flatpages', - 'django.contrib.syndication', - 'django.contrib.sitemaps', - 'crispy_forms', - 'axes', -) - -SITE_ID = 2 - -#TEST_DATABASE_CHARSET=UTF8 -#CHARSET=UTF8 # supported for PG and MySQL only - -# /////// -# ------- django-axes: CACHES enabled, 20181119 -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - }, - 'axes_cache': { - 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', - } -} -# ------- # - -INSTALLED_APPS += ('django_jenkins',) -JENKINS_TASKS = () - -PROJECT_APPS = ['blogengine'] - -CRISPY_TEMPLATE_PACK = 'bootstrap3' - -# /////// -# ------- django-axes: Settings for this: -AXES_CACHE = 'axes_cache' -AXES_VERBOSE = True -AXES_LOCKOUT_TEMPLATE = 'lockout.html' -AUTHENTICATION_BACKENDS = [ - 'axes.backends.AxesModelBackend', - 'django.contrib.auth.backends.ModelBackend', -] - -# ------- # diff --git a/src/ionescu77v2Project/settings/staging.py b/src/ionescu77v2Project/settings/staging.py index 5585959d..b40011bd 100644 --- a/src/ionescu77v2Project/settings/staging.py +++ b/src/ionescu77v2Project/settings/staging.py @@ -26,28 +26,14 @@ ALLOWED_HOSTS = ['ionescu77.staging.avproiect.com'] -INSTALLED_APPS += ( - 'landing', - 'blogengine', - 'accounts', - 'django.contrib.sites', - 'django.contrib.flatpages', - 'django.contrib.syndication', - 'django.contrib.sitemaps', - 'crispy_forms', - 'axes', -) - SITE_ID = 1 #TEST_DATABASE_CHARSET=UTF8 #CHARSET=UTF8 # supported for PG and MySQL only -STATIC_ROOT = '/home/ionescu77/webapps/apollo7/ionescu77/static/' -MEDIA_ROOT = '/home/ionescu77/webapps/apollo7/ionescu77/media/' - CRISPY_TEMPLATE_PACK = 'bootstrap3' -AXES_VERBOSE = False - -AXES_LOCKOUT_TEMPLATE = 'lockout.html' +# /////// +# ------- django-axes: Settings for this: +AXES_VERBOSE = True +# ------- # From 7d19efa01c32f1cb8baea15193c35cd8800668db Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:41:33 +0300 Subject: [PATCH 05/13] Same as in develop, well have to go through merge conflict --- src/ionescu77v2Project/settings/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index 5a87c93e..7022a933 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -145,3 +145,8 @@ # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' + +# Added to handle static +# +STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static") +MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media") From da4ab0ec554acc12ef3bef64dd0b88c716045d2e Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:43:54 +0300 Subject: [PATCH 06/13] Hmm forgot to save file duplicates in installed apps --- src/ionescu77v2Project/settings/production.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ionescu77v2Project/settings/production.py b/src/ionescu77v2Project/settings/production.py index 28df8350..31a222f9 100644 --- a/src/ionescu77v2Project/settings/production.py +++ b/src/ionescu77v2Project/settings/production.py @@ -31,9 +31,6 @@ #TEST_DATABASE_CHARSET=UTF8 #CHARSET=UTF8 # supported for PG and MySQL only -STATIC_ROOT = '/home/ionescu77/webapps/apollo13/ionescu77/static/' -MEDIA_ROOT = '/home/ionescu77/webapps/apollo13/ionescu77/media/' - CRISPY_TEMPLATE_PACK = 'bootstrap3' # /////// From 1f131f4191f77d54bc52cf1891e0be6e0d1cba16 Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:48:43 +0300 Subject: [PATCH 07/13] Fix Application labels aren't unique, duplicates: landing --- src/ionescu77v2Project/settings/travis.py | 33 +---------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/ionescu77v2Project/settings/travis.py b/src/ionescu77v2Project/settings/travis.py index d79ffc96..c0d2165f 100644 --- a/src/ionescu77v2Project/settings/travis.py +++ b/src/ionescu77v2Project/settings/travis.py @@ -9,35 +9,11 @@ ALLOWED_HOSTS = ['127.0.0.1'] -INSTALLED_APPS += ( - 'landing', - 'blogengine', - 'accounts', - 'django.contrib.sites', - 'django.contrib.flatpages', - 'django.contrib.syndication', - 'django.contrib.sitemaps', - 'crispy_forms', - 'axes', -) - SITE_ID = 1 #TEST_DATABASE_CHARSET=UTF8 #CHARSET=UTF8 # supported for PG and MySQL only -# /////// -# ------- django-axes: CACHES enabled, 20181119 -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - }, - 'axes_cache': { - 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', - } -} -# ------- # - INSTALLED_APPS += ('django_jenkins',) JENKINS_TASKS = () @@ -47,12 +23,5 @@ # /////// # ------- django-axes: Settings for this: -AXES_CACHE = 'axes_cache' -AXES_VERBOSE = True -AXES_LOCKOUT_TEMPLATE = 'lockout.html' -AUTHENTICATION_BACKENDS = [ - 'axes.backends.AxesModelBackend', - 'django.contrib.auth.backends.ModelBackend', -] - +AXES_VERBOSE = False # ------- # From 051908b40df42d6679d7a3178d285c188087c935 Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 14:57:36 +0300 Subject: [PATCH 08/13] try to add to middlerware and use MIDDLEWARE instead of MIDDLEWARE_CLASSES --- src/ionescu77v2Project/settings/base.py | 26 +++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index 7022a933..422597f8 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -40,16 +40,34 @@ 'django.contrib.staticfiles', ) -MIDDLEWARE_CLASSES = ( +# MIDDLEWARE_CLASSES = ( +# 'django.contrib.sessions.middleware.SessionMiddleware', +# 'django.middleware.common.CommonMiddleware', +# 'django.middleware.csrf.CsrfViewMiddleware', +# 'django.contrib.auth.middleware.AuthenticationMiddleware', +# 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', +# 'django.contrib.messages.middleware.MessageMiddleware', +# 'django.middleware.clickjacking.XFrameOptionsMiddleware', +# 'django.middleware.security.SecurityMiddleware', +# ) + +MIDDLEWARE = [ + # The following is the list of default middleware in new Django projects. + 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django.middleware.security.SecurityMiddleware', -) + + # AxesMiddleware should be the last middleware in the MIDDLEWARE list. + # It only formats user lockout messages and renders Axes lockout responses + # on failed user authentication attempts from login views. + # If you do not want Axes to override the authentication response + # you can skip installing the middleware and use your own views. + 'axes.middleware.AxesMiddleware', +] ROOT_URLCONF = 'ionescu77v2Project.urls' From 38f4bbff63e3d00638183e7358ff2110180069f4 Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 15:01:00 +0300 Subject: [PATCH 09/13] fix module 'axes.backends' has no attribute 'AxesModelBackend' --- src/ionescu77v2Project/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index 422597f8..447c0732 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -152,7 +152,7 @@ AXES_VERBOSE = False AXES_LOCKOUT_TEMPLATE = 'lockout.html' AUTHENTICATION_BACKENDS = [ - 'axes.backends.AxesModelBackend', + 'axes.backends.AxesBackend', 'django.contrib.auth.backends.ModelBackend', ] From 6a5be5b3ff0bffeb95420a068ba653ec3c61ae9e Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 15:03:12 +0300 Subject: [PATCH 10/13] try to cache pip in travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8f581d54..d7ad002e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: python +cache: pip + python: # - "2.7.9" - "3.6.7" From a116db356ce3a28f2e5aac112135292076df9812 Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 15:33:40 +0300 Subject: [PATCH 11/13] static in wrong folder #69 --- src/ionescu77v2Project/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index 06176f48..e1b29f61 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -13,7 +13,7 @@ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Quick-start development settings - unsuitable for production From 3b050b4a1c7d09d0a8438ab9bab441d8584736b8 Mon Sep 17 00:00:00 2001 From: razgitbot Date: Sun, 31 May 2020 15:37:40 +0300 Subject: [PATCH 12/13] Try to fix travis build error --- src/ionescu77v2Project/settings/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ionescu77v2Project/settings/base.py b/src/ionescu77v2Project/settings/base.py index d323f4a4..4076f5e8 100644 --- a/src/ionescu77v2Project/settings/base.py +++ b/src/ionescu77v2Project/settings/base.py @@ -74,7 +74,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join(os.path.dirname(BASE_DIR), 'templates')], + 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ From a22450b264f87aa7892d3ae939684e1f1922d919 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2020 03:22:49 +0000 Subject: [PATCH 13/13] Bump psycopg2-binary from 2.8.4 to 2.8.5 Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.8.4 to 2.8.5. - [Release notes](https://github.com/psycopg/psycopg2/releases) - [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS) - [Commits](https://github.com/psycopg/psycopg2/commits) Signed-off-by: dependabot-preview[bot] --- requirements/production.txt | 2 +- requirements/test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/production.txt b/requirements/production.txt index ff1b9bf8..dae3e6d1 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,2 +1,2 @@ -r base.txt -psycopg2-binary==2.8.4 +psycopg2-binary==2.8.5 diff --git a/requirements/test.txt b/requirements/test.txt index d8c27cdc..febdf33c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ -r base.txt -psycopg2-binary==2.8.4 +psycopg2-binary==2.8.5 django-jenkins==0.110.0 factory-boy==2.12.0