Django1.7: ModelForm has no model class specified
<p>I'm getting "ModelForm has no model class specified." error in Django. I've spent hours to get this fixed, but can't see what the problem is.</p>

<p>Thank you very much in advance! </p>

<p><strong>Traceback:</strong><br />
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response</p>

<p>111: response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/LandonKoo/code/tango_with_django_project/rango/views.py" in add_category</p>

<p>71: form = CategoryForm()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/forms/models.py" in <strong>init</strong></p>

<p>312: raise ValueError('ModelForm has no model class specified.')</p>

<p>Exception Type: ValueError at /rango/add_category/ <br />
Exception Value: ModelForm has no model class specified.</p>

<p><strong>forms.py:</strong></p>

<pre><code>from django import forms
from rango.models import Page, Category

class CategoryForm(forms.ModelForm):
    name = forms.CharField(max_length=128, help_text="Please enter the category name.")
    views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)
    likes = forms.IntegerField(widget=forms.HiddenInput(), initial=0)
    slug = forms.CharField(widget=forms.HiddenInput(), required=False)
    print name, views, likes, slug
    # An inline class to provide additional information on the form.
    class Mata:
        # Provide an association between the ModelForm and a model
        model = Category
        fields = ('name',)
</code></pre>

<p><strong>views.py:</strong></p>

<pre><code>def add_category(request):

    if request.method=="POST":
        form = CategoryForm(request.POST)

        if form.is_valid():
            form.save(commit=True)

            return index(request)
        else:
            print form.errors
    else:
        form = CategoryForm()

    return render(request, 'rango/add_category.html', {'form': form})
</code></pre>

<p>Change </p>

<pre><code>class Mata:
</code></pre>

<p>to </p>

<pre><code>class Meta:
</code></pre>

<p>Also, I have never seen a print statement in a modelform. Take that out just in case too.  </p>

python django-1.7