user3536089
user3536089

Reputation: 1

What is best way to save data with appengine/HTML5/JavaScript/Python combo?

I want to build an application with an HTML5 interface that persists data using google-app-engine and could do with some some advice to avoid spending a ton of time going down the wrong path.

What is puzzling me is the interaction between HTML5, Javascript/JQuery and Python.

Let's say, I have designed an HTML5 site. I believeetc I can use prompts and forms to collect data entered by users. I also know that I can use Javascript to grab that data and keep it in the form of objects...I need objects for reasons I'll not go into.

But when I look at the app-engine example, it has HTML form information embedded in the Python code which is what is used to store the data in the cloud Datastore.

This raises the following questions in my mind:

  1. do I simply use Python to get user entered information?
  2. how does python interact with a separately described HTML5/CSS2 forms and prompts?
  3. does Javascript/Jquery play any role with respect to data?
  4. are forms and prompts the best way to capture use data? (Is there a better alternative)

As background:

I appreciate this is basic basic stuff but if I can get my plumbing sorted, I doubt that I'll have to ask too man more really stupid questsions

Gary

Upvotes: 0

Views: 145

Answers (4)

user3536089
user3536089

Reputation: 1

My thanks to all of you for taking time to respond. Each response was useful it it's own way.

The AJAX/JQuery looks a promising route for me, so many thanks for the link on that. I'll stop equivocating and stick with Python rather than try Go and start working through the tutorials and courses.

Gary

Upvotes: 0

Chameleon
Chameleon

Reputation: 10128

You question is too complex but I will answer simply to help you. I use all what you want use.

Google App Engine is web server.

Html page is web request.


When user click "submit" Html page (web request) is send to Google App Engine (server) and it is routed by url to handler.

Handler can read all params from form.

self.request.params.get('something')

You can stored some data in models and retrive it later.

SomeForm(db.Model): userName = db.StringProperty()

form = SomeForm()
form.userName = self.request.params.get('userName')
form.put()

When user click "button" with some jquery/ajax action it send to to Google App Engine (server) and it is routed by url to handler.

Again all is the same apart that you can use json to communicate and send back result to page and update content with jquery again.


I am using Eclipse 3.8 (support dual monitors - 4.x not do it) + pyDev + javascript + HTML5 + Css3 plugins + git ... - It will allow you very stable programing with debugging.

I am using pure GAE + django (support internationalization better than Jinja) + jquery + ...


Questions are basic but not stupid. Please vote on answer.

Upvotes: 0

voscausa
voscausa

Reputation: 11706

Q1 : Udacity has an excellent course web development, which is making use of app engine, webapp2, jinja, python 2.7 and HTML forms.

Q2: You can use the Python packages jinja and wtforms or use django or others to interact with users.

Q3: Only if you need it. You do not need it for basic form IO.

Q4: You can also process forms with javascript and jquery / ajax.

Upvotes: 1

radia
radia

Reputation: 1486

App engine supports python 2.7, it gives you access to several tools and libraries.

You have tutorials in app engine documentation to get started with python and all you need to know but it is not a sufficient source.

Getting started with app engine(Python) https://developers.google.com/appengine/docs/python/gettingstartedpython27/introduction

To send your forms you can to use AJAX with JQuery framwork, check out this tutorial:

http://pythoughts.com/ajax-with-google-app-engine/

And forms processing can be handled by webapp2 framework

Handling forms with webapp2:

https://developers.google.com/appengine/training/py101_1/lesson3

Explaining the webapp2 Framework

https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingwebapp

Upvotes: 0

Related Questions