2019-05-15 18:23:48 +02:00
|
|
|
# fargo - document box
|
|
|
|
# Copyright (C) 2016-2019 Entr'ouvert
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Affero General Public License as 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 Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-04-10 10:31:33 +02:00
|
|
|
from django.conf import settings
|
2017-04-26 18:29:08 +02:00
|
|
|
from django.conf.urls import include, url
|
2015-02-11 10:48:58 +01:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2017-10-16 14:00:51 +02:00
|
|
|
from .fargo.views import (home, jsonp, json, document, download, pick, delete, upload, edit,
|
2016-04-06 11:51:26 +02:00
|
|
|
remote_download, login, logout, pick_list, document_types, thumbnail)
|
2016-03-28 03:06:59 +02:00
|
|
|
from .fargo.api_views import (push_document, recent_documents, router)
|
2015-02-11 10:48:58 +01:00
|
|
|
|
2017-04-26 18:29:08 +02:00
|
|
|
urlpatterns = [
|
2015-02-11 10:48:58 +01:00
|
|
|
url(r'^$', home, name='home'),
|
2016-03-31 22:03:51 +02:00
|
|
|
url(r'^pick/$', pick_list, name='list_to_pick'),
|
2015-05-18 10:48:59 +02:00
|
|
|
url(r'^jsonp/$', jsonp, name='jsonp'),
|
|
|
|
url(r'^json/$', json, name='json'),
|
2015-03-05 23:47:42 +01:00
|
|
|
url(r'^(?P<pk>\d+)/$', document, name='document'),
|
2017-10-16 14:00:51 +02:00
|
|
|
url(r'^(?P<pk>\d+)/edit/$', edit, name='edit'),
|
2015-03-05 23:47:42 +01:00
|
|
|
url(r'^(?P<pk>\d+)/delete/$', delete, name='delete'),
|
|
|
|
url(r'^(?P<pk>\d+)/pick/$', pick, name='pick'),
|
2015-10-29 11:36:02 +01:00
|
|
|
url(r'^(?P<pk>\d+)/download/(?P<filename>[^/]*)$', download,
|
|
|
|
name='download'),
|
2016-03-23 01:06:11 +01:00
|
|
|
url(r'^(?P<pk>\d+)/thumbnail/(?P<filename>[^/]*)$', thumbnail,
|
|
|
|
name='thumbnail'),
|
2015-03-05 23:47:42 +01:00
|
|
|
url(r'^upload/$', upload, name='upload'),
|
2015-10-29 11:36:02 +01:00
|
|
|
url(r'^remote-download/(?P<filename>[^/]*)$', remote_download,
|
|
|
|
name='remote_download'),
|
2015-02-11 10:48:58 +01:00
|
|
|
url(r'^admin/', include(admin.site.urls)),
|
2015-04-10 10:31:33 +02:00
|
|
|
url(r'^login/$', login, name='auth_login'),
|
|
|
|
url(r'^logout/$', logout, name='auth_logout'),
|
2015-10-29 11:36:02 +01:00
|
|
|
url(r'^document-types/$', document_types, name='document_types'),
|
2016-02-12 15:33:00 +01:00
|
|
|
|
2016-03-31 22:03:51 +02:00
|
|
|
url(r'^api/documents/push/$', push_document, name='fargo-api-push-document'),
|
|
|
|
url(r'^api/documents/recently-added/$', recent_documents),
|
2016-03-28 03:06:59 +02:00
|
|
|
url(r'^api/', include(router.urls)),
|
2017-05-22 18:12:45 +02:00
|
|
|
url(r'^api/', include('fargo.oauth2.urls')),
|
2017-04-26 18:29:08 +02:00
|
|
|
]
|
2015-04-10 10:31:33 +02:00
|
|
|
|
2018-03-31 11:38:05 +02:00
|
|
|
if settings.DEBUG and 'debug_toolbar' in settings.INSTALLED_APPS:
|
|
|
|
import debug_toolbar
|
|
|
|
urlpatterns = [
|
|
|
|
url(r'^__debug__/', include(debug_toolbar.urls)),
|
|
|
|
] + urlpatterns
|
|
|
|
|
2015-04-10 10:31:33 +02:00
|
|
|
if 'mellon' in settings.INSTALLED_APPS:
|
2017-04-26 18:29:08 +02:00
|
|
|
urlpatterns.append(url(r'^accounts/mellon/', include('mellon.urls')))
|