from django.contrib.auth import views as auth_views from django.urls import re_path from django.conf.urls import include from django.conf import settings from django.conf.urls.static import static from . import views urlpatterns = [ re_path(r'^$', views.home, name='home'), re_path(r'^getSeason/(?P.*)/(?P\d{4})$', views.getSeason), re_path(r'^update/(?P.*)/(?P\d{4})/(?P\d{2})$', views.update, name='update'), re_path(r'^matchday/(?P.{3,})/(?P\d{4})/(?P\d{2})$', views.matchday, name='matchday'), re_path(r'^charts/(?P\w{3,})/(?P\d{4})$', views.charts, name='charts'), re_path(r'^charts/(?P\w{3,})/(?P\d{4})/(?P\w{1,})$', views.charts, name='charts'), re_path(r'^accounts/profile/(\d+)', views.profile), re_path(r'^accounts/', include('django.contrib.auth.urls')), re_path(r'^blog/newpost$', views.newBlogpost), re_path(r'^blog/(?P\d)$', views.blogindex), re_path(r'^about$', views.about), re_path(r'^staff', views.staff), re_path(r'^accounts/login/', auth_views.LoginView.as_view()), re_path(r'^accounts/logout/', auth_views.LogoutView.as_view()) ] # Redirect on logout LOGOUT_REDIRECT_URL = "home" if settings.DEBUG is True: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)