title: how to pass a primary key to a view in django?
body: <p>I am trying to implement a class based view that should create a update form to update my model form but I don not know how to pass the pk from my base.html to my view:</p>
  
  <p>viewvs.py:</p>
  
  <pre><code>from artdb.models import *
  
  class UpdateForm(UpdateView):
  
      print('updateform')
      model=Date
      fields=['activity']
      template_name='updateForm.html'
  </code></pre>
  
  <p>updateForm.html:</p>
  
  <pre><code>{% extends "artdb/base.html" %}
  
  {% block upd %}
      &lt;form action="" method="post"&gt;
      {% csrf_token %}
      {{ form.as_p }}
       &lt;input type="submit" value="Update"&gt;
       &lt;/form&gt;
  {% endblock upd %}
  </code></pre>
  
  <p>base.html:</p>
  
  <pre><code>&lt;p&gt;&lt;a class="btn btn-secondary"  href="{% url 'artdb:updateform' %}" role="button"&gt;update form &amp;raquo;&lt;/a&gt;&lt;/p
  {% block upd %}
  {% endblock upd %}
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>urlpatterns = [
  path('&lt;pk&gt;/updateform/',views.UpdateForm.as_view(),name='updateform'),
  ]
  </code></pre>
  
  <p>I think that pk should be passed in the base.html but I am not shure how. Any suggestions?</p>