I am trying to use django-cms app hooks in a different way. I only have an application with different website pages. For each page I created an AppHook, since I want to control all of them with cms.
To do this, inside the application I made a package with the urls.py file for each page, for example:
/urls /home_urls.py /portfolio_urls.py /contacts_urls.py
Here is the definition of some application hooks:
class WebsiteHome(CMSApp): name = _("cms-home") urls = ["website.urls.home_urls"] apphook_pool.register(WebsiteHome) class WebsiteServices(CMSApp): name = _("cms-services") urls = ["website.urls.services_urls"] apphook_pool.register(WebsiteServices)
In any case, the problem is this: I have no control over regular expressions. Each of them introduces the first regular expression that it has discovered, in this case urlpattern in
website.urls.home_urls
Despite the fact that they have different apphHooks.
Example:
if I write slug contacts (which have apphook to WebsiteContacts), it still goes to the home_urls.py file associated with the SiteHome (application hook).
Has anyone had a similar problem?
Basically, I'm trying to say that this is something wrong with regex. I can not do:
url(r'^$', [...]),
only
url(r'^', [...]),
If I put '$', it will not go into any regular expression. If I take it, it will always be on
website.urls.home_urls.py
Despite the bullets having different Apphooks associated with different urls.py files.