diff options
author | Wojciech Polak <polak@gnu.org> | 2019-09-10 17:57:03 +0200 |
---|---|---|
committer | Wojciech Polak <polak@gnu.org> | 2019-09-10 17:57:03 +0200 |
commit | 6ee2cdd2573866484089da12a892ed1c888b5dc6 (patch) | |
tree | 1aa384a19c98e28c5e3a63f3b66a2d7418ed75f9 | |
parent | ca0711ba17c457de6f8fba2c56e536c7f846dd2b (diff) | |
download | glifestream-6ee2cdd2573866484089da12a892ed1c888b5dc6.tar.gz glifestream-6ee2cdd2573866484089da12a892ed1c888b5dc6.tar.bz2 |
Upgrade codebase to Django 1.11
30 files changed, 205 insertions, 174 deletions
@@ -2,6 +2,11 @@ | |||
2 | *.pyc | 2 | *.pyc |
3 | *.pyo | 3 | *.pyo |
4 | *.mo | 4 | *.mo |
5 | *.iml | ||
6 | .idea/ | ||
7 | pip-selfcheck.json | ||
8 | pyvenv.cfg | ||
9 | venv*/ | ||
5 | bin/ | 10 | bin/ |
6 | include/ | 11 | include/ |
7 | lib/ | 12 | lib/ |
@@ -1,7 +1,7 @@ | |||
1 | Authors of gLifestream | 1 | Authors of gLifestream |
2 | ====================== | 2 | ====================== |
3 | 3 | ||
4 | Wojciech Polak (http://wojciechpolak.org/) | 4 | Wojciech Polak (https://wojciechpolak.org/) |
5 | 5 | ||
6 | 6 | ||
7 | This software is shipped with a third-party icon sets and software | 7 | This software is shipped with a third-party icon sets and software |
@@ -1,10 +1,10 @@ | |||
1 | gLifestream -- INSTALL | 1 | gLifestream -- INSTALL |
2 | Copyright (C) 2009-2015 Wojciech Polak | 2 | Copyright (C) 2009-2019 Wojciech Polak |
3 | 3 | ||
4 | gLifestream requirements | 4 | gLifestream requirements |
5 | ======================== | 5 | ======================== |
6 | 6 | ||
7 | - Django 1.7 or later -- a Python Web framework (https://www.djangoproject.com/) | 7 | - Django 1.11 -- a Python Web framework (https://www.djangoproject.com/) |
8 | - A database supported by Django (e.g. MySQL, PostgreSQL). | 8 | - A database supported by Django (e.g. MySQL, PostgreSQL). |
9 | - Universal Feed Parser (https://pypi.python.org/pypi/feedparser) | 9 | - Universal Feed Parser (https://pypi.python.org/pypi/feedparser) |
10 | 10 | ||
@@ -98,7 +98,7 @@ Alias /static "/usr/local/django/glifestream/static" | |||
98 | ``` | 98 | ``` |
99 | 99 | ||
100 | More detailed information is available at: | 100 | More detailed information is available at: |
101 | http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango | 101 | https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/ |
102 | 102 | ||
103 | See https://docs.djangoproject.com/en/dev/howto/deployment/ | 103 | See https://docs.djangoproject.com/en/dev/howto/deployment/ |
104 | for usual Django applications deployment. | 104 | for usual Django applications deployment. |
diff --git a/glifestream/apis/fb.py b/glifestream/apis/fb.py index 1c162cc..2e7cf6d 100644 --- a/glifestream/apis/fb.py +++ b/glifestream/apis/fb.py | |||
@@ -13,10 +13,10 @@ | |||
13 | # You should have received a copy of the GNU General Public License along | 13 | # You should have received a copy of the GNU General Public License along |
14 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 | ||
16 | from django.conf import settings | 16 | from django.utils.html import strip_tags |
17 | from django.utils.html import strip_tags, strip_entities | ||
18 | from django.template.defaultfilters import urlizetrunc | 17 | from django.template.defaultfilters import urlizetrunc |
19 | from glifestream.filters import expand, truncate | 18 | from glifestream.filters import expand, truncate |
19 | from glifestream.utils.html import strip_entities | ||
20 | from glifestream.utils.time import from_rfc3339, mtime, now | 20 | from glifestream.utils.time import from_rfc3339, mtime, now |
21 | from glifestream.stream.models import Entry | 21 | from glifestream.stream.models import Entry |
22 | from glifestream.stream import media | 22 | from glifestream.stream import media |
diff --git a/glifestream/apis/friendfeed.py b/glifestream/apis/friendfeed.py index 2bed88c..03bf78f 100644 --- a/glifestream/apis/friendfeed.py +++ b/glifestream/apis/friendfeed.py | |||
@@ -15,11 +15,11 @@ | |||
15 | 15 | ||
16 | import re | 16 | import re |
17 | import datetime | 17 | import datetime |
18 | from django.utils.html import strip_tags, strip_entities | 18 | from django.utils.html import strip_tags |
19 | from glifestream.filters import truncate | 19 | from glifestream.filters import truncate |
20 | from glifestream.gauth import gls_oauth | 20 | from glifestream.gauth import gls_oauth |
21 | from glifestream.utils.time import mtime, now | 21 | from glifestream.utils.time import mtime, now |
22 | from glifestream.utils.html import bytes_to_human | 22 | from glifestream.utils.html import bytes_to_human, strip_entities |
23 | from glifestream.stream.models import Entry | 23 | from glifestream.stream.models import Entry |
24 | from glifestream.stream import media | 24 | from glifestream.stream import media |
25 | 25 | ||
diff --git a/glifestream/apis/twitter.py b/glifestream/apis/twitter.py index 57cfb29..61f1701 100644 --- a/glifestream/apis/twitter.py +++ b/glifestream/apis/twitter.py | |||
@@ -15,9 +15,10 @@ | |||
15 | 15 | ||
16 | import datetime | 16 | import datetime |
17 | from django.utils.encoding import force_text | 17 | from django.utils.encoding import force_text |
18 | from django.utils.html import strip_tags, strip_entities | 18 | from django.utils.html import strip_tags |
19 | from glifestream.filters import expand, truncate, twyntax | 19 | from glifestream.filters import expand, truncate, twyntax |
20 | from glifestream.gauth import gls_oauth | 20 | from glifestream.gauth import gls_oauth |
21 | from glifestream.utils.html import strip_entities | ||
21 | from glifestream.utils.time import mtime, now | 22 | from glifestream.utils.time import mtime, now |
22 | from glifestream.stream.models import Entry | 23 | from glifestream.stream.models import Entry |
23 | from glifestream.stream import media | 24 | from glifestream.stream import media |
diff --git a/glifestream/bookmarklet/urls.py b/glifestream/bookmarklet/urls.py index 8611725..7f962ac 100644 --- a/glifestream/bookmarklet/urls.py +++ b/glifestream/bookmarklet/urls.py | |||
@@ -13,11 +13,10 @@ | |||
13 | # You should have received a copy of the GNU General Public License along | 13 | # You should have received a copy of the GNU General Public License along |
14 | # with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 | ||
16 | from django.conf.urls import patterns, url | 16 | from django.conf.urls import url |
17 | from glifestream.bookmarklet import views | 17 | from glifestream.bookmarklet import views |
18 | 18 | ||
19 | urlpatterns = patterns( | 19 | urlpatterns = [ |
20 | '', | 20 | url(r'js$', views.js), |
21 | (r'js$', views.js), | 21 | url(r'frame$', views.frame), |
22 | (r'frame$', views.frame), | 22 | ] |
23 | ) | ||
diff --git a/glifestream/gauth/models.py b/glifestream/gauth/models.py index 7e0e5d4..a49e81b 100644 --- a/glifestream/gauth/models.py +++ b/glifestream/gauth/models.py | |||
@@ -22,8 +22,8 @@ from glifestream.stream.models import Service | |||
22 | 22 | ||
23 | @python_2_unicode_compatible | 23 | @python_2_unicode_compatible |
24 | class OAuthClient (models.Model): | 24 | class OAuthClient (models.Model): |
25 | service = models.ForeignKey(Service, verbose_name=_('Service'), | 25 | service = models.OneToOneField(Service, on_delete=models.CASCADE, verbose_name=_('Service'), |
26 | null=False, blank=False, unique=True) | 26 | null=False, blank=False, unique=True) |
27 | identifier = models.CharField('Identifier', max_length=64, null=False, | 27 | identifier = models.CharField('Identifier', max_length=64, null=False, |
28 | blank=False) | 28 | blank=False) |
29 | secret = models.CharField('Secret', max_length=128, null=False, | 29 | secret = models.CharField('Secret', max_length=128, null=False, |
@@ -49,7 +49,7 @@ class OAuthClient (models.Model): | |||
49 | 49 | ||
50 | @python_2_unicode_compatible | 50 | @python_2_unicode_compatible |
51 | class OpenId (models.Model): | 51 | class OpenId (models.Model): |
52 | user = models.ForeignKey(User, db_index=True) | 52 | user = models.ForeignKey(User, on_delete=models.CASCADE, db_index=True) |
53 | identity = models.CharField(_('Identity'), max_length=128, null=False, | 53 | identity = models.CharField(_('Identity'), max_length=128, null=False, |
54 | blank=False) | 54 | blank=False) |
55 | 55 | ||
diff --git a/glifestream/gauth/templates/login.html b/glifestream/gauth/templates/login.html index da09087..87def5d 100644 --- a/glifestream/gauth/templates/login.html +++ b/glifestream/gauth/templates/login.html | |||
@@ -1,12 +1,12 @@ | |||
1 | {% extends "base.html" %} | 1 | {% extends "base.html" %} |
2 | {% load i18n %}{% load url from future %} | 2 | {% load i18n %} |
3 | 3 | ||
4 | {% block main %} | 4 | {% block main %} |
5 | <section id="login"> | 5 | <section id="login"> |
6 | 6 | ||
7 | <div id="loginbox"> | 7 | <div id="loginbox"> |
8 | {% if form.errors %}<p class="error">{% trans "Invalid username or password" %}</p>{% endif %} | 8 | {% if form.errors %}<p class="error">{% trans "Invalid username or password" %}</p>{% endif %} |
9 | <form name="loginform" method="post" action="{% url 'glifestream.gauth.views.login' %}"> | 9 | <form name="loginform" method="post" action="{% url 'login' %}"> |
10 | <p> |