Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

installing aldryn-blog in django-cms breaks djangocms_link plugin #47

Open
neaai opened this issue Apr 8, 2014 · 6 comments
Open

installing aldryn-blog in django-cms breaks djangocms_link plugin #47

neaai opened this issue Apr 8, 2014 · 6 comments

Comments

@neaai
Copy link

neaai commented Apr 8, 2014

This is very easy to reproduce. I discovered this by following the tutorial at:
"divio / django-cms-tutorial" where as an example at Step 6 of the tutorial, is used the installation of a blog app, the aldryn-blog app.
The link plugin works correctly until the completion of the steps described to install aldryn-blog. After that, any attempt to create a link using the plugin from the frontend editor, generates an error.

It would seem that the error actually is connected to django-select2 which is installed automatically when installing aldryn-blog.
I fixed this in my cms installation by modifying the project's "urls.py" file and adding the line:
url(r'^select2/', include('django_select2.urls')),
at the urlpatterns section.

Currently, my sections that deal with the urlpatterns is as follows:

=========== CUT ====================
urlpatterns = patterns('',
url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': {'cmspages': CMSSitemap}}),
url(r'^select2/', include('django_select2.urls')),
)

urlpatterns += i18n_patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('cms.urls')),
)
============== CUT ==================

After this change, the link plugin works properly.

I don't know whether this is a documentation issue or something that has to be fixed in code.
But I hope it helps.

Regards.

@czpython
Copy link
Contributor

hey there, could you paste a link to the traceback ? (pastebin)

@neaai
Copy link
Author

neaai commented Apr 19, 2014

Hello,
Here is a paste of the traceback generated.
http://dpaste.com/hold/1786962/
I have generated this by following the above mentioned steps, but without changing the "urls.py" file of the project as shown within the CUT/CUT section.

@czpython
Copy link
Contributor

so you only get this error whenselect2 is not in the urls.py ?
If so then yes it is a documentation issue because select2 needs to be installed following it's own installation docs. This includes adding it to the urls.py, please let me know if this is the case 😄 .

@neaai
Copy link
Author

neaai commented Apr 20, 2014

@czpython
Yes, the problem is fixed when adding select2 line in 'urls.py' of the project. I guess the confusion came because dselect2 as installed automatically as a dependency by aldryn-blog. The django-select2 package docs do mention this, but probably it needs to be mentioned as well in the blog's docs too, in the same manner it mentions the lines that need to be added at INSTALLED_APPS.

While we are at this discussion, when adding the select2 line at 'urls.py', in which section it is better to put it, at "patterns" or "i18n_patterns"? Would it make any difference in behaviour and functionality?

Thank you and regards.

@czpython
Copy link
Contributor

@neaai personally I would put it in i18n_patterns if you are using django's multilanguage feature. And this is because the view deals with db objects that might need to be language aware.

@sfwatergit
Copy link

Hi,

I ran into this same problem with the same fix, but only after a good bit of head scratching. I agree with @neaai that it should be in the docs somewhere, since following the CMS tutorial to the letter will lead all users down the same path. Seems it would be good to mention in both places.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants