django-aloha-editor
django-aloha-editor copied to clipboard
Working with django 1.10.1?
Really embarking on a new learning path here - forgive any blatant ignorance! Using # python -m django --version 1.10.1 Adding url(r'^alohaeditor/', include('aloha_editor.urls', namespace='aloha_editor')), to urls.py
Get exceptions like:
url(r'^alohaeditor/', include('aloha_editor.urls', namespace='aloha_editor')),
File "/usr/lib64/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib64/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/lib/python2.7/site-packages/django_aloha_editor-1.1.1-py2.7.egg/aloha_editor/urls.py", line 3, in
Reading something about "patterns" being deprecated in django. Thanks!
This seems to do the trick in aloha_editor/urls.py:
# encoding: utf-8
#from django.conf.urls import patterns, url
from django.conf.urls import url
import django
if django.VERSION >= (1, 9, 0, ):
from .views import save_editable
urlpatterns = [
url(r'save_editable/$', save_editable, name='save_editable'),
]
else:
from django.conf.urls import patterns
urlpatterns = patterns('',
url(r'save_editable/$', 'aloha_editor.views.save_editable', name='save_editable'),
)