1 | """sapic URL Configuration |
---|
2 | |
---|
3 | The `urlpatterns` list routes URLs to views. For more information please see: |
---|
4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/ |
---|
5 | Examples: |
---|
6 | Function views |
---|
7 | 1. Add an import: from my_app import views |
---|
8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') |
---|
9 | Class-based views |
---|
10 | 1. Add an import: from other_app.views import Home |
---|
11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') |
---|
12 | Including another URLconf |
---|
13 | 1. Import the include() function: from django.conf.urls import url, include |
---|
14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) |
---|
15 | """ |
---|
16 | from django.conf.urls import url, include |
---|
17 | from django.views.static import serve |
---|
18 | from django.conf import settings |
---|
19 | from django.contrib import admin |
---|
20 | from django.contrib.auth.views import ( |
---|
21 | password_reset_confirm, password_reset_complete |
---|
22 | ) |
---|
23 | |
---|
24 | |
---|
25 | from rest_framework import routers |
---|
26 | from serializer import views |
---|
27 | |
---|
28 | from users.forms import SetPasswordForm |
---|
29 | |
---|
30 | |
---|
31 | router = routers.DefaultRouter() |
---|
32 | router.register(r'users', views.UserViewSet) |
---|
33 | router.register(r'groups', views.GroupViewSet) |
---|
34 | router.register( |
---|
35 | r'respuestasino', views.RespuestaSiNoViewSet, base_name="respuestasino" |
---|
36 | ) |
---|
37 | |
---|
38 | urlpatterns = [ |
---|
39 | url(r'^admin/', admin.site.urls), |
---|
40 | url(r'^captcha/', include('captcha.urls')), |
---|
41 | url(r'^sources/(?P<path>.*)$', serve, |
---|
42 | {'document_root': settings.MEDIA_ROOT}), |
---|
43 | url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', |
---|
44 | password_reset_confirm, |
---|
45 | {'template_name': 'base.confirm.reset.html', |
---|
46 | 'post_reset_redirect': '/user/password/done/', |
---|
47 | 'set_password_form': SetPasswordForm}, |
---|
48 | name='password_reset_confirm'), |
---|
49 | url(r'^user/password/done/$', password_reset_complete, |
---|
50 | {'template_name': 'base.pass.done.html'}), |
---|
51 | url(r'^', include('utils.urls', namespace="utils")), |
---|
52 | url(r'^', include('users.urls', namespace="users")), |
---|
53 | url(r'^', include('organizaciones.urls', namespace="organizaciones")), |
---|
54 | url( |
---|
55 | r'^', include('explicacion_situacional.urls', namespace="explicacion") |
---|
56 | ), |
---|
57 | |
---|
58 | url(r'^', include(router.urls, namespace="serializer")), |
---|
59 | url( |
---|
60 | r'^api-auth/', |
---|
61 | include('rest_framework.urls', namespace='rest_framework') |
---|
62 | ) |
---|
63 | ] |
---|
64 | |
---|
65 | if settings.DEBUG and settings.DEBUG_TOOL: |
---|
66 | # Si se ha habilitado el uso de la barra de depuración se habilitan las |
---|
67 | # urls requeridas para el renderizado |
---|
68 | import debug_toolbar |
---|
69 | |
---|
70 | urlpatterns.extend([ |
---|
71 | url(r'^__debug__/', include(debug_toolbar.urls)) |
---|
72 | ]) |
---|