| author | duong tam kien <tk@deveha.com> |
| Mon, 10 Jul 2017 16:22:59 +0200 | |
| changeset 114 | ec72869a5a20 |
| parent 99 | 18fa4a1fa9e9 |
| child 142 | 56850f5c73f6 |
| permissions | -rw-r--r-- |
| 24 | 1 |
"""irinotes 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 |
""" |
|
|
36
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
16 |
from allauth.account.views import confirm_email as allauthemailconfirmation |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
17 |
from django.conf.urls import include, url |
| 24 | 18 |
from django.contrib import admin |
|
60
42c07d428747
on server, augment default token lifetime and add settings in .env to control it. Add the refresh endpoint
ymh <ymh.work@gmail.com>
parents:
59
diff
changeset
|
19 |
from rest_framework_jwt.views import refresh_jwt_token |
| 99 | 20 |
from notes.api.views.auth import GroupViewSet |
21 |
from rest_framework.routers import SimpleRouter |
|
22 |
||
23 |
authRouter = SimpleRouter() |
|
24 |
authRouter.register(r'group', GroupViewSet, base_name='auth_group') |
|
| 24 | 25 |
|
26 |
urlpatterns = [ |
|
27 |
url(r'^admin/', admin.site.urls), |
|
|
36
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
28 |
url(r'^api/notes/', include('notes.api.urls', namespace='notes')), |
|
60
42c07d428747
on server, augment default token lifetime and add settings in .env to control it. Add the refresh endpoint
ymh <ymh.work@gmail.com>
parents:
59
diff
changeset
|
29 |
url(r'^api/auth/refresh/', refresh_jwt_token, name='rest_refresh'), |
|
36
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
30 |
url(r'^api/auth/', include('rest_auth.urls', namespace='rest_auth')), |
| 99 | 31 |
url(r'^api/auth/', include(authRouter.urls)), |
|
36
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
32 |
url( |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
33 |
'^api/auth/registration/account-confirm-email/(?P<key>[\\s\\d\\w().+-_\',:&]+)/$', |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
34 |
allauthemailconfirmation, |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
35 |
name="account_confirm_email" |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
36 |
), |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
37 |
url( |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
38 |
r'^api/auth/registration/', |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
39 |
include( |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
40 |
'rest_auth.registration.urls', |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
41 |
namespace='rest_auth_registration') |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
42 |
), |
|
36210c4f019f
reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents:
31
diff
changeset
|
43 |
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), |
| 24 | 44 |
] |