src/irinotes/urls.py
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--
adds a synthesis step
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
"""irinotes URL Configuration
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
The `urlpatterns` list routes URLs to views. For more information please see:
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
Examples:
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
Function views
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
    1. Add an import:  from my_app import views
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
Class-based views
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    1. Add an import:  from other_app.views import Home
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
Including another URLconf
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    1. Import the include() function: from django.conf.urls import url, include
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
18fa4a1fa9e9 Add group endpoint.
Alexandre Segura <mex.zktk@gmail.com>
parents: 60
diff changeset
    20
from notes.api.views.auth import GroupViewSet
18fa4a1fa9e9 Add group endpoint.
Alexandre Segura <mex.zktk@gmail.com>
parents: 60
diff changeset
    21
from rest_framework.routers import SimpleRouter
18fa4a1fa9e9 Add group endpoint.
Alexandre Segura <mex.zktk@gmail.com>
parents: 60
diff changeset
    22
18fa4a1fa9e9 Add group endpoint.
Alexandre Segura <mex.zktk@gmail.com>
parents: 60
diff changeset
    23
authRouter = SimpleRouter()
18fa4a1fa9e9 Add group endpoint.
Alexandre Segura <mex.zktk@gmail.com>
parents: 60
diff changeset
    24
authRouter.register(r'group', GroupViewSet, base_name='auth_group')
24
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
urlpatterns = [
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
18fa4a1fa9e9 Add group endpoint.
Alexandre Segura <mex.zktk@gmail.com>
parents: 60
diff changeset
    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
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
]