Browse Source

Fix login/logout urls.

feature/python-error-tracking
Drew Larson 9 years ago
parent
commit
c906b710ba
  1. 5
      bikeshop_project/bikeshop/settings/base.py
  2. 5
      bikeshop_project/bikeshop/urls.py
  3. 2
      bikeshop_project/core/urls.py

5
bikeshop_project/bikeshop/settings/base.py

@ -150,4 +150,7 @@ HAYSTACK_CONNECTIONS = {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
},
}
}
LOGIN_REDIRECT_URL = 'home'
LOGIN_URL = 'login'

5
bikeshop_project/bikeshop/urls.py

@ -16,7 +16,7 @@ Including another URLconf
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import login
from django.contrib.auth.views import login, logout_then_login
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from core import urls as core_urls
@ -24,7 +24,8 @@ from registration import urls as member_urls
urlpatterns = [
url(r'^', include(core_urls)),
url(r'^login/', login, {'template_name': 'login.html'}),
url(r'^login/', login, {'template_name': 'login.html'}, name='login'),
url(r'^logout/', logout_then_login),
url(r'^member/', include(member_urls)),
url(r'^admin/', admin.site.urls),
]

2
bikeshop_project/core/urls.py

@ -3,5 +3,5 @@ from django.conf.urls import url
from .views import DashboardView, NewMembershipView
urlpatterns = [
url(r'^member/(?P<member_id>[0-9]+)/membership/new/$', NewMembershipView.as_view(), name='new_membership'),
url(r'^$', DashboardView.as_view())
url(r'^$', DashboardView.as_view(), name='home')
]

Loading…
Cancel
Save