Hi!

In Django, you define a function that handles the request (the view in
django notation), and supply it with a request object.
This request object contains all your GET and POST data.

So instead of defining a class, you would define a function that
handles the request.

def myview(request):
...
#handle the request here
ip_address = request.META['REMOTE_ADDR']
...
render_to_response("template.html", {"ip_address": ip_address})

render_to_response is a shortcut that renders a html-template and
replaces variables you have defined there with the content of the
variables you pass as a dictionary to the function.
What you said about the url-configuration and the views is correct.
If you open a URL that is served by Django, Django tries to find a
matching entry in a file called urls.py. In this file, you specify
which request handler (view) is supposed to handle the request. The
request is then passed to that function, and the view has to return a
response object, which is then further handled by the Django
framework.

Django works very different from webapp, so I don't think you can
easily reuse a class that you have defined for webapp.

I suggest to have a look at the official Django tutorials:
http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01

If you want to use Django on App Engine, I recommend to have a look at
the sample project that is provided by app-engine-patch:
http://code.google.com/p/app-engine-patch/

This way, you can see Django on App Engine in action and have a look
at the source code to see how it works.
I don't know if I have answered your question, it was a bit general...

Best Regards,

Jesaja Everling


On Fri, Jan 30, 2009 at 1:54 PM, arnie <parvez...@rediffmail.com> wrote:
>
> Using webapp framework, I have created a class for handling the GET
> request:
> class myclass(webapp.RequestHandler)
>    def get(self):
> if i instead use the django then how the same class will be modified
> to use django framework? Though I have seen that django looks urls.py
> for requested urls and then refers views.py for matching views. So how
> can i use a class i"myclass" to handle the same?
> Correct me wherever appropriate as i have not used django before
> Thanks
> Arnie
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to