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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:03:25+00:00 2026-05-27T15:03:25+00:00

I have been using django for a while and I am now converting to

  • 0

I have been using django for a while and I am now converting to jinja2 because GAE told me too. One of the short cuts I use for django is to pass “self” to django when rendering my template so that in my template I call {{ self.stuff }}. In jinja it seems that “self” represents something. Does this require me to change all my templates to use perhaps “this”?

  • 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-05-27T15:03:26+00:00Added an answer on May 27, 2026 at 3:03 pm

    self is actually used by Jinja2 to allow you to reference blocks:

    <!-- In your layout.html file -->
    <title>{%- block title %}{% endblock %}</title>
    <!-- Some distance further down ... -->
    <h1>{{self.title()}}</h1>
    
    <!-- In a file that extends layout.html -->
    {% block title %}The Title of the Page{% endblock %}
    
    <!-- The above will render -->
    <title>The Title of the Page</title>
    <!-- Some other stuff ... -->
    <h1>The Title of the Page</h1>
    

    Simply use another name and everything will work (i.e., rather than self use this or obj as suggested by @Skirmantas).

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

Sidebar

Related Questions

I decided to learn Django Forms. For a while now, I have been using
I am kinda stuck, I've been using Django for a while now, but I
I've been developing in my own django environment for a while now using the
I have been using django-appengine and am now trying a project with django-nonrel. Before
I have a django project that I have been using for a while, but
I have been using sqlalchemy for a few years now in replacement for Django
Been using Django for < 1yr now, but this one is new-to-me. Hopefully someone?
I have been using django ORM, it's nice and very easy, but this time
I've been working with Django for a while now (currently on version 1.2), but
I am running cherokee to serve a django app using uwsgi. I have been

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.