From 7d1bb201442a809034eada7bcecadd338da65ee1 Mon Sep 17 00:00:00 2001 From: RikSchoonbeek Date: Sun, 8 Apr 2018 17:41:40 +0200 Subject: [PATCH 1/6] Edited settings.py file for deployment --- .gitignore | 3 ++- CryptoCurrencyRestAPI/settings.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f5e96db..82195aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -venv \ No newline at end of file +venv +.idea \ No newline at end of file diff --git a/CryptoCurrencyRestAPI/settings.py b/CryptoCurrencyRestAPI/settings.py index ee3dc7d..613c1d4 100644 --- a/CryptoCurrencyRestAPI/settings.py +++ b/CryptoCurrencyRestAPI/settings.py @@ -25,7 +25,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['128.199.35.153',] # Application definition @@ -75,8 +75,12 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'CryptoCurrency', + 'USER': 'rik', + 'PASSWORD': 'ogD42y$Y8W', + 'HOST': 'localhost', + 'PORT': '', } } @@ -118,3 +122,4 @@ # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static/') From 07803977318407616e9351bb0f3505b50e776d80 Mon Sep 17 00:00:00 2001 From: RikSchoonbeek Date: Sun, 8 Apr 2018 17:50:42 +0200 Subject: [PATCH 2/6] Changed database name in settings.py --- CryptoCurrencyRestAPI/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CryptoCurrencyRestAPI/settings.py b/CryptoCurrencyRestAPI/settings.py index 613c1d4..6dc8f26 100644 --- a/CryptoCurrencyRestAPI/settings.py +++ b/CryptoCurrencyRestAPI/settings.py @@ -76,7 +76,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'CryptoCurrency', + 'NAME': 'cryptocurrency', 'USER': 'rik', 'PASSWORD': 'ogD42y$Y8W', 'HOST': 'localhost', From 45c54a236bdd93e824f1d7df6238de977a74f305 Mon Sep 17 00:00:00 2001 From: RikSchoonbeek Date: Wed, 11 Apr 2018 23:16:35 +0200 Subject: [PATCH 3/6] Edited settings.py: allowed_hosts and timezone --- CryptoCurrencyRestAPI/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CryptoCurrencyRestAPI/settings.py b/CryptoCurrencyRestAPI/settings.py index 6dc8f26..4b4111e 100644 --- a/CryptoCurrencyRestAPI/settings.py +++ b/CryptoCurrencyRestAPI/settings.py @@ -25,7 +25,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['128.199.35.153',] +ALLOWED_HOSTS = ['128.199.35.153'] # Application definition @@ -109,7 +109,7 @@ LANGUAGE_CODE = 'en-us' -TIME_ZONE = 'UTC' +TIME_ZONE = 'Europe/Amsterdam' USE_I18N = True From 11d11f8d698341ae66c5b0d78afbf26f7538fa90 Mon Sep 17 00:00:00 2001 From: RikSchoonbeek Date: Wed, 11 Apr 2018 23:26:07 +0200 Subject: [PATCH 4/6] Added allowed_hosts to wsgi.py --- CryptoCurrencyRestAPI/wsgi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CryptoCurrencyRestAPI/wsgi.py b/CryptoCurrencyRestAPI/wsgi.py index be8acce..5d53158 100644 --- a/CryptoCurrencyRestAPI/wsgi.py +++ b/CryptoCurrencyRestAPI/wsgi.py @@ -14,3 +14,5 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CryptoCurrencyRestAPI.settings") application = get_wsgi_application() + +ALLOWED_HOSTS = ['128.199.35.153'] From 275deb921c9ae9b780968b5084b9f676f2044a1b Mon Sep 17 00:00:00 2001 From: RikSchoonbeek Date: Sat, 14 Apr 2018 13:52:02 +0200 Subject: [PATCH 5/6] Edited ALLOWED_HOSTS in settings.py and wsgi.py --- CryptoCurrencyRestAPI/settings.py | 2 +- CryptoCurrencyRestAPI/wsgi.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CryptoCurrencyRestAPI/settings.py b/CryptoCurrencyRestAPI/settings.py index 4b4111e..1c25490 100644 --- a/CryptoCurrencyRestAPI/settings.py +++ b/CryptoCurrencyRestAPI/settings.py @@ -25,7 +25,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['128.199.35.153'] +ALLOWED_HOSTS = ['206.189.12.80'] # Application definition diff --git a/CryptoCurrencyRestAPI/wsgi.py b/CryptoCurrencyRestAPI/wsgi.py index 5d53158..be8acce 100644 --- a/CryptoCurrencyRestAPI/wsgi.py +++ b/CryptoCurrencyRestAPI/wsgi.py @@ -14,5 +14,3 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CryptoCurrencyRestAPI.settings") application = get_wsgi_application() - -ALLOWED_HOSTS = ['128.199.35.153'] From e9acc4d7235cf29a0d76cfab9f8aac19c3ee6fa0 Mon Sep 17 00:00:00 2001 From: RikSchoonbeek Date: Sat, 14 Apr 2018 14:24:44 +0200 Subject: [PATCH 6/6] Switched to sqlite3 --- CryptoCurrencyRestAPI/settings.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CryptoCurrencyRestAPI/settings.py b/CryptoCurrencyRestAPI/settings.py index 1c25490..8881470 100644 --- a/CryptoCurrencyRestAPI/settings.py +++ b/CryptoCurrencyRestAPI/settings.py @@ -75,12 +75,8 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'cryptocurrency', - 'USER': 'rik', - 'PASSWORD': 'ogD42y$Y8W', - 'HOST': 'localhost', - 'PORT': '', + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'mydatabase', } }