auth: Separate development login from main login page.

This allows us to enable EmailAuthBackend by default in development
without cluttering the development login experience.

Fixes #3652.
This commit is contained in:
sinwar
2017-03-18 06:28:45 +05:30
committed by Tim Abbott
parent 4c88b3f5da
commit 397e9c109e
7 changed files with 68 additions and 42 deletions

View File

@@ -3,14 +3,21 @@ from django.conf import settings
import os.path
from django.views.static import serve
import zerver.views.registration
import zerver.views.auth
# These URLs are available only in the development environment
use_prod_static = getattr(settings, 'PIPELINE_ENABLED', False)
static_root = os.path.join(settings.DEPLOY_ROOT, 'prod-static/serve' if use_prod_static else 'static')
urls = [url(r'^static/(?P<path>.*)$', serve, {'document_root': static_root})]
i18n_urls = [url(r'^confirmation_key/$', zerver.views.registration.confirmation_key)]
urls = [
url(r'^static/(?P<path>.*)$', serve, {'document_root': static_root}),
url(r'^devlogin/$', zerver.views.auth.login_page,
{'template_name': 'zerver/dev_login.html'}, name='zerver.views.auth.login_page'),
]
i18n_urls = [
url(r'^confirmation_key/$', zerver.views.registration.confirmation_key),
]
# These are used for voyager development. On a real voyager instance,
# these files would be served by nginx.