From 68b12786dbec7a0554938874fa027ab0c8498dad Mon Sep 17 00:00:00 2001 From: Yash Raj Date: Sun, 12 Jun 2022 15:54:00 +0530 Subject: [PATCH 1/3] setup --- Pipfile | 8 ++++- Pipfile.lock | 67 ---------------------------------------- Procfile | 1 + locallibrary/settings.py | 16 ++++++---- runtime.txt | 1 + 5 files changed, 19 insertions(+), 74 deletions(-) delete mode 100644 Pipfile.lock create mode 100644 Procfile create mode 100644 runtime.txt diff --git a/Pipfile b/Pipfile index 26ee535..448de0c 100644 --- a/Pipfile +++ b/Pipfile @@ -1,10 +1,16 @@ [[source]] -url = "https://pypi.org/simple" +url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" [packages] +asgiref = "*" +"backports.zoneinfo" = "*" django = "*" +sqlparse = "*" +gunicorn = "*" +psycopg2 = "*" +whitenoise = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index b49a4d3..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "99c4b9ec1b8891ff787677276760beb6d6d4919c55660da1c713682156a6086c" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.8" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "asgiref": { - "hashes": [ - "sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9", - "sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214" - ], - "markers": "python_version >= '3.6'", - "version": "==3.4.1" - }, - "backports.zoneinfo": { - "hashes": [ - "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf", - "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328", - "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546", - "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6", - "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570", - "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9", - "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7", - "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987", - "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722", - "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582", - "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc", - "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b", - "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1", - "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08", - "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac", - "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2" - ], - "markers": "python_version < '3.9'", - "version": "==0.2.1" - }, - "django": { - "hashes": [ - "sha256:59304646ebc6a77b9b6a59adc67d51ecb03c5e3d63ed1f14c909cdfda84e8010", - "sha256:d5a8a14da819a8b9237ee4d8c78dfe056ff6e8a7511987be627192225113ee75" - ], - "index": "pypi", - "version": "==4.0" - }, - "sqlparse": { - "hashes": [ - "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae", - "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d" - ], - "markers": "python_version >= '3.5'", - "version": "==0.4.2" - } - }, - "develop": {} -} \ No newline at end of file diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..b736716 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn locallibrary.wsgi --log-file - \ No newline at end of file diff --git a/locallibrary/settings.py b/locallibrary/settings.py index 3013385..56778bf 100644 --- a/locallibrary/settings.py +++ b/locallibrary/settings.py @@ -24,9 +24,9 @@ SECRET_KEY = 'django-insecure-5v%hee4=2+b)48@dq006tmga5--yu8p3*5ye3*q8a(-4goyoq*' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['local-library-djangoyt.herokuapp.com'] # Application definition @@ -78,8 +78,12 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': '', + 'HOST': '', + 'PORT': '', + 'USER': '', + 'PASSWORD': '' } } @@ -108,11 +112,11 @@ LANGUAGE_CODE = 'en-us' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Asia/Kolkata' USE_I18N = True -USE_TZ = True +USE_TZ = False LOGIN_REDIRECT_URL = '/' diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 0000000..e1958b9 --- /dev/null +++ b/runtime.txt @@ -0,0 +1 @@ +python-3.8.13 \ No newline at end of file From 7c1114394403581f8efeb0d4619641886d8a8214 Mon Sep 17 00:00:00 2001 From: Yash Raj Date: Sun, 12 Jun 2022 15:58:23 +0530 Subject: [PATCH 2/3] postgresql configured --- locallibrary/settings.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/locallibrary/settings.py b/locallibrary/settings.py index 56778bf..d68fb94 100644 --- a/locallibrary/settings.py +++ b/locallibrary/settings.py @@ -79,15 +79,14 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'NAME': '', - 'HOST': '', - 'PORT': '', - 'USER': '', - 'PASSWORD': '' + 'NAME': 'd39k8gs6eh3n7m', + 'HOST': 'ec2-54-227-248-71.compute-1.amazonaws.com', + 'PORT': '5432', + 'USER': 'kbanxbkiramwxe', + 'PASSWORD': 'f73a8b97930270899ec6ee1f02959ca783f491a98e4d44c0afdc369b2f1b22d0' } } - # Password validation # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators From 85cd3a52ea42aceca0d84c4c44bd9ec8bf5a862f Mon Sep 17 00:00:00 2001 From: Yash Raj Date: Sun, 12 Jun 2022 16:03:34 +0530 Subject: [PATCH 3/3] fixed whitenoise --- locallibrary/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/locallibrary/settings.py b/locallibrary/settings.py index d68fb94..3eb2470 100644 --- a/locallibrary/settings.py +++ b/locallibrary/settings.py @@ -50,6 +50,7 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', ] ROOT_URLCONF = 'locallibrary.urls'