title: AttributeError: 'str' object has no attribute 'fields' Using Django non rel on GAE
body: <p>I'm doing an app with Django non rel on Google App Engine, and im using Bootstrap...to use Bootstrap on Django Forms i installed django_forms_bootstrap (<a href="https://github.com/pinax/django-forms-bootstrap" rel="nofollow">https://github.com/pinax/django-forms-bootstrap</a>)</p>
  
  <p>The thing is...when i deploy on GAE and trying to create a new user (registration) i get the Server Error (500), but the new user is created...the log of GAE show this:</p>
  
  <pre><code>&gt; Exception in request: Traceback (most recent call last):   File
  &gt; "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/core/handlers/base.py",
  &gt; line 113, in get_response
  &gt;     response = callback(request, *callback_args, **callback_kwargs)   File
  &gt; "/base/data/home/apps/s~softsystemanager/1.378394621720949564/myapp/modulos/presentacion/views.py",
  &gt; line 32, in signup_view
  &gt;     return render_to_response('presentacion/login.html', context_instance=RequestContext(request))   File
  &gt; "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/shortcuts/__init__.py",
  &gt; line 29, in render_to_response
  &gt;     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/loader.py",
  &gt; line 177, in render_to_string
  &gt;     return t.render(context_instance)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 140, in render
  &gt;     return self._render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 134, in _render
  &gt;     return self.nodelist.render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 830, in render
  &gt;     bit = self.render_node(node, context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 844, in render_node
  &gt;     return node.render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/loader_tags.py",
  &gt; line 124, in render
  &gt;     return compiled_parent._render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 134, in _render
  &gt;     return self.nodelist.render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 830, in render
  &gt;     bit = self.render_node(node, context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 844, in render_node
  &gt;     return node.render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/loader_tags.py",
  &gt; line 63, in render
  &gt;     result = block.nodelist.render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 830, in render
  &gt;     bit = self.render_node(node, context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 844, in render_node
  &gt;     return node.render(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 881, in render
  &gt;     output = self.filter_expression.resolve(context)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django/template/base.py",
  &gt; line 606, in resolve
  &gt;     new_obj = func(obj, *arg_vals)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django_forms_bootstrap/templatetags/bootstrap_tags.py",
  &gt; line 20, in as_bootstrap
  &gt;     form = _preprocess_fields(form)   File "/base/data/home/apps/s~softsystemanager/1.378394621720949564/django_forms_bootstrap/templatetags/bootstrap_tags.py",
  &gt; **line 10, in _preprocess_fields
  &gt;     for field in form.fields: AttributeError: 'str' object has no attribute 'fields'**
  </code></pre>
  
  <p>Then i go to the file bootstrap_tags.py and i see no error</p>
  
  <pre><code>&gt; def _preprocess_fields(form):
  &gt;     for field in form.fields:
  &gt;         name = form.fields[field].widget.__class__.__name__.lower()
  &gt;         if not name.startswith("radio") and not name.startswith("checkbox"):
  &gt;             form.fields[field].widget.attrs["class"] = " form-control"
  &gt;     return form
  &gt; 
  &gt; 
  &gt; @register.filter def as_bootstrap(form):
  &gt;     template = get_template("bootstrap/form.html")
  &gt;     form = _preprocess_fields(form)
  &gt; 
  &gt;     c = Context({
  &gt;         "form": form,
  &gt;     })
  &gt;     return template.render(c)
  </code></pre>
  
  <p>In the HTML file of my app i got this</p>
  
  <pre><code>&lt;div class="col-md-4 "&gt;
              &lt;form action="." method="POST"&gt;
                  {%csrf_token%}
                  {{ form|as_bootstrap}}
                  &lt;button type="submit" class="btn btn-default"&gt;Sign UP&lt;/button&gt;
              &lt;/form&gt;     
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>and i don't know if this is useful but here is the form</p>
  
  <pre><code>class RegisterForm(forms.Form):
      username = forms.CharField(label="Nombre de Usuario",widget=forms.TextInput())
      name = forms.CharField(label="Nombre",widget=forms.TextInput())
      last_name = forms.CharField(label="Apellido",widget=forms.TextInput())
      email = forms.EmailField(label="Correo Electronico", widget=forms.TextInput())
      password_one = forms.CharField(label="Password", widget=forms.PasswordInput(render_value=False))
      password_two = forms.CharField(label="Confirmar Password", widget=forms.PasswordInput(render_value=False))
  </code></pre>
  
  <p>In fact, the error is with this particular form, because i have another one, the login form, and it works perfectly and im using the same procedure to use the django_forms_bootstrap</p>
  
  <p>The source code of my singup_view is:</p>
  
  <pre><code>def signup_view(request):
      form = RegisterForm()
      if request.method == "POST":
          form = RegisterForm(request.POST)
          if form.is_valid():
              username = form.cleaned_data['username']
              name = form.cleaned_data['name']
              last_name = form.cleaned_data['last_name']
              email = form.cleaned_data['email']
              password_one = form.cleaned_data['password_one']
              password_two = form.cleaned_data['password_two']
              newUser = User.objects.create_user(username=username, first_name=name, last_name=last_name, email=email, password=password_one)
              newUser.save()
              return render_to_response('presentacion/login.html', context_instance=RequestContext(request))
          else:
              ctx = {'form':form}
              return render_to_response('presentacion/sign_up.html',ctx, context_instance=RequestContext(request))
      ctx = {'form':form}
      return render_to_response('presentacion/sign_up.html',ctx, context_instance=RequestContext(request))
  </code></pre>
  
  <p>Please Help!!!</p>