bia-fitness/lifting/views.py
2015-04-01 18:19:20 -04:00

17 lines
431 B
Python

from django.shortcuts import render
from django import forms
class FitnotesUploadForm(forms.Form):
file = forms.FileField()
def fitnotes_upload(request):
if request.method == 'POST':
form = FitnotesUploadForm(request.POST, request.FILES)
if form.is_valid():
print(request.FILES['file'])
else:
form = FitnotesUploadForm()
return render(request, 'upload.html', {'form': form})