From 8941c1c837b5a23710d522b8dfb2cba073e6ed6f Mon Sep 17 00:00:00 2001 From: Guillermo Brachetta Date: Tue, 22 Dec 2020 22:06:09 +0100 Subject: [PATCH 1/3] Add dj-database-url dependency for postgres to work --- Pipfile | 1 + Pipfile.lock | 27 ++++++++++++++------------- main/settings.py | 5 +++-- requirements.txt | 1 + 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Pipfile b/Pipfile index 55f353c7..c8b5512b 100644 --- a/Pipfile +++ b/Pipfile @@ -26,6 +26,7 @@ requests-oauthlib = "==1.3.0" sqlparse = "==0.3.1" urllib3 = "==1.25.10" Django = "==3.1.1" +dj-database-url = "==0.5.0" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index fd73ab4f..dd7a5fc7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "17d3e97b35c433d439123d980b7f720ee6c0df7c8f4f0bb6063f8c282e335991" + "sha256": "d45cbd7f9eec6b53b2a4c6c76f452e0f564b193709e8ab023f1fc022e08647da" }, "pipfile-spec": 6, "requires": { @@ -48,6 +48,14 @@ "index": "pypi", "version": "==0.6.0" }, + "dj-database-url": { + "hashes": [ + "sha256:4aeaeb1f573c74835b0686a2b46b85990571159ffc21aa57ecd4d1e1cb334163", + "sha256:851785365761ebe4994a921b433062309eb882fedd318e1b0fcecc607ed02da9" + ], + "index": "pypi", + "version": "==0.5.0" + }, "django": { "hashes": [ "sha256:59c8125ca873ed3bdae9c12b146fbbd6ed8d0f743e4cf5f5817af50c51f1fc2f", @@ -161,14 +169,6 @@ "index": "pypi", "version": "==1.5.4" }, - "colorama": { - "hashes": [ - "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b", - "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2" - ], - "markers": "sys_platform == 'win32'", - "version": "==0.4.4" - }, "isort": { "hashes": [ "sha256:dcab1d98b469a12a1a624ead220584391648790275560e1a43e54c5dceae65e7", @@ -255,15 +255,16 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "toml": { "hashes": [ - "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f", - "sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88" + "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", + "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" ], - "version": "==0.10.1" + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==0.10.2" }, "wrapt": { "hashes": [ diff --git a/main/settings.py b/main/settings.py index c02acf98..d86e871b 100644 --- a/main/settings.py +++ b/main/settings.py @@ -1,4 +1,5 @@ import os +import dj_database_url if os.path.exists(".env"): from dotenv import load_dotenv load_dotenv() @@ -91,7 +92,7 @@ ACCOUNT_SIGNUP_FORM_CLASS = "accounts.forms.SignupForm" ACCOUNT_AUTHENTICATION_METHOD = "email" ACCOUNT_EMAIL_VERIFICATION = "mandatory" -ACCOUNT_EMAIL_REQUIRED=True +ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_USERNAME_REQUIRED = False ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_SIGNUP_EMAIL_ENTER_TWICE = True @@ -143,7 +144,7 @@ STATICFILES_LOCATION = "static" STATIC_URL = "/static/" -STATICFILES_DIRS = [os.path.join(BASE_DIR, "static"),] +STATICFILES_DIRS = [os.path.join(BASE_DIR, "static"), ] STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") MEDIAFILES_LOCATION = "media" diff --git a/requirements.txt b/requirements.txt index f04594c7..e4907535 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ defusedxml==0.6.0 Django==3.1.1 django-allauth==0.42.0 django-crispy-forms==1.9.2 +dj-database-url==0.5.0 idna==2.10 oauthlib==3.1.0 python-dotenv==0.14.0 From af64bae75efc3fe09406f4996ec34dde292f8877 Mon Sep 17 00:00:00 2001 From: Guillermo Brachetta Date: Tue, 22 Dec 2020 22:07:04 +0100 Subject: [PATCH 2/3] Add jQuery-ui for accordion to work --- templates/base.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/base.html b/templates/base.html index 30fc5e01..cd655cc5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -69,5 +69,7 @@ {% endblock %} + From 16c394c4586ef1d49efd1b8e6d8500b59230efda Mon Sep 17 00:00:00 2001 From: Guillermo Brachetta Date: Wed, 23 Dec 2020 00:38:22 +0100 Subject: [PATCH 3/3] Delete unnecessary .accordion() call in script.js and therefore redundant script import in base.html. --- static/js/script.js | 4 ---- templates/base.html | 2 -- 2 files changed, 6 deletions(-) diff --git a/static/js/script.js b/static/js/script.js index e28f0ee0..e386c3f5 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -62,7 +62,3 @@ $("#enroll-form").on("submit", function (ev) { // Fires the main fetch function enroll(formData, formUrl); }); - -$(document).ready(function(){ - $( "#accordion" ).accordion(); -}); diff --git a/templates/base.html b/templates/base.html index cd655cc5..30fc5e01 100644 --- a/templates/base.html +++ b/templates/base.html @@ -69,7 +69,5 @@ {% endblock %} -