urls.py 1.86 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding:utf-8 -*
#
# Copyright 2016,2017
# - Skia <skia@libskia.so>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#

Sli's avatar
Sli committed
25
from django.urls import re_path, include
Sli's avatar
Sli committed
26
27
28
29
30
31

from api.views import *
from rest_framework import routers

# Router config
router = routers.DefaultRouter()
32
33
34
35
router.register(r"counter", CounterViewSet, basename="api_counter")
router.register(r"user", UserViewSet, basename="api_user")
router.register(r"club", ClubViewSet, basename="api_club")
router.register(r"group", GroupViewSet, basename="api_group")
Sli's avatar
Sli committed
36

Sli's avatar
Sli committed
37
# Launderette
Sli's avatar
Sli committed
38
router.register(
39
    r"launderette/place", LaunderettePlaceViewSet, basename="api_launderette_place"
Sli's avatar
Sli committed
40
41
42
43
)
router.register(
    r"launderette/machine",
    LaunderetteMachineViewSet,
44
    basename="api_launderette_machine",
Sli's avatar
Sli committed
45
46
)
router.register(
47
    r"launderette/token", LaunderetteTokenViewSet, basename="api_launderette_token"
Sli's avatar
Sli committed
48
)
Sli's avatar
Sli committed
49

Sli's avatar
Sli committed
50
51
urlpatterns = [
    # API
Sli's avatar
Sli committed
52
    re_path(r"^", include(router.urls)),
53
    re_path(r"^login/", include("rest_framework.urls", namespace="rest_framework")),
Sli's avatar
Sli committed
54
55
    re_path(r"^markdown$", RenderMarkdown, name="api_markdown"),
    re_path(r"^mailings$", FetchMailingLists, name="mailings_fetch"),
Sli's avatar
Sli committed
56
]