title: Fill out Django form with data obtained from URL
body: <p>I want to create a new Fallacy (see models.py) via the form to which I get over the url <code>path('&lt;slug:slug_tree&gt;/new/', views.CreateFallacyView.as_view(), name='create_fallacy'),</code>.
  So the user is on the <code>TreeDetailView</code> (which corresponds to a certain Tree), and he can add a new Fallacy to this tree. The user should input title and detail, but the Tree (ForeignKey) should be assigned in the code. It should be assigned to the corresponding Tree from which he was directed to the CreateFallacyView.
  The slug of the tree is inside the URL, so I thought I could use that information somehow, but I have no idea how I can proceed with that information.
  Any help is appreciated! Or probably there are other more elegant solutions?</p>
  <p>Many thanks!</p>
  <p><strong>models.py</strong></p>
  <pre><code>class Tree(models.Model):
      title = models.CharField(max_length=50)
      detail = models.TextField()
      slug = models.SlugField(allow_unicode=True, unique=True, null=True, blank=True)
      
  class Fallacy(models.Model):
      title = models.CharField(max_length=50)
      detail = models.TextField()
      tree = models.ForeignKey(Tree, related_name='fallacy', on_delete=models.CASCADE)
        
  </code></pre>
  <p><strong>views.py</strong></p>
  <pre><code>class CreateFallacyView(generic.CreateView):
      form_class = forms.FallacyForm
  </code></pre>
  <p><strong>forms.py</strong></p>
  <pre><code>class FallacyForm(forms.ModelForm):
  
      class Meta:
          model = models.Fallacy
          fields = ('title', 'detail')
  </code></pre>
  <p><strong>urls.py</strong></p>
  <pre><code>app_name = 'argtree'
  
  urlpatterns = [
      path('', views.TreeListView.as_view(), name='all'),
      path('&lt;slug:slug_tree&gt;/', views.TreeDetailView.as_view(), name='tree_detail'),
      path('&lt;slug:slug_tree&gt;/new/', views.CreateFallacyView.as_view(), name='create_fallacy'),
  </code></pre>