title: DRF forms - 'str' object has no attribute 'data'
body: <p>I'm trying to use the example found here - <code>http://www.django-rest-framework.org/topics/html-and-forms/</code></p>
  
  <p>I'm literally cut/pasting from the example changing it to my own model - </p>
  
  <p>I'm accessing the form through the following code in my base.html - </p>
  
  <pre><code>{% include 'dashboard/widget_detail.html' %}
  </code></pre>
  
  <p>widget_details.html</p>
  
  <pre><code>{% load rest_framework %}
  
  &lt;h1&gt;Profile - {{ widget.name }}&lt;/h1&gt;
  
  &lt;form action="{% url 'widget-detail' pk=widget.pk '%}" method="POST"&gt;
      {% csrf_token %}
      {% render_form serializer %}
      &lt;input type="submit" value="Save"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>class WidgetDetail(APIView):
      renderer_classes = [TemplateHTMLRenderer]
      template_name = 'dashboard/widget_detail.html'
  
      def get(self, request, pk):
          widget= get_object_or_404(Widget, pk=pk)
          serializer = WidgetSerializer(widget)
          return Response({'serializer': serializer, 'widget': widget})
  
      def post(self, request, pk):
          widget= get_object_or_404(Widget, pk=pk)
          serializer = WidgetSerializer(widget)
          if not serializer.is_valid():
              return Response({'serializer': serializer, 'widget': widget})
          return redirect('widget-list')
  </code></pre>
  
  <p>When trying to load the URL for my base.html I get the following traceback - </p>
  
  <pre><code>Traceback:
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
    132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/enterpass/gui/views.py" in display_base
    37.                           context_instance=RequestContext(request))
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/shortcuts.py" in render_to_response
    45.             using=using)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
    115.                         template_name, context, context_instance, dirs, dictionary)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/engine.py" in render_to_string
    221.             return t.render(context_instance)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/base.py" in render
    209.                     return self._render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/base.py" in _render
    201.         return self.nodelist.render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/base.py" in render
    903.                 bit = self.render_node(node, context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/debug.py" in render_node
    79.             return node.render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    159.                 return template.render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/base.py" in render
    211.                 return self._render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/base.py" in _render
    201.         return self.nodelist.render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/base.py" in render
    903.                 bit = self.render_node(node, context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/debug.py" in render_node
    79.             return node.render(context)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/defaulttags.py" in render
    507.                         six.reraise(*exc_info)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/template/defaulttags.py" in render
    493.             url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
    578.     return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
  File "/opt/enterpass_app/lib/python2.7/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
    495.                              (lookup_view_s, args, kwargs, len(patterns), patterns))
  
  Exception Type: NoReverseMatch at /dashboard/
  Exception Value: Reverse for 'widget-detail' with arguments '()' and keyword arguments '{u'pk': ''}' not found. 2 pattern(s) tried: [u'api/widgets/(?P&lt;pk&gt;[^/.]+)\\.(?P&lt;format&gt;[a-z0-9]+)/?$', u'api/widgets/(?P&lt;pk&gt;[^/.]+)/$']
  </code></pre>
  
  <p>I have no idea what I'm missing/doing wrong.</p>
  
  <p>I can access <code>http://localhost/api/widgets/5</code> no problem (as an example)</p>
  
  <p>Update - if I remove the PK value from the form - </p>
  
  <pre><code>&lt;form action="{% url 'api:widget-detail' %}" method="POST"&gt;
      {% csrf_token %}
      {% render_form serializer %}
      &lt;input type="submit" value="Save"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I get the following error - </p>
  
  <pre><code>'str' object has no attribute 'data'
  </code></pre>
  
  <p>Which makes sense because I have no data yet.  All I want is a blank form using my serializer as a backend to fill out and "save".  How hard is this to do?!</p>
  
  <p>Including my urls.py where it's resolving from - </p>
  
  <pre><code>router = routers.DefaultRouter()
  router.register(r'widgets', views.WidgetViewSet)
  
  urlpatterns = [
      url(r'^', include(router.urls)),
  ]
  </code></pre>