mybuddy/babybuddy/urls.py

43 lines
1.4 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2017-08-11 18:32:02 +00:00
from django.conf.urls import url, include
from django.conf.urls.static import static
from django.conf import settings
2017-08-11 18:32:02 +00:00
from django.contrib import admin
2017-11-09 12:24:32 +00:00
from django.contrib.auth import views as auth_views
from . import views
2017-08-11 18:32:02 +00:00
2017-12-03 22:00:51 +00:00
app_patterns = [
2017-11-09 12:24:32 +00:00
url(r'^login/$', auth_views.LoginView.as_view(), name='login'),
url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
url('^password_reset/$', auth_views.PasswordResetView.as_view(),
name='password_reset',),
2017-11-09 12:24:32 +00:00
url(r'^$', views.RootRouter.as_view(), name='root-router'),
url(r'^welcome/$', views.Welcome.as_view(), name='welcome'),
2017-12-02 21:20:15 +00:00
url(r'^user/password/$', views.UserPassword.as_view(),
name='user-password'),
url(r'^user/reset-api-key/$', views.UserResetAPIKey.as_view(),
name='user-reset-api-key'),
url(r'^user/settings/$', views.UserSettings.as_view(),
name='user-settings'),
2017-12-03 21:52:27 +00:00
]
2017-11-09 12:24:32 +00:00
2017-12-03 21:52:27 +00:00
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('api.urls', namespace='api')),
2017-12-03 22:00:51 +00:00
url(r'', include((app_patterns, 'babybuddy'), namespace='babybuddy')),
2017-12-03 21:52:27 +00:00
url(r'', include('core.urls', namespace='core')),
url(r'', include('dashboard.urls', namespace='dashboard')),
2017-08-24 19:40:11 +00:00
url(r'', include('reports.urls', namespace='reports')),
2017-08-11 18:32:02 +00:00
]
2017-12-02 21:20:15 +00:00
if settings.DEBUG: # pragma: no cover
2017-11-18 09:29:46 +00:00
urlpatterns += static(
settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT
)