Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys I am trying to make a blog in django.It has two html files . Index.html and blog.html, the index.html consists the links to blog.html , The index has a overview to the actual post.
And the blog.html conbsists actual posts ,I have rendered them by for loop ,But The problem I am gettings is that the post content Which I making renders in a same blog page, Basically all the post render into same page instead of rendering as an individual page,

Here,s the index.html
HTML
{% for obj in object %}
                        <!-- Blog Post 1 -->
                        <div class="item post-1">
                          <div class="blog-card">
                            <div class="media-block">

                              <div class="category">
                                {% for i in obj.categories.all %}
                                <a href="#" title="View all posts in {{i}}">{{i}}</a>
                                {% endfor %}
                          
                              </div>

                              <a href="{% url 'blog' %}">
                                
                                <div class="mask"></div>
                              </a>
                            </div>
                            <div class="post-info">
                              <div class="post-date">{{ obj.published_date }}</div>
                              <a href="{% url 'blog' %}">
                                <h4 class="blog-item-title">{{ obj.title }}</h4>
                              </a>
                            </div>
                          </div>
                        </div>
                        {% endfor %}



Here,s the piece of blog.html which should render the content

HTML
{% for object in blog_object %}
      <div id="main" class="site-main">
        <div id="main-content" class="single-page-content">
          <div id="primary" class="content-area">
            <div id="content" class="page-content site-content">
              

                <div class="post-thumbnail">
                  
                </div>

                <div class="post-content">
                  <!-- /Entry header -->
                  
                    <!-- Entry meta -->
                    {% for i in object.categories.all %}
                    <div class="entry-meta entry-meta-top">
                      <span><a href="#" rel="category tag">{{i}}</a></span>        
                    </div>
                    {% endfor %}
                    <!-- /Entry meta -->

                    <h2 class="entry-title">{{object.title}}</h2>
                  
                  <!-- /Entry header -->

                  <!-- Entry content -->
                  <div class="entry-content">
                    <div class="row">
                      <div class=" col-xs-12 col-sm-12 ">
                        <div class="col-inner">
                          <p>{{object.body | linebreaks }}                         
                        </p></div>
                      </div>
                    </div>
                  </div>
                  <!-- /Entry content -->
    
                  <div class="entry-meta entry-meta-bottom">
                    <div class="date-author">
                      <span class="entry-date">
                        <a href="#" rel="bookmark">
                           <span class="entry-date">{{object.published_date}}</span>
                        </a>
                      </span>
                      {% endfor %}
                      <span class="author vcard">
                        <a class="url fn n" href="#" rel="author"> ^__i class="fas fa-user"> Ubaid</a>
                      </span>
                    </div>


What I have tried:

I tried google and stack overflowing but there,s no appropriate answer for my question
Posted
Updated 20-Feb-19 20:18pm
v2
Comments
Richard MacCutchan 21-Feb-19 4:18am    
Please do not repost the same question. If you need to add information then edit the original which, in this case, I have deleted.
Member 14068174 21-Feb-19 4:20am    
Sorry for the trouble. Please can you help me in this error..
Richard MacCutchan 21-Feb-19 4:43am    
Sorry, I do not know Django.
Member 14068174 21-Feb-19 4:44am    
Okay
Richard MacCutchan 21-Feb-19 4:48am    
The only thing I can see that looks odd is that your URLs do not contain valid links.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900