Apphook URL "reloading" #1382

ojii opened this Issue Aug 10, 2012 · 4 comments

3 participants


As we all know, adding (or removing) an apphook, moving a page with an apphook, or change the slug of a page with an apphook or any of it's parents will cause URL resolving issues. For now, a server restart was required and the fact that we don't know the deployment methods of users we can't come up with a generic solution (sidenote: on djeese we solved this because we know exactly how things are deployed, so this IS automatable).

So here's the idea, introduce two new APIs to django CMS core:

  • A signal that will be fired when apphook URLs need to be reloaded.
  • A function to reload apphook URLs in the current thread.

Outside the CMS developers can then use those to implement automated systems for their deployment scenario. One such thing (and potentially the "example implementation") could be a redis powered app, where each thread/process (hereafter process) listens to a redis channel. When the signal is fired on any process, it publishes a message in a redis channel and reloads its URLs. All other processes will receive the message and reload their URLs. The beauty is this would work on a single server and a multi server environment. Again, this is just an example and should really not be in core.

Benefits from the current solution:

  • Server restart not necessarily required
  • Since core doesn't implement anything, it should be possible to build a solution on top of it for almost any deployment strategy.

Drawbacks from the current solution:

  • Two new APIs to implement. The apphook-change-detection-signal is rather trivial, the actual hotswapping of apphook URLs is a lot trickier
Divio AG member


@digi604 digi604 closed this Feb 10, 2014

Hello! Is there any reference on how this has been fixed / what's the best approach now?

Thanks, this issue is bugging me a lot (my preference is for gunicorn)!


Thanks a lot, I thought that also an "example" implementation had been described somewhere, but I'll try to figure it out myself!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment