Whenever I try to run, I'm getting the following error described below. I've already researched a solution, but I can not get it to work.
Exception Type: ValueError Exception Value:
ModelForm has no model class specified. Exception Location: /usr/local/lib/python2.7/dist-packages/django/forms/models.py in init , line 275 Python Executable: / usr / bin / python Python Version: 2.7.6
views.py
@login_required(login_url='/login/')
def cad_professor(request):
context = {}
if request.method == 'POST':
form = ProfessorForm(request.POST)
if form.is_valid():
form.save()
context['success'] = True
else:
form = ProfessorForm()
context['form'] = form
template_name = 'envelope/cad_professor.html'
return render(request,template_name , context)
forms.py
from django import forms
from .models import Professor
class ProfessorForm(forms.ModelForm):
class meta:
model = Professor