mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-01 15:54:53 +00:00
Load signal handlers from an app instead of urllist
This is the place to load them to make sure they always load. This means we can also now remove a hardcoded special varnish purging in the CVE crawler script, because all saves including those from cron jobs will now fire the signals and thus the automatic varnish purges.
This commit is contained in:
10
pgweb/core/apps.py
Normal file
10
pgweb/core/apps.py
Normal file
@ -0,0 +1,10 @@
|
||||
from django.apps import AppConfig, apps
|
||||
|
||||
|
||||
class CoreAppConfig(AppConfig):
|
||||
name = 'pgweb.core'
|
||||
|
||||
def ready(self):
|
||||
from pgweb.util.signals import register_basic_signal_handlers
|
||||
|
||||
register_basic_signal_handlers()
|
@ -39,4 +39,3 @@ and have been made visible on the website.
|
||||
|
||||
{0}
|
||||
""".format("\n".join(newly_visible)))
|
||||
list(map(varnish_purge, SecurityPatch.purge_urls))
|
||||
|
@ -96,7 +96,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django_markwhat',
|
||||
'django.contrib.staticfiles',
|
||||
'pgweb.core',
|
||||
'pgweb.core.apps.CoreAppConfig',
|
||||
'pgweb.mailqueue',
|
||||
'pgweb.account',
|
||||
'pgweb.news',
|
||||
|
@ -1,8 +1,6 @@
|
||||
from django.conf.urls import include, url
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
from pgweb.util.signals import register_basic_signal_handlers
|
||||
|
||||
import pgweb.contributors.views
|
||||
import pgweb.core.views
|
||||
import pgweb.docs.views
|
||||
@ -28,9 +26,6 @@ from pgweb.events.feeds import EventFeed
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
|
||||
# Register our save signal handlers
|
||||
register_basic_signal_handlers()
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', pgweb.core.views.home),
|
||||
url(r'^dyncss/(?P<css>base|docs).css$', pgweb.core.views.dynamic_css),
|
||||
|
Reference in New Issue
Block a user