limodou wrote:
HttpResponse just return the message to the caller, not directly to the screen.

Who/what is the caller?

render_to_response is a utility function provided by django, if you
don't want to use it, you can do it yourself, just like:

It's not that I have something against render_to_response, it's that all the tutorials and docs seem to be saying that the "correct" way is HttpResponse and my objective is to be consistent with the published materials. (Failing that, I'd like to understand why the app I'm trying to build requires a different approach than seemingly everything else.)

So is there an error in the tutorials in that HttpResponse won't, in fact, cause that string to appear on the screen? If it will do that, then what is required to make it happen?

I realize I'm missing something basic and fundamental so please forgive my ignorance.

template receives variable, and it should be invoked by views.

Ok, that's beginning to sink in somewhat. But in the tutorial example

  (myproject/apps/polls/views.py)
  def index(request):
    return HttpResponse("Hello, world. You're at the poll index.")

what variable receives the "Hello, world" string?

Thanks for your patient help. Wish I could read your Chinese-language tutorial.

Michael

Reply via email to