mirror of https://github.com/zulip/zulip.git
Automate inclusion of urls.py files for EXTRA_INSTALLED_APPS.
By removing this hardcoding of the list of valid extra apps, we make it a lot easier to add additional pluggable apps to the Zulip codebase.
This commit is contained in:
parent
bf50dd7771
commit
8905216df5
|
@ -127,4 +127,5 @@ ADMINS = (
|
|||
EXTRA_INSTALLED_APPS = [
|
||||
'analytics',
|
||||
'zilencer',
|
||||
'corporate',
|
||||
]
|
||||
|
|
|
@ -261,19 +261,14 @@ v1_api_and_json_patterns = patterns('zerver.views',
|
|||
{'GET': 'get_events_backend',
|
||||
'DELETE': 'cleanup_event_queue'}),
|
||||
)
|
||||
if not settings.VOYAGER:
|
||||
urlpatterns += patterns('',
|
||||
url(r'^', include('zilencer.urls')),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('',
|
||||
url(r'^', include('analytics.urls')),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('',
|
||||
url(r'^', include('corporate.urls')),
|
||||
)
|
||||
|
||||
# Include URL configuration files for site-specified extra installed
|
||||
# Django apps
|
||||
for app_name in settings.EXTRA_INSTALLED_APPS:
|
||||
app_dir = os.path.join(settings.DEPLOY_ROOT, app_name)
|
||||
if os.path.exists(os.path.join(app_dir, 'urls.py')):
|
||||
urlpatterns += patterns('', url(r'^', include('%s.urls' % (app_name,))),
|
||||
)
|
||||
|
||||
urlpatterns += patterns('zerver.tornadoviews',
|
||||
# Tornado views
|
||||
|
|
Loading…
Reference in New Issue