src/irinotes/urls.py
author Alexandre Segura <mex.zktk@gmail.com>
Fri, 16 Jun 2017 18:36:39 +0200
changeset 44 3b20e2b584fe
parent 36 36210c4f019f
child 58 f16a080e0bc4
permissions -rw-r--r--
Introduce authentication through API.
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
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
urlpatterns = [
3b3999550508 first data model for backend
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    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
    22
    url(r'^api/notes/', include('notes.api.urls', namespace='notes')),
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    23
    url(r'^api/auth/', include('rest_auth.urls', namespace='rest_auth')),
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    24
    url(
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    25
        '^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
    26
        allauthemailconfirmation,
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    27
        name="account_confirm_email"
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    28
    ),
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    29
    url(
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    30
        r'^api/auth/registration/',
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    31
        include(
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    32
            'rest_auth.registration.urls',
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    33
            namespace='rest_auth_registration')
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    34
    ),
36210c4f019f reorganize urls and add user management api urls
ymh <ymh.work@gmail.com>
parents: 31
diff changeset
    35
    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
    36
]