Skip to content

Added signal which is fired when server needs restart #1494

Merged
merged 2 commits into from Feb 7, 2014

4 participants

@ojii
ojii commented Oct 26, 2012

I want to merge back some functionality we developed over at djeese.com into mainline django CMS.

As we all know, adding, removing or changing apphook pages requires a
server restart. Until now, the maintainer/content-editors of a site
had to do and detect this manually.

I propose we add a signal cms.signals.urls_need_reloading which
fires when the CMS detects the server needs a restart.

This signal is just sent by the django CMS. The core itself does nothing
when this signal is sent. However it allows developers to write custom
listeners to that signal that take an appropriate action in their
envirnment.

For some common use cases, there might even be generic implementations
(outside djagno-cms core) which solve this issue (eg killing os.getppid
in single-server gunicorn systems).

ojii added some commits Oct 26, 2012
@ojii ojii Added signal which is fired when server needs restart
As we all know, adding, removing or changing apphook pages requires a
server restart. Until now, the maintainer/content-editors of a site
had to do and detect this manually.

I propose we add a signal ``cms.signals.urls_need_reloading`` which
fires when the CMS detects the server needs a restart.

This signal is just sent by the django CMS. The core itself does nothing
when this signal is sent. However it allows developers to write custom
listeners to that signal that take an appropriate action in their
envirnment.

For some common use cases, there might even be generic implementations
(outside djagno-cms core) which solve this issue (eg killing os.getppid
in single-server gunicorn systems).
04022df
@ojii ojii restored Python 2.5 compatibility acc564b
@ojii
ojii commented Oct 26, 2012

Note: travis build fails because travis sucks. the tests pass just fine.

@FrankBie

please add at least a log entry to the default implementation of the signal listener

@ojii
ojii commented Oct 26, 2012

that's a good idea.

Another thing we discussed is finding some way to ship a listener (that is not connected by default) to work with runserver.

However after some brief investigation, it looks like this will be much harder than it seems.

@kezabelle

Is it worth providing a dispatch_uid for each of those signal connections?

Maybe the signals could do warning.warn() if settings.DEBUG is True?

@digi604 digi604 merged commit acc564b into divio:develop Feb 7, 2014

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.