Skip to content

Instantly share code, notes, and snippets.

@godfather68
Created January 18, 2021 18:58
Show Gist options
  • Save godfather68/3ff6df4fda5f6db7019ff6b954e1cf97 to your computer and use it in GitHub Desktop.
Save godfather68/3ff6df4fda5f6db7019ff6b954e1cf97 to your computer and use it in GitHub Desktop.
from django.shortcuts import render
from django.http import JsonResponse
from django.views.generic import FormView
from .forms import *
# Create your views here.
class HomeView(FormView):
form_class = UploadForm
template_name = 'index.html'
success_url = '/'
def form_valid(self, form):
upload = self.request.FILES['file']
return super().form_valid(form)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment