Ejemplo n.º 1
0
 def get_response_data(self, chunked_upload, request):
     """
     Data for the response. Should return a dictionary-like object.
     """
     token = request.POST.get('token')
     refresh = Refresh()
     new_payload = refresh.refresh(token)
     print new_payload
     # Refresh token
     return {
         'upload_id': chunked_upload.upload_id,
         'offset': chunked_upload.offset,
         'expires': chunked_upload.expires_on,
         'token': new_payload['token'],
         'user': new_payload['user']
     }
Ejemplo n.º 2
0
 def get_response_data(self, chunked_upload, request):
     """
     Data for the response. Should return a dictionary-like object.
     """
     token = request.POST.get('token')
     refresh = Refresh()
     new_payload = refresh.refresh(token)
     print new_payload
     # Refresh token
     return {
         'upload_id': chunked_upload.upload_id,
         'offset': chunked_upload.offset,
         'expires': chunked_upload.expires_on,
         'token': new_payload['token'],
         'user': new_payload['user']
     }
Ejemplo n.º 3
0
from django.conf import settings
from django.conf.urls import patterns, url, include
from django.contrib import admin

from demo.views import ChunkedUploadDemo, MyChunkedUploadCompleteView, SaveView, ChunkedUploadedSize

from meta.views import SendData, SendFile, SaveMeta
from token_auth.views import Refresh

admin.autodiscover()

urlpatterns = patterns(
    "",
    url(r"^/?$", ChunkedUploadDemo.as_view(), name="chunked_upload"),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^login/", "jwt_auth.views.obtain_jwt_token"),
    url(r"^token/refresh/", Refresh.as_view(), name="refres_token"),
    url(r"^api/save/?$", MyChunkedUploadCompleteView.as_view(), name="api_chunked_upload_complete"),
    url(r"^api/chunks/?$", SaveView.as_view(), name="api_chunked_upload_save"),
    url(r"^api/size/?$", ChunkedUploadedSize.as_view(), name="api_chunked_upload_size"),
    url(r"^api/data/?$", SendData.as_view(), name="api_chunked_upload_data"),
    url(r"^api/meta/save/?$", SaveMeta.as_view(), name="api_chunked_upload_data"),
    url(r"^api/file/?$", SendFile.as_view(), name="api_chunked_upload_data"),
    url(r"^static/(.*)$", "django.views.static.serve", {"document_root": settings.STATIC_ROOT, "show_indexes": False}),
)
Ejemplo n.º 4
0
from django.urls import path

from token_auth.views import (
    ObtainPair,
    Refresh,
    Verify,
)

app_name = 'token_auth'

urlpatterns = [
    path('obtain_pair/', ObtainPair.as_view(), name='obtain_pair'),
    path('refresh/', Refresh.as_view(), name='refresh'),
    path('verify/', Verify.as_view(), name='verify'),
]
Ejemplo n.º 5
0
)

from meta.views import SendData, SendFile, SaveMeta
from token_auth.views import Refresh

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^$',
        ChunkedUploadDemo.as_view(), name='chunked_upload'),

    url(r'^admin/', admin.site.urls),

    url(r'^login/', 'rest_framework_jwt.views.obtain_jwt_token'),
    url(r'^token/refresh/', Refresh.as_view(), name='refres_token'),
    url(r'^api/save/?$',
        MyChunkedUploadCompleteView.as_view(),
        name='api_chunked_upload_complete'),
    url(r'^api/chunks/?$', SaveView.as_view(),
        name='api_chunked_upload_save'),
    url(r'^api/size/?$', ChunkedUploadedSize.as_view(),
        name='api_chunked_upload_size'),

    url(r'^api/data/?$', SendData.as_view(),
        name='api_chunked_upload_data'),
    url(r'^api/meta/save/?$', SaveMeta.as_view(),
        name='api_chunked_upload_data'),
    url(r'^api/file/?$', SendFile.as_view(),
        name='api_chunked_upload_data'),
Ejemplo n.º 6
0
from django.contrib import admin

from demo.views import (ChunkedUploadDemo, MyChunkedUploadCompleteView,
                        SaveView, ChunkedUploadedSize)

from meta.views import SendData, SendFile, SaveMeta
from token_auth.views import Refresh

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^/?$', ChunkedUploadDemo.as_view(), name='chunked_upload'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^login/', 'jwt_auth.views.obtain_jwt_token'),
    url(r'^token/refresh/', Refresh.as_view(), name='refres_token'),
    url(r'^api/save/?$',
        MyChunkedUploadCompleteView.as_view(),
        name='api_chunked_upload_complete'),
    url(r'^api/chunks/?$', SaveView.as_view(), name='api_chunked_upload_save'),
    url(r'^api/size/?$',
        ChunkedUploadedSize.as_view(),
        name='api_chunked_upload_size'),
    url(r'^api/data/?$', SendData.as_view(), name='api_chunked_upload_data'),
    url(r'^api/meta/save/?$',
        SaveMeta.as_view(),
        name='api_chunked_upload_data'),
    url(r'^api/file/?$', SendFile.as_view(), name='api_chunked_upload_data'),
    url(r'^static/(.*)$', 'django.views.static.serve', {
        'document_root': settings.STATIC_ROOT,
        'show_indexes': False