Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:23:54+00:00 2026-06-05T09:23:54+00:00

I have followed a tutorial for making a blog engine and successfully integrated it.

  • 0

I have followed a tutorial for making a blog engine and successfully integrated it. It is just this template that is not working, I have no idea why. What can be the problem?

Here is the template:

{% extends "base.html" %}

{% block title %}{% post.title %}{% endblock %}

{% block content %}

<h3>{{ post.title }}</h3>
<p>Posted on {{ post.published|date:"F j, Y" }}<p>

{{ post.description|safe }}
<br>
{{ post.body|safe }}
<br>

{% if previous_post %}
<a href="{{ previous_post.get_absolute_url }}" title="{{ previous_post.title }}">
&laquo;&nbsp;Previous Post:&nbsp;&nbsp;{{ previous_post.title }}
</a>{% endif %}

{% if previous_post and next_post %}&nbsp;|&nbsp;{% endif %}

{% if next_post %}
<a href="{{ next_post.get_absolute_url }}" title="{{ next_post.get_absolute_url }}">
Next Post:&nbsp;&nbsp;{{ next_post.title }}&nbsp;&raquo;
</a>
{% endif %}

{% endblock content %}

And here is views.py:

def detail(request, sl):
try:
     post = Post.objects.filter(slug=sl)[0]
     try:
          previous_post = post.get_previous_by_published()
     except:
          previous_post = ""
     try:
          next_post = post.get_next_by_published()
     except:
          next_post = ""
except:
     next_post = ""
     previous_post = ""
     post = ""
return render_to_response('blog/detail.html', {'post':post,
                                        'next_post':next_post,
                                        'previous_post':previous_post,
                                                               },)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:23:57+00:00Added an answer on June 5, 2026 at 9:23 am

    Ok so I found out and solved my problem. Just wanted to post it here so someone can use it.
    It was actually a n00b mistake.

    So the {{}} weren’t rendering because of the fact that there was nothing in “sl” which I calling upon as argument in the function.
    It was empty because I was following a tutorial and the tutorial didn’t explain a very important thing about Django, and that is that the named groups can be added as arguments in functions, and I had no named group called “sl” in my urlconf in the appropriate place. So by adding this:

    (r'^([0-9]{4}/\d{1,2})/(?P<sl>.*)/$', detail),
    

    in the urlconf the problem was solved.

    Thanks for all the guidance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I have followed this tutorial and added iAd to my app: http://bees4honey.com/blog/tutorial/how-to-add-iad-banner-in-iphoneipad-app/ But the
I have followed this tutorial http://netbeans.org/kb/docs/websvc/gs-axis.html and successfully created the web service. When i
I have followed this tutorial ( http://stuffthathappens.com/blog/2008/11/13/android-animation-101/ ) and have a beautiful rotating text
I have followed this tutorial here as mentioned exactly I now try to run
I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
I have followed this tutorial, and made everything like the tutorial says... When I
I have followed the tutorial at: http://www.15seconds.com/issue/040331.htm for making a BHO, however i doesnt
I have followed a tutorial to create a simple blog writing application in PHP
I have followed this tutorial by Scott pretty much to the T against my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.