Subject: Fixes for django 1.4

From: Christoph Berg <[email-masked]>
Date: Tue, 5 Mar 2013 15:41:28 +0100

I had to do some fixes to get the site running in django 1.4 (Debian
Wheezy). Patch is attached.

Christoph
-- 
[email-masked] | http://www.df7cb.de/
diff --git a/pgweb/core/feeds.py b/pgweb/core/feeds.py
index a182d13..3dbeea2 100644
--- a/pgweb/core/feeds.py
+++ b/pgweb/core/feeds.py
@@ -1,4 +1,4 @@
-from django.contrib.syndication.feeds import Feed
+from django.contrib.syndication.views import Feed
 
 from models import Version
 
diff --git a/pgweb/events/feeds.py b/pgweb/events/feeds.py
index 1c6e2b8..5326bf6 100644
--- a/pgweb/events/feeds.py
+++ b/pgweb/events/feeds.py
@@ -1,4 +1,4 @@
-from django.contrib.syndication.feeds import Feed
+from django.contrib.syndication.views import Feed
 
 from models import Event
 
diff --git a/pgweb/news/feeds.py b/pgweb/news/feeds.py
index a67f1a5..f9ffb36 100644
--- a/pgweb/news/feeds.py
+++ b/pgweb/news/feeds.py
@@ -1,4 +1,4 @@
-from django.contrib.syndication.feeds import Feed
+from django.contrib.syndication.views import Feed
 
 from models import NewsArticle
 
diff --git a/pgweb/pwn/feeds.py b/pgweb/pwn/feeds.py
index d8e6eee..22c350b 100644
--- a/pgweb/pwn/feeds.py
+++ b/pgweb/pwn/feeds.py
@@ -1,4 +1,4 @@
-from django.contrib.syndication.feeds import Feed
+from django.contrib.syndication.views import Feed
 
 from models import PwnPost
 
diff --git a/pgweb/settings.py b/pgweb/settings.py
index c4e6958..88bdee0 100644
--- a/pgweb/settings.py
+++ b/pgweb/settings.py
@@ -9,12 +9,16 @@ ADMINS = (
 
 MANAGERS = ADMINS
 
-DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = ''             # Or path to database file if using sqlite3.
-DATABASE_USER = ''             # Not used with sqlite3.
-DATABASE_PASSWORD = ''         # Not used with sqlite3.
-DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
+DATABASES = {
+        'default': {
+            'ENGINE': 'django.db.backends.postgresql_psycopg2',           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+            'NAME': 'pgweb',             # Or path to database file if using sqlite3.
+            'USER': '',             # Not used with sqlite3.
+            'PASSWORD': '',         # Not used with sqlite3.
+            'HOST': '',             # Set to empty string for localhost. Not used with sqlite3.
+            'PORT': '',             # Set to empty string for default. Not used with sqlite3.
+        }
+}
 
 # Local time zone for this installation. Choices can be found here:
 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
@@ -52,9 +56,8 @@ SECRET_KEY = 'REALLYCHANGETHISINSETTINGS_LOCAL.PY'
 
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-#     'django.template.loaders.eggs.load_template_source',
+    'django.template.loaders.filesystem.Loader',
+    'django.template.loaders.app_directories.Loader',
 )
 
 MIDDLEWARE_CLASSES = [
@@ -75,7 +78,7 @@ TEMPLATE_DIRS = (
 )
 
 TEMPLATE_CONTEXT_PROCESSORS = (
-	'django.core.context_processors.auth',
+	'django.contrib.auth.context_processors.auth',
 	'django.core.context_processors.media',
 	'util.contexts.RootLinkContextProcessor',
 )

-- 
Sent via pgsql-www mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-www

---

From: Magnus Hagander <[email-masked]>
Date: Tue, 5 Mar 2013 15:42:40 +0100

> Wheezy). Patch is attached.

Have you verified that it still works on 1.2, or do we need to
validate this before applying anything?

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

---

From: Christoph Berg <[email-masked]>
Date: Tue, 5 Mar 2013 15:51:10 +0100

Re: Magnus Hagander 2013-03-05 <[email-masked]>
> validate this before applying anything?

Maybe it also works with 1.2, I haven't tried it. As discussed on irc
some time ago, I [*] think these are incompatible changes. I just
wanted to post the patch here so others don't have to do the same
changes.

Christoph

[*] Actually you said these caused deprecation warnings in 1.3
-- 
[email-masked] | http://www.df7cb.de/

---

From: Magnus Hagander <[email-masked]>
Date: Tue, 5 Mar 2013 15:53:01 +0100

> wanted to post the patch here so others don't have to do the same

Ok - but testing definitely needed then :)

---

From: Magnus Hagander <[email-masked]>
Date: Tue, 5 Mar 2013 17:01:27 +0100

> Ok - but testing definitely needed then :)

Looking at the patch, the feeds part looks like it should be backwards
compatible.

As for the settings - you can/should just use settings_local.py to
override that one, so the patch shouldn't be necessary.

The things about template loaders and context processors definitely
need to be tested, I haven't touched that stuff before so I have no
idea how backwards compat it would be.