Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #67558 > unrolled thread

How to create a voting website by Python and Flask?

Started byHarry Wood <andywu1206@gmail.com>
First post2014-03-03 07:22 -0800
Last post2014-03-03 17:01 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  How to create a voting website by Python and Flask? Harry Wood <andywu1206@gmail.com> - 2014-03-03 07:22 -0800
    Re: How to create a voting website by Python and Flask? David Froger <david.froger@inria.fr> - 2014-03-03 17:01 +0100

#67558 — How to create a voting website by Python and Flask?

FromHarry Wood <andywu1206@gmail.com>
Date2014-03-03 07:22 -0800
SubjectHow to create a voting website by Python and Flask?
Message-ID<39d907df-7fc9-4843-ab8a-cb6a16e668a9@googlegroups.com>
How to create a voting website by Python and Flask? I studying Python and Flask for some months, and

 - Now I have some Python & Flask basic skills.
 - I need some advices like following example: 
Step 1: You could writing an voting application by Python Step 2: You could build a website by Flask ...
Thanks very much!

[toc] | [next] | [standalone]


#67562

FromDavid Froger <david.froger@inria.fr>
Date2014-03-03 17:01 +0100
Message-ID<mailman.7648.1393862577.18130.python-list@python.org>
In reply to#67558
Quoting Harry Wood (2014-03-03 16:22:22)
> How to create a voting website by Python and Flask? I studying Python and Flask for some months, and
> 
>  - Now I have some Python & Flask basic skills.
>  - I need some advices like following example: 
> Step 1: You could writing an voting application by Python Step 2: You could build a website by Flask ...
> Thanks very much!
> -- 
> https://mail.python.org/mailman/listinfo/python-list

Hi Harry,

For example:

You define an URL, something like /voting. Used with a GET request, the Python
function associated to the /voting URL renders and returns a template
containing a form. You can create the form using Flask-WTF, and use
Flask-Bootstrap to make your page looks better. The user fill the form, and
submit it (POST request on /voting). Here, the function associated with
/voting get the form data, and store it in a database.

You define a second URL, /results, which on a GET request reads your database
and returns the results by rendering a template, something like
render_template('result.html', result=result)

Hope it helps!
David

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web