I am working on python, i want to develop some simple web application which consists of 3 pages(forms)
login screen
which should validate username and password and redirect to 2nd pageIf user present it redirects to this page which consists of a list of records and
add button
to add another recordWhen clicked on
add record
in 2nd page that should redirect to this page which consists of a simple form fields which takes data and saving to 2nd page as a record in a list when clicked onsubmit
button
I don't want to use high level frameworks like django for the above small requirement so decided to use one of the following frameworks after googgling a lot
Wheezy.web ( https://bitbucket.org/akorn/wheezy.web/downloads)
web.py ( http://webpy.org/)
bottle (http://bottlepy.org/docs/dev/)
Flask (http://flask.pocoo.org/)
I started to use web.py
framework and created a code.py
file as indicated in the tutorial as below
code.py
import web
render = web.template.render('templates/')
urls = ( '/', 'index' )
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
After running the above file with python code.py
the result is
sh-4.2$ python code.py
http://0.0.0.0:8080/
i have change the ip and port as below
python code.py 192.168.1.112:2030
and tried to access through a browser , then i recieved the following error
<type 'exceptions.KeyError'> at /
u'index'
Python /usr/lib/python2.7/site-packages/web/application.py in _delegate, line 418
Web GET http://0.0.0.0:8080/
Traceback (innermost first)
/usr/lib/python2.7/site-packages/web/application.py in _delegate
cls = fvars[f] ...
▶ Local vars
/usr/lib/python2.7/site-packages/web/application.py in handle
return self._delegate(fn, self.fvars, args) ...
▶ Local vars
/usr/lib/python2.7/site-packages/web/application.py in process
return self.handle() ...
▶ Local vars
Request information
INPUT No data.
COOKIES No data.
...............
Actually when i type the url in to address bar a hello world message should appear as indicated in tutorial, but instead i am getting the above error.
- Can anyone please suggest on how to achieve the above requirement for developing a login screen in python without using a django framework and cgi in python
- I am unable to find out how to use these frameworks to use to develop because for example
Wheezy.web ( https://bitbucket.org/akorn/wheezy.web/downloads)
framework provided there is no docuemntation showing on how to create a file and start developing
please help me on the above scenarios