summaryrefslogtreecommitdiffabout
authorWojciech Polak <polak@gnu.org>2013-04-09 15:15:27 (GMT)
committer Wojciech Polak <polak@gnu.org>2013-04-09 15:15:27 (GMT)
commit317e91945d67c9e7af30e45f898f17cd67fef86c (patch) (side-by-side diff)
treed172df42e7a0888ef447c01abd9c62d146b844fc
parent399f45551aa3ac0c9f8e3f52c6436816af50be8b (diff)
downloadglifestream-317e91945d67c9e7af30e45f898f17cd67fef86c.tar.gz
glifestream-317e91945d67c9e7af30e45f898f17cd67fef86c.tar.bz2
Support Django 1.5.x.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--INSTALL.md (renamed from INSTALL)125
-rw-r--r--README.md3
-rw-r--r--bookmarklet/templates/frame.html2
-rw-r--r--bookmarklet/urls.py4
-rw-r--r--gauth/models.py9
-rw-r--r--gauth/templates/login.html4
-rw-r--r--gauth/templates/openid.html4
-rw-r--r--gauth/urls.py4
-rw-r--r--requirements.txt10
-rw-r--r--settings-sample.py41
-rw-r--r--stream/models.py4
-rw-r--r--stream/templatetags/media.py4
-rw-r--r--templates/base.html22
-rw-r--r--templates/stream-pure.html3
-rw-r--r--templates/stream.html12
-rw-r--r--urls.py4
-rw-r--r--usettings/templates/oauth.html2
-rw-r--r--usettings/templates/oid.html4
-rw-r--r--usettings/templates/pshb.html4
-rw-r--r--usettings/templates/services.html6
-rw-r--r--usettings/templates/settings.html12
-rw-r--r--usettings/urls.py8
-rw-r--r--wsgi.py (renamed from glifestream.wsgi)10
23 files changed, 160 insertions, 141 deletions
diff --git a/INSTALL b/INSTALL.md
index fd14079..1130478 100644
--- a/INSTALL
+++ b/INSTALL.md
@@ -1,10 +1,10 @@
gLifestream -- INSTALL
-Copyright (C) 2009, 2010, 2011 Wojciech Polak
+Copyright (C) 2009, 2010, 2011, 2013 Wojciech Polak
-* gLifestream requirements
-==========================
+gLifestream requirements
+========================
-- Django 1.2 or later -- a Python Web framework (http://www.djangoproject.com/)
+- Django 1.4 or later -- a Python Web framework (http://www.djangoproject.com/)
- A database supported by Django (e.g. MySQL, PostgreSQL).
- Universal Feed Parser (http://www.feedparser.org/)
@@ -17,7 +17,7 @@ Optional (but recommended):
http://code.google.com/p/workerpool/
- python-oauth2 -- Python OAuth library
- http://github.com/simplegeo/python-oauth2
+ https://github.com/simplegeo/python-oauth2
- python-markdown -- a text-to-HTML converter
http://pypi.python.org/pypi/Markdown/
@@ -25,112 +25,89 @@ Optional (but recommended):
- Beautiful Soup -- an HTML parser
http://www.crummy.com/software/BeautifulSoup/
-- django-sphinx -- http://github.com/dcramer/django-sphinx
+- django-sphinx -- https://github.com/dcramer/django-sphinx
- Sphinx -- a free open-source SQL full-text search engine
http://www.sphinxsearch.com/
Optional:
-- Facebook Platform Python SDK
- http://github.com/facebook/python-sdk/
+- Facebook Python SDK
+ https://github.com/pythonforfacebook/facebook-sdk
- python-openid -- OpenID support for servers and consumers.
http://openidenabled.com/python-openid/
-* Installation instructions
-===========================
-1. Change the current working directory into the `glifestream' directory.
-2. Copy `settings-sample.py' to `settings.py' and edit your local site
+Installation instructions
+=========================
+
+1. Change the current working directory into the `glifestream` directory.
+2. Copy `settings-sample.py` to `settings.py` and edit your local site
configuration.
-3. Run `python manage.py syncdb'
-4. Run `python manage.py compilemessages' (if you have `gettext' installed)
-5. Run `./worker.py --init-files-dirs'
+3. Run `python manage.py syncdb`
+4. Run `python manage.py compilemessages` (if you have 'gettext' installed)
+5. Run `./worker.py --init-files-dirs`
-Make sure that `static/thumbs/*' and `static/upload' directories exist
+Make sure that `static/thumbs/*` and `static/upload` directories exist
and all have write permissions by your webserver.
-Use `glifestream/worker.py' to automatically fetch external streams
+Use `glifestream/worker.py` to automatically fetch external streams
(via cron), list available streams or remove old entries. See
-`worker.py --help'.
+`worker.py --help`.
-** The development/test server
-------------------------------
+The development/test server
+---------------------------
-Change the current working directory into the `glifestream' directory
-and run the command `python manage.py runserver'. You will see
+Change the current working directory into the `glifestream` directory
+and run the command `python manage.py runserver`. You will see
the following output:
- Validating models...
- 0 errors found.
+ Validating models...
+ 0 errors found.
+
+ Django version 1.5.1, using settings 'glifestream.settings'
+ Development server is running at http://127.0.0.1:8000/
+ Quit the server with CONTROL-C.
- Django version 1.2.3, using settings 'glifestream.settings'
- Development server is running at http://127.0.0.1:8000/
- Quit the server with CONTROL-C.
-
-** Production server with mod_wsgi
-----------------------------------
+Production server with mod_wsgi
+-------------------------------
Apache configuration:
+`
LoadModule wsgi_module modules/mod_wsgi.so
- WSGIScriptAlias / /usr/local/django/glifestream/glifestream.wsgi
+ WSGIScriptAlias / /usr/local/django/glifestream/wsgi.py
Alias /static "/usr/local/django/glifestream/static"
Alias /admin_static "/usr/local/django/contrib/admin/media"
<Directory "/usr/local/django/glifestream/">
<IfModule mod_deflate.c>
- AddOutputFilterByType DEFLATE application/x-javascript text/css
+ AddOutputFilterByType DEFLATE application/javascript text/css text/html
</IfModule>
AllowOverride All
Options None
Order allow,deny
Allow from all
</Directory>
+`
More detailed information is available at:
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
-** Production server with mod_python
-------------------------------------
+See https://docs.djangoproject.com/en/dev/howto/deployment/
+for usual Django applications deployment.
-Apache configuration:
- LoadModule python_module modules/mod_python.so
- <Location "/">
- SetHandler python-program
- PythonHandler django.core.handlers.modpython
- PythonPath "sys.path + ['/usr/local/django', '/usr/local/django/glifestream']"
- SetEnv DJANGO_SETTINGS_MODULE glifestream.settings
- PythonInterpreter glifestream
- PythonDebug Off
- </Location>
-
- <Location "/static">
- SetHandler None
- </Location>
- <Location "/favicon.ico">
- SetHandler None
- </Location>
-
- <Directory "/usr/local/django/glifestream/">
- AllowOverride All
- Options None
- Order allow,deny
- Allow from all
- </Directory>
-
-
-** The search functionality via Sphinx
---------------------------------------
+The search functionality via Sphinx
+===================================
To use the search functionality in GLS via Sphinx, you must add the
-following configuration to your `etc/sphinx.conf' (replace the
-DATABASE_* values with the proper ones from your settings.py):
+following configuration to your `etc/sphinx.conf` (replace the
+`DATABASE_*` values with the proper ones from your `settings.py`):
-...
+`...
source glifestream
{
type = mysql
@@ -161,21 +138,15 @@ index glifestream
charset_type = utf-8
html_strip = 1
}
-...
+...`
-** Receive postings via e-mail
-------------------------------
+Receive postings via e-mail
+===========================
To allow for posts sent by e-mail, create a secret mail alias,
-by extending /etc/mail/aliases file:
+by extending `/etc/mail/aliases` file:
+`
gls.secret.address: "|/usr/local/django/glifestream/worker.py --email2post"
-
-
-
-Local Variables:
-mode: outline
-paragraph-separate: "[ ]*$"
-version-control: never
-End:
+`
diff --git a/README.md b/README.md
index 24a8e29..70424ca 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,9 @@ gLifestream
gLifestream is a free lifestream platform and social activity reader.
It is licensed under GPLv3.
+Introduction
+------------
+
gLifestream joins several external and/or internal streams into a
single one. External streams may be represented by RSS/Atom channels
or popular services such as Twitter or Facebook. The user decides
diff --git a/bookmarklet/templates/frame.html b/bookmarklet/templates/frame.html
index c6c335c..c4c4480 100644
--- a/bookmarklet/templates/frame.html
+++ b/bookmarklet/templates/frame.html
@@ -4,7 +4,7 @@
<head>
<title>Bookmarklet</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" type="text/css" href="{% static %}/themes/default/style.css">
+ <link rel="stylesheet" type="text/css" href="{% static %}themes/default/style.css">
<script type="text/javascript" src="{% static_hash js/jquery.js %}"></script>
<style type="text/css">
diff --git a/bookmarklet/urls.py b/bookmarklet/urls.py
index 9e23c01..8611725 100644
--- a/bookmarklet/urls.py
+++ b/bookmarklet/urls.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2010 Wojciech Polak
+# gLifestream Copyright (C) 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from glifestream.bookmarklet import views
urlpatterns = patterns(
diff --git a/gauth/models.py b/gauth/models.py
index f4e22a7..b34b52d 100644
--- a/gauth/models.py
+++ b/gauth/models.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2010 Wojciech Polak
+# gLifestream Copyright (C) 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -31,11 +31,10 @@ class OAuthClient (models.Model):
token_secret = models.CharField('Token secret', max_length=128,
null=True, blank=True)
request_token_url = models.URLField('Request Token URL', null=True,
- blank=True, verify_exists=False)
+ blank=True)
access_token_url = models.URLField('Access Token URL', null=True,
- blank=True, verify_exists=False)
- authorize_url = models.URLField('Authorize URL', null=True, blank=True,
- verify_exists=False)
+ blank=True)
+ authorize_url = models.URLField('Authorize URL', null=True, blank=True)
class Meta:
verbose_name = 'OAuth'
diff --git a/gauth/templates/login.html b/gauth/templates/login.html
index 19267e8..da09087 100644
--- a/gauth/templates/login.html
+++ b/gauth/templates/login.html
@@ -1,12 +1,12 @@
{% extends "base.html" %}
-{% load i18n %}
+{% load i18n %}{% load url from future %}
{% block main %}
<section id="login">
<div id="loginbox">
{% if form.errors %}<p class="error">{% trans "Invalid username or password" %}</p>{% endif %}
-<form name="loginform" method="post" action="{% url glifestream.gauth.views.login %}">
+<form name="loginform" method="post" action="{% url 'glifestream.gauth.views.login' %}">
<p>
<label>{% trans "Username" %}<br />
<input type="text" name="username" id="username" size="20" />
diff --git a/gauth/templates/openid.html b/gauth/templates/openid.html
index 3ec9bc8..856c978 100644
--- a/gauth/templates/openid.html
+++ b/gauth/templates/openid.html
@@ -1,12 +1,12 @@
{% extends "base.html" %}
-{% load i18n %}
+{% load i18n %}{% load url from future %}
{% block main %}
<section id="login">
<div id="loginbox">
{% if page.msg %}<p class="error">{{ page.msg }}</p>{% endif %}
-<form name="loginform" method="post" action="{% url glifestream.gauth.views.openid %}">
+<form name="loginform" method="post" action="{% url 'glifestream.gauth.views.openid' %}">
<p>
<label>{% trans "OpenID" %}<br />
<input type="text" name="openid_identifier" id="openid_identifier" maxlength="128" />
diff --git a/gauth/urls.py b/gauth/urls.py
index 20023e1..d8c1a71 100644
--- a/gauth/urls.py
+++ b/gauth/urls.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2010 Wojciech Polak
+# gLifestream Copyright (C) 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
from glifestream.gauth import views
urlpatterns = patterns(
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..db62f77
--- a/dev/null
+++ b/requirements.txt
@@ -0,0 +1,10 @@
+Django >=1.4.5
+MySQL-python >=1.2.3
+feedparser
+PIL >=1.1.6
+workerpool
+python-openid >=2.2.5
+oauth2 >=1.5,<1.5.999
+django-sphinx
+markdown
+BeautifulSoup
diff --git a/settings-sample.py b/settings-sample.py
index e296cde..aee495c 100644
--- a/settings-sample.py
+++ b/settings-sample.py
@@ -22,7 +22,7 @@ DATABASES = {
}
}
-TIME_ZONE = 'Europe/Warsaw'
+TIME_ZONE = 'UTC'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
@@ -32,7 +32,13 @@ SESSION_COOKIE_NAME = 'glifestream_sid'
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
# Caching, see http://docs.djangoproject.com/en/dev/topics/cache/#topics-cache
-CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
+CACHES = {
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+ 'LOCATION': '127.0.0.1:11211',
+ 'KEY_PREFIX': 'gls',
+ },
+}
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
# Site base URL (without a trailing slash).
@@ -53,7 +59,7 @@ MEDIA_ROOT = os.path.join(SITE_ROOT, 'static')
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
# Setting an absolute URL is recommended in a production use.
-MEDIA_URL = '/static'
+MEDIA_URL = '/static/'
# URL prefix for admin media. Make sure to use a trailing slash.
# Examples: "http://foo.com/media/", "/media/".
@@ -99,6 +105,35 @@ INSTALLED_APPS = (
'glifestream.bookmarklet',
)
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error when DEBUG=False.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
+ 'handlers': {
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'filters': ['require_debug_false'],
+ 'class': 'django.utils.log.AdminEmailHandler'
+ }
+ },
+ 'loggers': {
+ 'django.request': {
+ 'handlers': ['mail_admins'],
+ 'level': 'ERROR',
+ 'propagate': True,
+ },
+ }
+}
+
# A shortcut icon URL (favicon).
FAVICON = '/favicon.ico'
diff --git a/stream/models.py b/stream/models.py
index f89dbab..ec4c492 100644
--- a/stream/models.py
+++ b/stream/models.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2009, 2010 Wojciech Polak
+# gLifestream Copyright (C) 2009, 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -40,7 +40,7 @@ class Service (models.Model):
creds = models.CharField(_('Credentials'), max_length=128, null=True,
blank=True)
name = models.CharField(_('Short name'), max_length=48)
- link = models.URLField(_('WWW Link'), verify_exists=False, blank=True)
+ link = models.URLField(_('WWW Link'), blank=True)
etag = models.CharField('ETag', max_length=64, blank=True)
last_modified = models.DateTimeField(_('Last modified'), null=True,
blank=True)
diff --git a/stream/templatetags/media.py b/stream/templatetags/media.py
index b653a08..2e8299f 100644
--- a/stream/templatetags/media.py
+++ b/stream/templatetags/media.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2009, 2010 Wojciech Polak
+# gLifestream Copyright (C) 2009, 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -51,7 +51,7 @@ class MediaUrlHash (template.Node):
url = settings.MEDIA_URL
if 'is_secure' in ctx and ctx['is_secure']:
url = url.replace('http://', 'https://')
- url += '/' + self.path
+ url += self.path
if self.hash:
url += '?v=' + self.hash
return url
diff --git a/templates/base.html b/templates/base.html
index 5ffd51d..2913474 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,4 +1,4 @@
-{% load i18n media %}<!DOCTYPE html>
+{% load i18n media %}{% load url from future %}<!DOCTYPE html>
<html>
<head>
@@ -9,8 +9,8 @@
<meta name="generator" content="gLifestream">
<meta name="robots" content="{{ page.robots }}">
<link rel="shortcut icon" href="{{ page.favicon }}">
- <link rel="alternate" type="application/atom+xml" title="Webfeed" href="{% if page.exactentry %}{% url index %}{% endif %}?format=atom">
- <link rel="stylesheet" type="text/css" href="{% static %}/themes/{% firstof page.theme "default" %}/style.css">
+ <link rel="alternate" type="application/atom+xml" title="Webfeed" href="{% if page.exactentry %}{% url 'index' %}{% endif %}?format=atom">
+ <link rel="stylesheet" type="text/css" href="{% static %}themes/{% firstof page.theme "default" %}/style.css">
<script type="text/javascript" src="{% static_hash js/jquery.js %}"></script>
<script type="text/javascript" src="{% static_hash js/glifestream.js %}"></script>{% if authed %}
<script type="text/javascript" src="{% static_hash js/tiny_mce/tiny_mce.js %}"></script>{% endif %}
@@ -23,20 +23,20 @@
<nav id="navtop" class="tb">
{% if authed %}
<span class="text">{% trans "Hello" %} <b>{{ user.email }}</b></span> |
- <a href="{% url index %}" title="{% trans "My private stream" %}">{% trans "Home" %}</a> |
- <a href="{% url public %}" title="{% trans "My publicly visible stream" %}" accesskey="2">{% trans "Public" %}</a> |
- {% if user.is_staff %}<a href="{% url settings %}">{% trans "Settings" %}</a> |{% endif %}
- <a href="{% url django.contrib.auth.views.logout %}">{% trans "Logout" %}</a>
+ <a href="{% url 'index' %}" title="{% trans "My private stream" %}">{% trans "Home" %}</a> |
+ <a href="{% url 'public' %}" title="{% trans "My publicly visible stream" %}" accesskey="2">{% trans "Public" %}</a> |
+ {% if user.is_staff %}<a href="{% url 'settings' %}">{% trans "Settings" %}</a> |{% endif %}
+ <a href="{% url 'django.contrib.auth.views.logout' %}">{% trans "Logout" %}</a>
{% else %}
{% if friend %}<span class="text">{% trans "Hello" %}
<a href="{{ user.fb_profile_url }}" target="_blank"><b>{{ user.fb_username }}</b></a></span> |
- <a href="{% url django.contrib.auth.views.logout %}">{% trans "Logout" %}</a>
+ <a href="{% url 'django.contrib.auth.views.logout' %}">{% trans "Logout" %}</a>
{% else %}
{% if page.login_url %}<a href="{{ page.login_url }}" rel="nofollow">{% trans "Login" %}</a>{% endif %}
{% endif %}
{% endif %}
</nav>
- <h1 class="tb"><a href="{% url index %}" accesskey="1">{% trans "The Stream" %}</a></h1>
+ <h1 class="tb"><a href="{% url 'index' %}" accesskey="1">{% trans "The Stream" %}</a></h1>
</header>
{% block sidebar %}{% endblock sidebar %}
@@ -54,7 +54,7 @@
<div id="fb-root"></div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
-function fb_login_friend () { window.location = '{% url gauth.views.login_friend %}'; }
+function fb_login_friend () { window.location = '{% url "gauth.views.login_friend" %}'; }
$(document).ready (function () {
FB.init ({appId: '{{ page.fb_app_id }}', status: true, cookie: true, xfbml: true});
});
@@ -62,7 +62,7 @@ $(document).ready (function () {
<script type="text/javascript">
var settings = {
- baseurl: '{% url index %}',
+ baseurl: '{% url "index" %}',
maps_engine: '{{ page.maps_engine }}',
themes: [{% for theme in page.themes %}'{{ theme }}'{% if not forloop.last %}, {% endif %}{% endfor %}]
};
diff --git a/templates/stream-pure.html b/templates/stream-pure.html
index 3aee469..7958859 100644
--- a/templates/stream-pure.html
+++ b/templates/stream-pure.html
@@ -1,4 +1,5 @@
{% load i18n media gls_filters %}
+{% load url from future %}
{% for entry in entries %}
<article id="entry-{{ entry.id }}" class="hentry e-{% firstof entry.service.cls entry.service.api %}{% if not entry.service.public %} private{% endif %}">
{% spaceless %}
@@ -39,7 +40,7 @@
{% endif %}
<li><span id="hide-{{ entry.id }}" class="link hide-control">{% trans "Hide" %}</span></li>
<li><span id="edit-{{ entry.id }}" class="link edit-control">{% trans "Edit" %}</span></li>
- <li><a href="{% url admin:index %}stream/entry/{{ entry.id }}" target="_blank">{% trans "Admin" %}</a></li>
+ <li><a href="{% url 'admin:index' %}stream/entry/{{ entry.id }}" target="_blank">{% trans "Admin" %}</a></li>
</ul>
{% endif %}
{% if not entry.friends_only %}<a href="#" id="shareit-{{ entry.id }}" class="shareit{% if authed %} reshareit{% endif %}" title="{% trans "Share or bookmark this entry" %}"><span>{% trans "Share" %}</span></a>{% endif %}
diff --git a/templates/stream.html b/templates/stream.html
index 5d433c2..2ceaa4e 100644
--- a/templates/stream.html
+++ b/templates/stream.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% load i18n %}
+{% load i18n %}{% load url from future %}
{% block sidebar %}
<aside id="sidebar">
@@ -9,12 +9,12 @@
</section>
<nav>
<ul class="services">
-{% for cls in classes %} <li><a href="{% if page.exactentry %}{% url index %}{% endif %}?class={% firstof cls.cls cls.api %}" class="e-{% firstof cls.cls cls.api %}" title="{{ cls.cls|capfirst }}" rel="nofollow"><span>{{ cls.cls|capfirst }}</span></a></li>
+{% for cls in classes %} <li><a href="{% if page.exactentry %}{% url 'index' %}{% endif %}?class={% firstof cls.cls cls.api %}" class="e-{% firstof cls.cls cls.api %}" title="{{ cls.cls|capfirst }}" rel="nofollow"><span>{{ cls.cls|capfirst }}</span></a></li>
{% endfor %} </ul>
<div class="clear bpadding"></div>
{% if authed %}
<ul class="links">
- <li><a href="{% url favorites %}" accesskey="3">{% trans "Favorite entries" %}</a></li>
+ <li><a href="{% url 'favorites' %}" accesskey="3">{% trans "Favorite entries" %}</a></li>
</ul>
{% if lists %}
<div class="lists">
@@ -32,7 +32,7 @@
<div id="calendar"></div>
</div>
{% if has_search %}<div class="search">
- <form name="searchform" action="{% ifequal page.ctx "public" %}{% url public %}{% else %}{% url index %}{% endifequal %}" method="get">
+ <form name="searchform" action="{% ifequal page.ctx "public" %}{% url 'public' %}{% else %}{% url 'index' %}{% endifequal %}" method="get">
<input type="search" name="s" value="{{ page.search }}" maxlength="64" placeholder="{% trans "Search this site" %}" /><span id="search-submit" title="{% trans "Search" %}"></span>
</form>
</div>{% endif %}
@@ -44,7 +44,7 @@
{% if authed %}
<aside id="share">
<span tabindex="0" class="link" id="ashare">{% trans "Add content" %}</span>
- <form action="{% url stream.views.api cmd='share' %}" method="post" enctype="multipart/form-data">
+ <form action="{% url 'stream.views.api' cmd='share' %}" method="post" enctype="multipart/form-data">
<div class="fieldset" style="display:none">
<h3><label for="status">{% trans "What's up?" %}</label></h3>
<div class="editor">
@@ -80,7 +80,7 @@
{% endif %}
<section id="stream" class="hfeed">
{% if page.subtitle %}
- <p class="subtitle">{{ page.subtitle|safe }}{% if page.month_next %} <a href="{% ifequal page.ctx "public" %}{% url public %}{% else %}{% if page.favorites %}{% url favorites %}{% else %}{% url index %}{% endif %}{% endifequal %}{{ page.month_next }}/" class="next" title="{% trans "next month" %}" rel="nofollow">&nbsp;</a>{% endif %}</p>
+ <p class="subtitle">{{ page.subtitle|safe }}{% if page.month_next %} <a href="{% ifequal page.ctx "public" %}{% url 'public' %}{% else %}{% if page.favorites %}{% url 'favorites' %}{% else %}{% url 'index' %}{% endif %}{% endifequal %}{{ page.month_next }}/" class="next" title="{% trans "next month" %}" rel="nofollow">&nbsp;</a>{% endif %}</p>
{% endif %}
{% if page.after %}
<nav class="pagination-top">
diff --git a/urls.py b/urls.py
index 865a67a..da6928b 100644
--- a/urls.py
+++ b/urls.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2009, 2010 Wojciech Polak
+# gLifestream Copyright (C) 2009, 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -14,7 +14,7 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
from django.conf import settings
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url, include
from django.contrib import admin
admin.autodiscover()
diff --git a/usettings/templates/oauth.html b/usettings/templates/oauth.html
index 34b4785..2b9f095 100644
--- a/usettings/templates/oauth.html
+++ b/usettings/templates/oauth.html
@@ -5,7 +5,7 @@
<title>{{ page.title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="{{ page.favicon }}">
- <link rel="stylesheet" type="text/css" href="{% static %}/themes/{% firstof page.theme "default" %}/style.css">
+ <link rel="stylesheet" type="text/css" href="{% static %}themes/{% firstof page.theme "default" %}/style.css">
<style type="text/css">
body { background-color: white; }
fieldset.aligned label { width: 10em !important; }
diff --git a/usettings/templates/oid.html b/usettings/templates/oid.html
index 8756609..47eb6a9 100644
--- a/usettings/templates/oid.html
+++ b/usettings/templates/oid.html
@@ -1,5 +1,5 @@
{% extends "settings.html" %}
-{% load i18n %}
+{% load i18n %}{% load url from future %}
{% block settings %}
<p class="bold">{% trans "Attached identities:" %}</p>
@@ -10,7 +10,7 @@
{% endfor %}
</ul>
- <form id="oid-form" method="post" action="{% url glifestream.usettings.views.openid %}">
+ <form id="oid-form" method="post" action="{% url 'glifestream.usettings.views.openid' %}">
<fieldset>
{% if page.msg %}
<ul class="errorlist">
diff --git a/usettings/templates/pshb.html b/usettings/templates/pshb.html
index d0ac455..ed02a54 100644
--- a/usettings/templates/pshb.html
+++ b/usettings/templates/pshb.html
@@ -1,5 +1,5 @@
{% extends "settings.html" %}
-{% load i18n %}
+{% load i18n %}{% load url from future %}
{% block settings %}
<p class="bold">{% trans "PubSubHubbub subscriptions" %}
@@ -31,7 +31,7 @@
{% endif %}
{% if services %}
- <form id="pshb-form" method="post" action="{% url glifestream.usettings.views.pshb %}">
+ <form id="pshb-form" method="post" action="{% url 'glifestream.usettings.views.pshb' %}">
<select name="subscribe">
<option value="">-- {% trans "service" %} --</option>
{% for s in services %}
diff --git a/usettings/templates/services.html b/usettings/templates/services.html
index 09b27e4..e51ac5b 100644
--- a/usettings/templates/services.html
+++ b/usettings/templates/services.html
@@ -1,5 +1,5 @@
{% extends "settings.html" %}
-{% load media i18n %}
+{% load media i18n %}{% load url from future %}
{% block settings %}
<p id="add-service">
@@ -24,11 +24,11 @@
</ul>
<p id="opml-form">
- <form action="{% url opml-import %}" method="post" enctype="multipart/form-data">
+ <form action="{% url 'opml-import' %}" method="post" enctype="multipart/form-data">
<input type="file" name="opml" />
<input type="submit" value="{% trans "Import OPML" %}"/>
{% trans "or" %}
- <a href="{% url opml-export %}">
+ <a href="{% url 'opml-export' %}">
{% trans "Export OPML" %}
</a>
<a href="http://www.wikipedia.org/wiki/OPML" target="_blank"
diff --git a/usettings/templates/settings.html b/usettings/templates/settings.html
index 850d44e..e383fef 100644
--- a/usettings/templates/settings.html
+++ b/usettings/templates/settings.html
@@ -1,14 +1,14 @@
{% extends "base.html" %}
-{% load i18n %}
+{% load i18n %}{% load url from future %}
{% block main %}
<section id="settings">
<ul class="tabs">
- <li><a href="{% url glifestream.usettings.views.services %}"{% ifequal page.menu "services" %} class="active"{% endifequal %}>{% trans "Services" %}</a></li>
- <li><a href="{% url glifestream.usettings.views.lists %}"{% ifequal page.menu "lists" %} class="active"{% endifequal %}>{% trans "Lists" %}</a></li>
- <li><a href="{% url glifestream.usettings.views.pshb %}"{% ifequal page.menu "pshb" %} class="active"{% endifequal %}>{% trans "PubSubHub" %}</a></li>
- <li><a href="{% url glifestream.usettings.views.openid %}"{% ifequal page.menu "openid" %} class="active"{% endifequal %}>{% trans "OpenID" %}</a></li>
- <li><a href="{% url glifestream.usettings.views.tools %}"{% ifequal page.menu "tools" %} class="active"{% endifequal %}>{% trans "Tools" %}</a></li>
+ <li><a href="{% url 'glifestream.usettings.views.services' %}"{% ifequal page.menu "services" %} class="active"{% endifequal %}>{% trans "Services" %}</a></li>
+ <li><a href="{% url 'glifestream.usettings.views.lists' %}"{% ifequal page.menu "lists" %} class="active"{% endifequal %}>{% trans "Lists" %}</a></li>
+ <li><a href="{% url 'glifestream.usettings.views.pshb' %}"{% ifequal page.menu "pshb" %} class="active"{% endifequal %}>{% trans "PubSubHub" %}</a></li>
+ <li><a href="{% url 'glifestream.usettings.views.openid' %}"{% ifequal page.menu "openid" %} class="active"{% endifequal %}>{% trans "OpenID" %}</a></li>
+ <li><a href="{% url 'glifestream.usettings.views.tools' %}"{% ifequal page.menu "tools" %} class="active"{% endifequal %}>{% trans "Tools" %}</a></li>
</ul>
{% block settings %}{% endblock %}
</section>
diff --git a/usettings/urls.py b/usettings/urls.py
index 60762ea..6758ab1 100644
--- a/usettings/urls.py
+++ b/usettings/urls.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2010 Wojciech Polak
+# gLifestream Copyright (C) 2010, 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -13,13 +13,13 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
+from django.views.generic.base import RedirectView
from glifestream.usettings import views
urlpatterns = patterns(
'',
- (r'^$', 'django.views.generic.simple.redirect_to',
- {'url': 'services'}, 'settings'),
+ url(r'^$', RedirectView.as_view(url='services'), name='settings'),
(r'api/(?P<cmd>[a-z\-]+)$', views.api),
(r'services$', views.services),
(r'services/import$', views.opml, {
diff --git a/glifestream.wsgi b/wsgi.py
index f6b245a..a1825a1 100644
--- a/glifestream.wsgi
+++ b/wsgi.py
@@ -1,4 +1,4 @@
-# gLifestream Copyright (C) 2009 Wojciech Polak
+# gLifestream Copyright (C) 2013 Wojciech Polak
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -16,9 +16,9 @@
import os
import sys
-SITE_ROOT = os.path.dirname (os.path.realpath (__file__))
+SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
os.environ['DJANGO_SETTINGS_MODULE'] = 'glifestream.settings'
-sys.path.insert (0, os.path.join (SITE_ROOT, '../'))
+sys.path.insert(0, os.path.join(SITE_ROOT, '../'))
-from django.core.handlers.wsgi import WSGIHandler
-application = WSGIHandler ()
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()

Return to:

Send suggestions and report system problems to the System administrator.