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 9004099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:49:33+00:00 2026-06-16T00:49:33+00:00

I have a base template with a header include in it. The header include

  • 0

I have a base template with a header include in it. The header include contains the code below.

However for some reason I get no output in between the if block, any reason why? ps no errors. The rest of the template outputs just fine.

base.html

<body>
    {% include 'includes/header.html' %}
    {% block sliderWrapper %}{% endblock %}
    {% block titleWrapper %}{% endblock %}
    <div id="wrapper">
        <div class="container">
            {% block mainWrapper %}{% endblock %}
        </div>
    </div>
    {% include 'includes/footer.html' %}
    {% include 'includes/copyright.html' %}
    {% include 'includes/js.html' %}
</body>

content of {% include ‘includes/header.html’ %} below…. everything shows just not the two login/logout links. take them out the block and they show. neither statement shows in the if

   <div class="span9">
                    <div class="navbar navbar-inverse">
                        <div class="navbar-inner">
                            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </a>
                            <div class="nav-collapse collapse">
                                <ul class="nav">
                                    <li><a href="/">Home</a></li>
                                    <li><a href='{% url django.contrib.flatpages.views.flatpage url="how-it-works/" %}'>How does it work?</a></li>
                                    <li><a href='{% url django.contrib.flatpages.views.flatpage url="how-it-works/" %}'>Download</a></li>
                                    <li><a href="/member/registration/">Register</a></li>
                                    {% if user.is_authenticated %}
                                        <li><a href="/member/logout/">Logout</a></li>
                                    {% else % }
                                        <li><a href="/member/login/">Login</a></li>
                                    {% endif %}
                                </ul>
                            </div>
                        </div>
                    </div>

“django.contrib.auth.context_processors.auth” is installed and sessions in enabled.

If I output {{ user }} i get AnonymousUser which is what I except, so, one would assume the ‘else’ condition would fire, however neither conditions seem to be met.

The request context is being passed also…

return render_to_response('pageRegistration.html', context,context_instance=RequestContext(request))
  • 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-16T00:49:34+00:00Added an answer on June 16, 2026 at 12:49 am

    I believe there’s a syntax error in your code that passed by unnoticed:

    {% else % }
    

    should be:

    {% else %}
    

    Django template system probably looks for a regex {%...%}, and as that didn’t match, it was regarded simply as text inside the {% if %}{% endif %} node.

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

Sidebar

Related Questions

I have the following: base.html <html> {% include 'header.html' %} <div> {% block content
i have template base.html and some children templates. I don't know how to set
I have a base.html template that contains a list of links. Example: <div id=sidebar1>
I have String object with template base, something like: <h1>{{header}}</h1> {{#bug}} {{/bug}} {{#items}} {{#first}}
I have a base Class akin to the code below. I'm attempting to overload
Yo so i have a base.html: <html> <body> <div id=header> ... </div> {% block
So in my base template, I have: {% render EcsCrmBundle:Module:checkClock %} Then I created
I have the following scenario :- template <typename T> class Base { public: virtual
Possible Duplicate: C++ Inherited template classes don't have access to the base class I'm
At the moment, I have a base HTML template file. When ever I want

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.