-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathurls.py
More file actions
24 lines (20 loc) · 895 Bytes
/
Copy pathurls.py
File metadata and controls
24 lines (20 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from django.urls import re_path, include
from django.views.static import serve
from pythonfiddle.settings import DEBUG, PYTHON_LIB_DIR
from cloud_ide.shared.urls import urlpatterns as shared_urls
from cloud_ide.fiddle import views as fiddle_views
urlpatterns = shared_urls + [
re_path(r'^$', fiddle_views.create, name='create_snippet'),
re_path(r'^save/$', fiddle_views.save, name='save_snippet'),
re_path(r'^check_title/', fiddle_views.check_title),
re_path(r'^tag_hint/$', fiddle_views.tag_hint),
re_path(r'^(?P<snippet_slug>[-\w]+)/$', fiddle_views.open, name='open_snippet'),
re_path(r'^(?P<snippet_slug>[-\w]+)/embedded/$', fiddle_views.open, {'embedded': True}),
]
urlpatterns += [
re_path(r'^i18n/', include('django.conf.urls.i18n')),
]
if DEBUG:
urlpatterns += [
re_path(r'^lib/(?P<path>.*)$', serve, {'document_root': PYTHON_LIB_DIR}),
]