title: Django Viewflow using class based views but getting error : Reverse for 'index' not found. 'index' is not a valid view function or pattern name
body: <p>I am using class based views for my  Django viewflow project. However I am getting the below error: </p>
  
  <blockquote>
    <p>Reverse for 'index' not found. 'index' is not a valid view function or pattern name</p>
  </blockquote>
  
  <p>Here are my classes:</p>
  
  <hr>
  
  <h2>rules/flows.py</h2>
  
  <pre><code>class MyFlow(Flow):
      """
      My App Flow
      """
      process_class = models.MyProcess
  
      start = flow.Start(
          views.MyDetailView,
          fields=["rule"],
          task_title="New Task"
      ).Permission(
          auto_create=True
      ).Next(this.end)
  
      end = flow.End()
  </code></pre>
  
  <h2>rules/urls.py</h2>
  
  <pre><code>rule_urls = FlowViewSet(MyFlow).urls
  
  urlpatterns = [
       url(r'^rule/', include(rule_urls, namespace='rule')),
       url(r'^(?P&lt;pk&gt;\d+)/mydetail/', MyDetailView.as_view(), {'flow_class': MyFlow, 'flow_task': MyFlow.start}, name='mydetail')
  ]
  </code></pre>
  
  <h2>rules/models.py</h2>
  
  <pre><code>class SubRules(models.Model):
      rule_id = models.AutoField(primary_key=True)
      src_id = models.IntegerField()
      src_description = models.CharField(max_length=160, blank=True)
      class Meta:
          db_table = 'sub_rules'
  
  
  class EntRules(models.Model):
      rule = models.OneToOneField(SubRules, primary_key=True, on_delete=models.CASCADE)
      entitlement_code = models.IntegerField()
      rule_approved = models.SmallIntegerField()
      rule_approved_datetime = models.DateTimeField(null=True)
      class Meta: 
          db_table = 'ent_rules'
  
  class MyProcess(Process):
      entrule = models.ForeignKey(EntRules, blank=True, null=True, on_delete=models.CASCADE)
      class Meta:
          permissions = (
                         ('approve_ent_rules','Can approve ent_rules')
                        )
  </code></pre>
  
  <h2>rules/forms.py</h2>
  
  <pre><code>class MyDetailForm(forms.ModelForm):
  
      class Meta:
         model = EntRules
         fields = [
                    'rule',
                    'entitlement_code',
         ]
  
  
      def __init__(self, *args, **kwargs):
         pk = kwargs.pop('rule_id', None)
         super(MyDetailForm, self).__init__(*args, **kwargs)
         sub_rule = SubRules.objects.get(rule_id=pk)
         self.fields['rule'].queryset = sub_rule.objects.filter(rule_id=pk)
  </code></pre>
  
  <h2>rules/views/my_detail.py</h2>
  
  <pre><code>class MyDetailView(StartFlowMixin, generic.UpdateView):
  
      model = EntRules
      template_name = 'rules/my_detail.html'
      form_class = MyDetailForm
  
      layout = Layout(
          Fieldset('Rule Details',
                   Row('rule',),
                   Row('entitlement_code',),
                   )
      )
  
      def activation_done(self, form):
          ent_rule = form.save()
          self.activation.process.entrule = ent_rule
          super(MyDetailView, self).activation_done(form)
  
      def get_object(self):
          return self.activation.process.entrule
  
  
      def get_form_kwargs(self):
          kwargs = super(MyDetailView, self).get_form_kwargs()
          pk = int(self.kwargs['pk'])
          kwargs['rule_id'] = pk
          return kwargs
  </code></pre>
  
  <h2>rules/templates/rules/my_detail.html</h2>
  
  <pre><code>{% extends "base.html" %}
  {% load material_form %}
  
  {% block content %}
      &lt;form method="POST"&gt;
          {% csrf_token %}
          &lt;div class="row"&gt;
              {% form form=form %} {% endform %}
              {{ activation.management_form }}
              &lt;div class="right"&gt;
                 &lt;button type="submit" name="_start" class="btn"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
     &lt;/form&gt;
  {% endblock %}
  </code></pre>
  
  <p>Can you please advise what could be the issue here ?</p>
  
  <p>I looked at <a href="https://stackoverflow.com/questions/42277033/process-views-outside-viewflow-frontend/42341071#42341071">Process Views outside viewflow.frontend</a> </p>
  
  <p>However how do I pass the sub_rule pk "^(?P\d+)" to startview as given in the URL like below ?</p>
  
  <pre><code>class MyFlow(Flow):
      start = flow.Start(detail_view_class=MyDetailTaskView)
  </code></pre>
  
  <p>Please advise.</p>