New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Handler doesn't work if not at URLconf root #321
Comments
OK, the problem here is that the legacy handler (correctly) used the component of the URL as passed by the view dispatching mechanism, whereas the cbv one disregards it and tries to do everything using the I imagine the change was made to try to encapsulate everything into the manager's |
Initial work here: https://github.com/DrMeers/feincms/commits/321_fix / c601dc7 Adding However we do need to decide whether Also, shouldn't the FeinCMS views/urls technically live in |
Any thoughts on this? I'm surprised it has been classified as a "minor bug" and hung around for this long; I've been involved in several projects which have had to resort to ugly workarounds. I'm happy to continue developing the solution, but would like some feedback regarding the above (and anything that may have changed in regards to in over the past nine months) before I proceed further. |
It's most certainly not a minor bug, I can see that people want to mount the CMS somewhere else besides at the root. Having tests for that scenario is a good start. I think I remember having removed some (it seemed) unnecessary trickery with PATH_INFO from the handler some time ago, so this may be partly my fault. Conceptually, we probably need to pass in a "root mount point" parameter down with the request, since it will be needed whenever we generate absolute urls for pages and whatnot; but everything else should work on "relative" paths internally. I think at least. Any thoughts? |
I'm sorry, that's obviously a misclassification. Thanks for the correction. The current implementation works well when the whole WSGI app is mounted in a subfolder (example.com/djangosite/). I cannot remember the reason why we aren't simply using standard URL patterns, though. Regarding the views and |
We should probably support both, I can see the value of mounting the wsgi app under /cms and then wanting only /cms/mypages to be handled by the FeinCMS but have other Apps handle other urls. Also, people may want to mount the CMS multiple times (for backward compat links perhaps) under different root urls. |
So to recap and to put that into a test case. I think this should work:
then a Page in hierarchy /one/two should appear as /foo/one/two AND /bar/one/two, AND return the correct prefix + path in response to Things to look out for that come to mind are the caching for |
This does pretty much what we want, but it's more a quick hack than a real solution. We need to make sure we work with the without-prefix path for all internal data structures and the prefix doesn't seep into the page handler somewhere.
Looking back in history, that's actually pretty much what the old legacy view did. Does anybody remember why we work with request.path_info now? v1.6 does:
|
You mean instead of request.path? https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path_info |
Hi, I got the same problem in 1.7.4 url(r'^pages/', include('feincms.urls')), |
I ran a few tests with the following change and the commit referenced above, and things seem to work fine with FeinCMS@next in my fork:
|
I think this issue has been fixed by 9fb1d56. Thanks! |
Just discovered that including
'feincms.urls'
at a non-blank point the URLconf (e.g.'/content/'
) stopped working in an upgrade from 1.4.2 to 1.6.2.url(r'^content/', include('feincms.views.legacy.urls'))
, works correctlyLosing this functionality seems like a backwards development?
Also discussed here: https://groups.google.com/forum/?fromgroups#!topic/django-feincms/vFwfGkYdbQg but the suggested solution doesn't work (even after adding
.as_view()
, the handler doesn't seem to cope with not being at the URLconf root)The text was updated successfully, but these errors were encountered: