from django.urls import include, path
from django.http import HttpResponseRedirect
from django.conf import settings

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from resumable.views import ResumableUploadView
from resumable.views import resumable_demo
from resumable.views import demo
from resumable.views import fake_upload

urlpatterns = [
    path('', lambda x: HttpResponseRedirect('/upload/new/')),
    path('resumable/upload/', ResumableUploadView.as_view()),
    path("resumable_demo/", resumable_demo),
    path("demo/", demo),
    path("fake_upload/", fake_upload),
    path('upload/', include('fileupload.urls')),
    path('admin/', admin.site.urls),
]

if settings.DEBUG:
    from django.conf.urls.static import static
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Example #2
0
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

from resumable.views import ResumableUploadView
from resumable.fields import ResumableFileField


class ResumableForm(Form):
    file = ResumableFileField(
        allowed_mimes=("audio/ogg",),
        upload_url=lambda: reverse('upload'),
        chunks_dir=getattr(settings, 'FILE_UPLOAD_TEMP_DIR')
    )


class TestFormView(FormView):
    form_class = ResumableForm
    template_name = 'form.html'

    @property
    def success_url(self):
        return reverse('form')


urlpatterns = staticfiles_urlpatterns()


urlpatterns = [
    url('^$', TestFormView.as_view(), name='form'),
    url('^upload/$', ResumableUploadView.as_view(), name='upload')
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Example #3
0
from django.conf.urls import patterns, url
from resumable.views import ResumableUploadView

from administration.utils import user_can_see_administration_interface


urlpatterns = patterns('upload_video.views',
    url(r'^upload/$', user_can_see_administration_interface(ResumableUploadView.as_view()), name='upload'),
    url(r'^upload_page/$', 'upload_video', name='upload_video'),
)
Example #4
0
    # JSON-accepting url that moves maps/folders around
    url(r'^moveNode', views.moveNode, {}, 'moveNode'),
    # JSON-accepting url that changes visibility for a node
    url(r'^setNodeVisibility', views.setNodeVisibility, {}, 'setNodeVisibility'),

    # --- this url is deprecated, don't use it in new code ---
    # This URL should receive a static files
    url(r'^data/(?P<path>.*)$', django.views.static.serve,
     {'document_root': settings.DATA_URL + settings.XGDS_MAP_SERVER_DATA_SUBDIR,
      'show_indexes': True,
      'readOnly': True},
     'xgds_map_server_static'),

    # By default if you just load the app you should see the list
    url(r'^feed/(?P<feedname>.*)', views.getMapFeed,{'readOnly': True, 'loginRequired': False, 'securityTags': ['kml', 'readOnly']},'xgds_map_server_feed'),
    url(r'^uploadResumable/$', login_required(ResumableUploadView.as_view()), name='uploadResumable'),
    url(r'^fmapJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<filter>[\w]+:[\w]+)$', views.getMappedObjectsJson, {'isLive':settings.GEOCAM_UTIL_LIVE_MODE, 'force':True}, 'xgds_map_server_objectsJson_force'),
    url(r'^mapJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<filter>[\w]+:[\w]+)$', views.getMappedObjectsJson, {'isLive':settings.GEOCAM_UTIL_LIVE_MODE}, 'xgds_map_server_objectsJson'),
    url(r'^mapJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<range>[\d]+)$', views.getMappedObjectsJson, {'isLive':settings.GEOCAM_UTIL_LIVE_MODE}, 'xgds_map_server_objectsJson_range'),
    url(r'^mapJson/(?P<object_name>[\w]+[\.]*[\w]*)$', views.getMappedObjectsJson, {'range':0, 'force': True, 'isLive':settings.GEOCAM_UTIL_LIVE_MODE}, 'xgds_map_server_objectsJson_default'),
    url(r'^lastJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<filter>[\w]+:[\w]+)$', views.getLastObjectJson, {},'xgds_map_server_lastJson_filter'),
    url(r'^lastJson/(?P<object_name>[\w]+[\.]*[\w]*)$', views.getLastObjectJson, {}, 'xgds_map_server_lastJson'),
    
    
    url(r'^search/$', views.getSearchPage, {}, 'search_map'),
    url(r'^search/(?P<modelName>[\w]+)$', views.getSearchPage, {}, 'search_map_object'),
    url(r'^search/(?P<modelName>\w+)/(?P<filter>(([\w]+|[a-zA-Z0-9:._\-\s]+),*)+)$', views.getSearchPage, {}, 'search_map_object_filter'),
    url(r'^view/(?P<modelName>[\w]+)/(?P<modelPK>[\d]+)$', views.getViewSingleModelPage, {}, 'search_map_single_object'),
    #url(r'^view/(?P<modelName>[\w]+)/(?P<modelPK>[\d]+)$', views.getViewMultiModelPage, {}, 'search_map_single_object'),
    url(r'^view/(?P<mapName>\w+)/$', views.MapOrderListJson.as_view(), {}, 'map_view_json'),
    url(r'^view/(?P<mapName>\w+)/(?P<filter>(([\w]+|[a-zA-Z0-9:._\-\s]+),*)+)$', views.MapOrderListJson.as_view(), {}, 'map_view_json_filter'),
Example #5
0
    url(r'^delete/(?P<nodeID>[\w-]+)/', views.getDeleteNodePage, {},
        'nodeDelete'),

    # List of deleted maps that can be un-deleted
    url(r'^deleted/', views.getDeletedNodesPage, {}, 'deletedNodes'),

    # JSON-accepting url that moves maps/folders around
    url(r'^moveNode', views.moveNode, {}, 'moveNode'),

    # JSON-accepting url that changes visibility for a node
    url(r'^setNodeVisibility', views.setNodeVisibility, {},
        'setNodeVisibility'),

    # By default if you just load the app you should see the list
    url(r'^uploadResumable/$',
        ResumableUploadView.as_view(),
        name='uploadResumable'),
    url(r'^search/mapBounded/$', views.getMapBoundedSearchPage, {},
        'search_map_bounded_page'),
    url(r'^search/$', views.getSearchPage, {}, 'search_map'),
    url(r'^search/(?P<modelName>[\w]+)$', views.getSearchPage, {},
        'search_map_object'),
    url(
        r'^search/(?P<modelName>\w+)/(?P<filter>(([\w]+|[a-zA-Z0-9:._\-\s]+),*)+)$',
        views.getSearchPage, {}, 'search_map_object_filter'),
    url(r'^view/(?P<modelName>[\w]+)/(?P<modelPK>[\d]+)$',
        views.getViewSingleModelPage, {}, 'search_map_single_object'),
    #url(r'^view/(?P<modelName>[\w]+)/(?P<modelPK>[\d]+)$', views.getViewMultiModelPage, {}, 'search_map_single_object'),

    # replay in map page
    url(r'^replay/(?P<flight_name>[\w]+)$', views.getFlightPlaybackPage, {},
Example #6
0
    # JSON-accepting url that moves maps/folders around
    url(r'^moveNode', views.moveNode, {}, 'moveNode'),
    # JSON-accepting url that changes visibility for a node
    url(r'^setNodeVisibility', views.setNodeVisibility, {}, 'setNodeVisibility'),

    # --- this url is deprecated, don't use it in new code ---
    # This URL should receive a static files
    url(r'^data/(?P<path>.*)$', django.views.static.serve,
     {'document_root': settings.DATA_URL + settings.XGDS_MAP_SERVER_DATA_SUBDIR,
      'show_indexes': True,
      'readOnly': True},
     'xgds_map_server_static'),

    # By default if you just load the app you should see the list
    url(r'^feed/(?P<feedname>.*)', views.getMapFeed,{'readOnly': True, 'loginRequired': False, 'securityTags': ['kml', 'readOnly']},'xgds_map_server_feed'),
    url(r'^uploadResumable/$', login_required(ResumableUploadView.as_view()), name='uploadResumable'),
    url(r'^fmapJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<filter>[\w]+:[\w]+)$', views.getMappedObjectsJson, {'isLive':settings.GEOCAM_UTIL_LIVE_MODE, 'force':True}, 'xgds_map_server_objectsJson_force'),
    url(r'^mapJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<filter>[\w]+:[\w]+)$', views.getMappedObjectsJson, {'isLive':settings.GEOCAM_UTIL_LIVE_MODE, 'loginRequired': False}, 'xgds_map_server_objectsJson'),
    url(r'^mapJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<range>[\d]+)$', views.getMappedObjectsJson, {'isLive':settings.GEOCAM_UTIL_LIVE_MODE}, 'xgds_map_server_objectsJson_range'),
    url(r'^mapJson/(?P<object_name>[\w]+[\.]*[\w]*)$', views.getMappedObjectsJson, {'range':0, 'force': True, 'isLive':settings.GEOCAM_UTIL_LIVE_MODE}, 'xgds_map_server_objectsJson_default'),
    url(r'^lastJson/(?P<object_name>[\w]+[\.]*[\w]*)/(?P<filter>[\w]+:[\w]+)$', views.getLastObjectJson, {},'xgds_map_server_lastJson_filter'),
    url(r'^lastJson/(?P<object_name>[\w]+[\.]*[\w]*)$', views.getLastObjectJson, {}, 'xgds_map_server_lastJson'),
    
    
    url(r'^search/$', views.getSearchPage, {}, 'search_map'),
    url(r'^search/(?P<modelName>[\w]+)$', views.getSearchPage, {}, 'search_map_object'),
    url(r'^search/(?P<modelName>\w+)/(?P<filter>(([\w]+|[a-zA-Z0-9:._\-\s]+),*)+)$', views.getSearchPage, {}, 'search_map_object_filter'),
    url(r'^view/(?P<modelName>[\w]+)/(?P<modelPK>[\d]+)$', views.getViewSingleModelPage, {}, 'search_map_single_object'),
    #url(r'^view/(?P<modelName>[\w]+)/(?P<modelPK>[\d]+)$', views.getViewMultiModelPage, {}, 'search_map_single_object'),
    url(r'^view/(?P<mapName>\w+)/$', views.MapOrderListJson.as_view(), {}, 'map_view_json'),
    url(r'^view/(?P<mapName>\w+)/(?P<filter>(([\w]+|[a-zA-Z0-9:._\-\s]+),*)+)$', views.MapOrderListJson.as_view(), {}, 'map_view_json_filter'),
Example #7
0
from django.views.generic.edit import FormView
from django.forms import Form
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

from resumable.views import ResumableUploadView
from resumable.fields import ResumableFileField


class ResumableForm(Form):
    file = ResumableFileField(allowed_mimes=("audio/ogg", ),
                              upload_url=lambda: reverse('upload'),
                              chunks_dir=getattr(settings,
                                                 'FILE_UPLOAD_TEMP_DIR'))


class TestFormView(FormView):
    form_class = ResumableForm
    template_name = 'form.html'

    @property
    def success_url(self):
        return reverse('form')


urlpatterns = staticfiles_urlpatterns()

urlpatterns += patterns(
    '', url('^$', TestFormView.as_view(), name='form'),
    url('^upload/$', ResumableUploadView.as_view(), name='upload'))