Created a configuration file.
Contains a CSRF_ENABLED token and a SECRET_KEY token.
Changed the init script to add the config object.
Added forms.py.
The Form class has to be subclassed to create a web form.
The login form created here works with OpenID. This is a more secure way to go about it instead of using a typical username/pass thingy.
Also, there is a remember_me checkbox which is applicable if the login is to be stored as a cookie.
Created a login.html template for the LoginForm class.
It extends from base.html and adds the login functionality. Extending from the base template ensures a consistent layout across all pages.
form.hidden_tag() template arg gets replaced with a hidden field which implements CSRF prevention that was enabled in config.py.
The openid field has a width of 80 chars.
As we don't have a submit button defined in the form class, we define it here as a regular field.
Added a view function in views.py for the login form template.
This passes the form object to the template as needed. The view function accepts GET and POST requests. POST requests bring user data.
Added a validate_on_submit() method call.
It does form processing: if it is called when form is being presented to the user (before they get a chance to input shit) it will return False, so the template has to be rendered.
If it is called as part of a form submission request, it gathers data, runs validators attached to fields, and returns True if all okay. If any one field fails during validation then it returns False. Error messages will be added later.
flash function shows a message on next page presented to the user. redirect function tels the browser to navigate to a different web page than the one requested.
Changed base.html to include functionality to display flashed messages.
Changed the login template to display error messages.
Form field validation errors are usually found in form.errors.fieldname.
Fixed missing endfor issue.
Made changes recognize list of OpenID providers.
1. Changed config.py to add an array of OpenID providers, with their links.
2. Changed views.py to add a providers kwarg to render_template in login().
3. Changed the login.html template significantly. It now has a javascript function that prompts for the username and then composes the OpenID. The providers are looped through and the function is kept as an anchor for each provider name.
Added </script> to end the script tag.
Merge pull request #1 from VaticanCameos/ch3

Adding chapter 3