MongoDBForm error "ValueError:A document class must be provided"
<p>Hi i am creating a simple Sign Up form with django framework and mongodb. Following is my view:</p>

<pre><code>class SignUpView(FormView):
    template_name='MnCApp/signup.html'
    form_class=EmployeeForm()
    succes_url='/success/'
</code></pre>

<p>Following is my model:</p>

<pre><code>class Employee(Document):
    designation=StringField()
    department=StringField()
    emp_name=StringField(max_length=50)
    password=StringField(max_length=10)
</code></pre>

<p>Following is my <code>forms.py</code></p>

<pre><code>class EmployeeForm(DocumentForm):
    class meta:
        desigs=(
        ('D','Director'),
        ('GM','General Manager'),
        ('AM','Assistant Manager'),
        ('A','Associates')
            )
        deptts=(
            ('HR','Human Resources'),
            ('IT','IT Support'),
            ('TT','Technical Team'),
            ('SM','Sales and Marketting'),
            ('SS','Support Staff')
            )
        document=Employee
        fields='__all__'
        widgets={
             'designation':Select(choices=desigs),
             'department':Select(choices=deptts)
             }
</code></pre>

<p>Following is the traceback ValueError recieved on loading SignUpview
Traceback:</p>

<blockquote>
  <p>File "C:\Program Files\Python35\lib\site-packages\django\core\handlers\exception.py" in inner
    39.             response = get_response(request)</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\core\handlers\base.py" in _get_response
    187.                 response = self.process_exception_by_middleware(e, request)</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\core\handlers\base.py" in _get_response
    185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\views\generic\base.py" in view
    68.             return self.dispatch(request, *args, **kwargs)</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\views\generic\base.py" in dispatch
    88.         return handler(request, *args, **kwargs)</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\views\generic\edit.py" in get
    174.         return self.render_to_response(self.get_context_data())</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\views\generic\edit.py" in get_context_data
    93.             kwargs['form'] = self.get_form()</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\django\views\generic\edit.py" in get_form
    45.         return form_class(**self.get_form_kwargs())</p>
  
  <p>File "C:\Program Files\Python35\lib\site-packages\mongodbforms\documents.py" in <strong>init</strong>
    353.                 raise ValueError('A document class must be provided.')</p>
  
  <p>Exception Type: ValueError at /signup/
  Exception Value: A document class must be provided.</p>
</blockquote>

<p>I am not able to find root of this problem. I am new to django and this is my first project. Also is their anyother way for creating model forms for mongo documents??</p>

<p>I suspect that your inner class should be called <code>Meta</code>, not <code>meta</code>.</p>

python django mongodb mongoengine