[geany/www.geany.org] f69670: Fix various deprecation warnings of Django 1.8 and Mezzanine

Enrico Tröger git-noreply at xxxxx
Sun Aug 9 11:55:43 UTC 2015


Branch:      refs/heads/master
Author:      Enrico Tröger <enrico.troeger at uvena.de>
Committer:   Enrico Tröger <enrico.troeger at uvena.de>
Date:        Sun, 09 Aug 2015 11:55:43 UTC
Commit:      f6967043093f2860ac0d1a66065c05970c3f1517
             https://github.com/geany/www.geany.org/commit/f6967043093f2860ac0d1a66065c05970c3f1517

Log Message:
-----------
Fix various deprecation warnings of Django 1.8 and Mezzanine


Modified Paths:
--------------
    geany/settings.py
    geany/templates/blog/blog_post_detail.html
    geany/templates/pages/richtextpage.html
    geany/urls.py
    latest_version/urls.py
    nightlybuilds/database_routers.py
    nightlybuilds/urls.py
    pastebin/urls.py
    static_docs/urls.py

Modified: geany/settings.py
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -95,7 +95,7 @@
 # If ``True``, users will be automatically redirected to HTTPS
 # for the URLs specified by the ``SSL_FORCE_URL_PREFIXES`` setting.
 #
-SSL_ENABLED = True
+# SSL_ENABLED = True  # managed via dynamic settings in the Django Admin
 
 # Host name that the site should always be accessed via that matches
 # the SSL certificate.
@@ -394,7 +394,7 @@
     (_("Users"), ("auth.User", "auth.Group",)))
 
 # django-debug-toolbar
-DEBUG_TOOLBAR_CONFIG = {"INTERCEPT_REDIRECTS": False}
+DEBUG_TOOLBAR_PATCH_SETTINGS = False
 
 # caching & sessions
 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"


Modified: geany/templates/blog/blog_post_detail.html
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -21,7 +21,7 @@
     {{ blog_post.title }}
 </h2>
 
-{{ blog_post.content|richtext_filter|safe }}
+{{ blog_post.content|richtext_filters|safe }}
 
 
 <hr>


Modified: geany/templates/pages/richtextpage.html
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -15,7 +15,7 @@
 {% evaluate page.richtextpage.content as evaluated_content %}
 
 {# display #}
-{{ evaluated_content|richtext_filter|safe }}
+{{ evaluated_content|richtext_filters|safe }}
 
 {% block content_after %}
 {% endblock %}


Modified: geany/urls.py
22 lines changed, 12 insertions(+), 10 deletions(-)
===================================================================
@@ -12,35 +12,37 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.conf.urls import patterns, include, url
+from django.conf.urls import include, url
 from django.conf.urls.i18n import i18n_patterns
 from django.contrib import admin
+from django.contrib.sitemaps.views import sitemap
 from django.views.generic.base import TemplateView
+from django.views.i18n import set_language
+from django.views.static import serve as static_serve
 from geany.sitemaps import GeanyMainSitemap
 from mezzanine.conf import settings
 from nightlybuilds.views import NightlyBuildsView
 
-
 sitemaps = {"sitemaps": {"all": GeanyMainSitemap}}
 
 
 admin.autodiscover()
 
-urlpatterns = i18n_patterns("",
+urlpatterns = i18n_patterns(
     # Change the admin prefix here to use an alternate URL for the
     # admin interface, which would be marginally more secure.
-    ("^admin/", include(admin.site.urls)),
+    url("^admin/", include(admin.site.urls)),
 )
 
 if settings.USE_MODELTRANSLATION:
-    urlpatterns += patterns('',
-        url('^i18n/$', 'django.views.i18n.set_language', name='set_language'),
+    urlpatterns += (
+        url('^i18n/$', set_language, name='set_language'),
     )
 
 # Geany patterns
-urlpatterns += patterns("",
+urlpatterns += (
     # use our custom sitemap implementation
-    url(r"^sitemap\.xml$", 'django.contrib.sitemaps.views.sitemap', sitemaps),
+    url(r"^sitemap\.xml$", sitemap, sitemaps),
 
     # TODO, NEWS, etc.
     url(r"^", include("static_docs.urls")),
@@ -68,6 +70,6 @@
 
 
 if settings.DEBUG:
-    urlpatterns += patterns('',
-        url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, }),
+    urlpatterns += (
+        url(r'^media/(?P<path>.*)$', static_serve, {'document_root': settings.MEDIA_ROOT, }),
    )


Modified: latest_version/urls.py
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -12,17 +12,17 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.conf.urls import patterns, url
+from django.conf.urls import url
 from django.views.generic import TemplateView
 from geany.sitemaps import StaticSitemap, sitemap_registry
 
 
-urlpatterns = patterns('',
+urlpatterns = (
     # compat / special url for the UpdateChecker Geany plugin
-    url(r'^service/version.php', TemplateView.as_view(
-                                    template_name='latest_version.txt',
-                                    content_type='text/plain'),
-                            name='latest_version'),
+    url(
+        r'^service/version.php',
+        TemplateView.as_view(template_name='latest_version.txt', content_type='text/plain'),
+        name='latest_version'),
 )
 
 # Adds ``STATIC_URL`` to the context of error pages, so that error pages can use JS, CSS and images.


Modified: nightlybuilds/database_routers.py
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -48,5 +48,5 @@ def allow_relation(self, obj1, obj2, **hints):
         return None
 
     #----------------------------------------------------------------------
-    def allow_syncdb(self, db, model):
+    def allow_migrate(self, db, model):
         return model._meta.app_label != 'nightlybuilds'


Modified: nightlybuilds/urls.py
12 lines changed, 6 insertions(+), 6 deletions(-)
===================================================================
@@ -13,30 +13,30 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from django.conf import settings
-from django.conf.urls import include, patterns, url
+from django.conf.urls import include, url
 from geany.sitemaps import StaticSitemap
 from nightlybuilds.views import NightlyBuildsView
 
 
-urlpatterns = patterns('',
+urlpatterns = [
     # no admin on this site
     url(r'^admin/', 'mezzanine.core.views.page_not_found'),
 
     url(r'^$', NightlyBuildsView.as_view(), name='home'),
-)
+]
 
 # Django-Debug-Toolbar support
 if settings.DEBUG:
     import debug_toolbar
-    urlpatterns += patterns('',
+    urlpatterns += (
         url(r'^__debug__/', include(debug_toolbar.urls)),
     )
 
 # Sitemap framework
 sitemaps = {"sitemaps": {"all": StaticSitemap('nightly.geany.org', urlpatterns)}}
-urlpatterns += patterns('',
+urlpatterns += (
     # use our custom sitemap implementation
-    url(r"^sitemap\.xml$", 'django.contrib.sitemaps.views.sitemap', sitemaps)
+    url(r"^sitemap\.xml$", 'django.contrib.sitemaps.views.sitemap', sitemaps),
 )
 
 # Adds ``STATIC_URL`` to the context of error pages, so that error pages can use JS, CSS and images.


Modified: pastebin/urls.py
13 lines changed, 6 insertions(+), 7 deletions(-)
===================================================================
@@ -12,9 +12,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-
 from django.conf import settings
-from django.conf.urls import include, patterns, url
+from django.conf.urls import include, url
 from django.views.generic.base import TemplateView
 from geany.sitemaps import StaticSitemap
 from pastebin.views import (
@@ -26,7 +25,7 @@
     SnippetNewView)
 
 
-urlpatterns = patterns('',
+urlpatterns = [
     # no admin on this site
     url(r'^admin/', 'mezzanine.core.views.page_not_found'),
 
@@ -40,20 +39,20 @@
     url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/$', SnippetDetailView.as_view(), name='snippet_details'),
     url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/delete/$', SnippetDeleteView.as_view(), name='snippet_delete'),
     url(r'^(?P<snippet_id>[a-zA-Z0-9]+)/raw/$', SnippetDetailRawView.as_view(), name='snippet_details_raw'),
-)
+]
 
 # Django-Debug-Toolbar support
 if settings.DEBUG:
     import debug_toolbar
-    urlpatterns += patterns('',
+    urlpatterns += (
         url(r'^__debug__/', include(debug_toolbar.urls)),
     )
 
 # Sitemap framework
 sitemaps = {"sitemaps": {"all": StaticSitemap(settings.SITE_DOMAIN_PASTEBIN, urlpatterns)}}
-urlpatterns += patterns('',
+urlpatterns += (
     # use our custom sitemap implementation
-    url(r"^sitemap\.xml$", 'django.contrib.sitemaps.views.sitemap', sitemaps)
+    url(r"^sitemap\.xml$", 'django.contrib.sitemaps.views.sitemap', sitemaps),
 )
 
 # Adds ``STATIC_URL`` to the context of error pages, so that error pages can use JS, CSS and images.


Modified: static_docs/urls.py
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -12,11 +12,11 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-from django.conf.urls import patterns, url
+from django.conf.urls import url
 from static_docs.views import ReleaseNotesView, ToDoView
 
 
-urlpatterns = patterns('',
+urlpatterns = (
     url(r'^documentation/todo/$', ToDoView.as_view(), name='todo'),
 
     url(r'^documentation/releasenotes/$', ReleaseNotesView.as_view(), name='releasenotes'),



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list