From 9601776aa938b206829c7b302714bdcb18ff9563 Mon Sep 17 00:00:00 2001 From: Shgck Date: Tue, 15 Aug 2017 15:26:13 +0200 Subject: [PATCH] Move to PostgreSQL --- idre/settings.py | 8 ++++++-- idre/urls.py | 11 ++++------- requirements.txt | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/idre/settings.py b/idre/settings.py index e12828b..173d6c8 100644 --- a/idre/settings.py +++ b/idre/settings.py @@ -48,8 +48,12 @@ WSGI_APPLICATION = 'idre.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'idre', + 'HOST': '', + 'PORT': '5432', + 'USER': '', + 'PASSWORD': '', } } diff --git a/idre/urls.py b/idre/urls.py index f640ca3..0a211ca 100644 --- a/idre/urls.py +++ b/idre/urls.py @@ -1,8 +1,8 @@ +from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin -import idre.settings import idre.views import label.urls import news.urls @@ -11,14 +11,11 @@ admin.autodiscover() urlpatterns = ( - [ url(r"^about/$", idre.views.about_view, name = "about") ] + + [ url(r"^about/$", idre.views.about_view, name="about") ] + label.urls.urlpatterns + news.urls.urlpatterns + [ url(r"^admin/", include(admin.site.urls)) ] ) -if idre.settings.DEBUG: - urlpatterns += static( - idre.settings.MEDIA_URL, - document_root = idre.settings.MEDIA_ROOT - ) +if settings.DEBUG: + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/requirements.txt b/requirements.txt index 2a91eb7..1244751 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ django == 1.11 +psycopg2 == 2.7.1 markdown Pillow