Hello world from scratch

download web2py and unzip it.

create a new app folder  web2py/applications/*hello*

create a model file web2py/applications/hello/*models/model.py
*
# coding: utf-8

from gluon.tools import Auth

db = DAL("sqlite://hello.db")
auth = Auth(db)
auth.define_tables()

db.define_table("hello", Field("world"))

create a controller file in web2py/applications/hello/*
controllers/whatever.py*

#coding: utf-8

def action():
    form = SQLFORM(db.hello).process()
    return dict(form=form)

create a view file in web2py/applications/hello/*views/whatever/action.html*

<html>
<head></head>
<body>
  {{=form}}
</body>
</html>

Now start web2py

python web2py.py

and access your app

http://localhost:8000/hello/whatever/action

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to