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

  • Home
  • SEARCH
  • 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 7179123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:04:35+00:00 2026-05-28T17:04:35+00:00

I call a template like this from my view: return render_to_response(‘mytemplate.html’, context_instance=RequestContext(request)) I’m trying

  • 0

I call a template like this from my view:

return render_to_response('mytemplate.html', context_instance=RequestContext(request))

I’m trying to access the hostname of my current server (in this case, localhost), but it just prints blank when I place {{request.META.SERVER_NAME}} in the template.

In my settings.py file, I don’t have any TEMPLATE_CONTEXT_PROCESSORS defined. I’m not sure if I need to specify anything there, or if that could solve the problem.

  • 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-28T17:04:36+00:00Added an answer on May 28, 2026 at 5:04 pm

    You have to add the request context processor to have it added to the template context automatically. Or you could explicitly add the request to the context dictionary render_to_response('foo', {'request': request})

    https://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-request

    Note that if you add the request context processor, you should remember to add the defaults as well.

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

Sidebar

Related Questions

From a master html template I'm calling #{doLayout} which renders my view html. I'd
I would like to return an EditorTemplate from my controller as a Partial View.
I have a UIWebView with content populated from a Last.fm API call. This content
I want to emit some js from jQuery templates e.g I have template like
Anyone know how you can call a functional equivalent to Html.EditorFor() from the Controller?
I have a situation like this: there are three Django models, let's call them
I originally created an editor template like this @model MyModel var items = //
Here is a template I call to generate a menu, and it kinda breaks.
I have a template class that I serialize (call it C), for which I
I have a template I made that sets variables that rarely change, call 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.