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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:58:24+00:00 2026-05-17T06:58:24+00:00

I am using templates with django. I am having a problem where the Context

  • 0

I am using templates with django. I am having a problem where the Context is not being rendered. The meta_k is null. The meta_description is not.

 t = get_template('projects.html')   
 html = t.render(Context({
       'completed': completed, 
       'current':current, 
       'description': sp.description, 
       'project_title':sp.name, 
       'img':images, 
       'meta_desc': sp.meta_description, 
       'meta_k:': sp.meta_keywords
 }))

I can start the server in debug mode in eclipse and So I know sp.meta_keywords is not null. Here is where I call the code in projects.html:

{% block meta_keywords %}<br>
{% if meta_k %}<br>
&nbsp;&nbsp;&nbsp;&nbsp;{{ meta_k }}<br>
{% else %}<br>
&nbsp;&nbsp;&nbsp;&nbsp;Venkat, Rao, engineer, inventor, entrepreneur, projects, blue dart, control systems, labview<br>
{% endif %}<br>
{% endblock %}

This defaults to the else when I know meta_k should not be null. The complete code can be found here on Google Code.

What am I doing wrong?

  • 1 1 Answer
  • 2 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-05-17T06:58:24+00:00Added an answer on May 17, 2026 at 6:58 am

    So I was just making stupid mistake:

    In the rendering file I have:

    html = t.render(Context({'completed': completed, 'current':current, 'description': sp.description, 'project_title':sp.name, 'img':images, 'meta_desc': sp.meta_description, 'meta_k:': sp.meta_keywords)
    

    this refers to “meta_k:” note the semicolon

    in the template I have

    {% if meta_k %}
    

    note no semicolon

    If I remove the semicolon it works. That was stupid.

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

Sidebar

Related Questions

I have a problem using the '|default' in django templates. If I do this
Context: HTML widgets generated using a Django ModelForm and template, jQuery 1.3.2, JavaScript on
I want to send HTML-emails, using Django templates like this: <html> <body> hello <strong>{{username}}</strong>
Trying to work with a trivial navigation menu using django templates, I'm having trouble
I'm having a problem uploading files on my production server. I'm using the django-stdimage
I am having issues with get_absolute_url in my django templates when using django page
I keep getting this error when using django templates in Google App Engine: TemplateSyntaxError:
So I am creating a website using Django templates, forms etc. One thing I've
I'm displaying user messages through templates using RequestContext in Django, which gives access to
This is using the web app framework, not Django. The following template code is

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.