Good day Django experts and enthusiasts! 

I have the following situation (source code is at the end of this post): 

I have one template that is used by DetailView for **post** model (i.e. show detail of particular instance of post). In this template, I have context\_object\_name **post** in the template - that object has an ID. In this DetailView, there is an URL link to another CreateView template. That create view is for **comment** model. There is foreign key relationship between **post** and **comment** - one post can have 0 - more comments. 

When I click on DetailView for **post**, I have a link for CreateView for comment. When user is writing a comment for post and hits *save button*, I need to have post.id available in the template in the template for CreateView (I would like to send it as hidden field in form for comment so that **comment** model has post.id available in save() method - that would cover the need for foreign key when saving **comment**). 

Now to the merit of my problem: 

I would like to send a post.id from DetailView template to CreateView template (so I can use it as hidden form). Problem is, post.id is not received by template for CreateView for comment. Source code covering my needs is as follows: 

Template for DetailView (of **post**), namely the url linking to CreateView (for **comment**): 

```
<a  class="btn btn-danger" href="{% url 'commentpost' post_id=post.id %}">Reagovat</a>

```

A row for application level urls.py taking care of `commentpost` URL: 

```
path('commentpost/<int:post_id>/',CommentPostView.as_view(),name='commentpost')

```

I was thinking that template for commentpost URL should have `{{ post_id }}` value available ... however, than one comes empty to the commentpost template -> a row in template for commentpost:
`<tr><td>ID:{{ post_id }}</td></tr>`.

CreateView for comment: 

```
class CommentPostView(CreateView):
    model = Comment
    context_object_name = 'comment'
    form_class = NewCommentForm
    template_name = 'new_comment.html'

```

Model for Comment:

```
class Comment(models.Model):
    post = models.ForeignKey(Post,on_delete=models.CASCADE)
    author = models.CharField(max_length = 100, choices = DEPARTMENTS)
    date_sent = models.DateTimeField()
    text = models.TextField(max_length = 255)

```

Basically the flow should be as follows: 
1) DetailView template sending `post_id` -> 2) urls.py taking care of the `post_id` value - calling the correct view 3) View rendering the template and template receiving `post_id` value. 

I am 100% sure the `post_id` value in step 1) is not empty. The URL for step 1) i.e. DetailView looks as follows: `http://192.168.56.101:8080/detailpost/1360`

Does any of you have an idea what am I missing? 

Thank you very much in advance for any suggestions, take care.