Click here to Skip to main content
15,314,644 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
{% 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 %}

                              <a href="{% url 'blog' %}">
                                <div class="mask"></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>
                        {% endfor %}

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

{% 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 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>        
                    {% 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 }}                         
                  <!-- /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>
                      {% endfor %}
                      <span class="author vcard">
                        <a class="url fn n" href="#" rel="author"> ^__i class="fas fa-user"> Ubaid</a>

What I have tried:

I tried google and stack overflowing but there,s no appropriate answer for my question
Updated 20-Feb-19 20:18pm
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
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.
Member 14068174 21-Feb-19 4:50am
Can you please tell me which URL doesn't contain valid URLs. I am not able to analyse
Richard MacCutchan 21-Feb-19 4:51am
Read your code.
Member 14068174 21-Feb-19 4:59am
I can't find any invalid url
Richard MacCutchan 21-Feb-19 5:21am
<a class="url fn n" href="#" rel="author"> Ubaid</a>
What does the # character point to?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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