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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:56:20+00:00 2026-06-06T18:56:20+00:00

I am new to django . I am facing a small problem but unable

  • 0

I am new to django .
I am facing a small problem but unable to solve it.
In my template when I try to access any variable using {{ }} but it returns blank while displaying something as detailview.whereas it works fine in listview.

CODE:urls.py

urlpatterns = patterns('',

                           url(r'^$', ListView.as_view(
                                  queryset=Profile.objects.all().order_by("First_Name"),
                                  template_name="STUDENT_REGISTRATION.html")),
                           url(r'^(?P<pk>\d+)/$',DetailView.as_view(
                                  model=Profile,
                                  template_name="Profile.html")),

TEMPLATE:

{%extends "base.html" %}
{% block content %}


<h2>Registration No. :- {{ Profile.Registration_No }} <br>
    Full Name : {{ Profile.First_Name }} {{ Profile.Last_Name }} </h2>


<div class="Profile_meta">
{{ Profile.Date_of_Birth}}
</div>

<div class="Profile_body">
{{ Profile.Permanent_Address|safe|linebreaks }}
</div>


{%endblock%}

Plz help..

  • 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-06T18:56:21+00:00Added an answer on June 6, 2026 at 6:56 pm

    You should refer to your Profile instance as:

        {{ object.First_Name }} {{ object.Last_Name }}
    

    By the way, take a look at PEP8, try to keep CamelCaseNames for class names and underscores_names for instances. It will make your code easier to read.

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

Sidebar

Related Questions

I have some problem to figure out how new django views (template view) and
I'm quite new to Django Forms, and I'm facing a problem that I cannot
I'm new to Django. I'm using the simple pagination that Django provides but I
I'm new with Django + Ajax. My Problem is I can't get the value
I'm new with Django and python. I have a problem. Is there a way,
I'm new to Django but am working on the tutorial on the Django website
I'm new to Django, and try to develop my resume online. Here it is
I'm new to python and django but wanted to start following some tutorials. I
I have an existing PostgreSQL database that I'm using for a new Django site.
Is there a GUI tool using which I can design new Django models graphically?

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.