html test uploader

This commit is contained in:
Mohamed Nouffer
2021-12-08 19:13:03 +05:30
parent e5e3f670e9
commit fae9e555dd
4 changed files with 32 additions and 4 deletions

View File

@ -1,7 +1,8 @@
from django.contrib import admin
from django.urls import path, re_path
from .views import FileUploadView
from .views import FileUploadView, UploaderView
urlpatterns = [
re_path(r'^upload/', FileUploadView.as_view())
re_path(r'^upload/', FileUploadView.as_view()),
path('uploader/', UploaderView, name="uploader")
]

View File

@ -1,9 +1,13 @@
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.parsers import MultiPartParser
from rest_framework.response import Response
from rest_framework import status
import easyocr
def UploaderView(request):
return render(request, 'sumasen_easyocr/index.html')
class FileUploadView(APIView):
parser_classes = [MultiPartParser,]