the default data() function exposes all tables. That's why it's by default 
protected. When you stripped off your model, you deleted the part that 
istantiate all the authentication "feature" of web2py. 
By default every app has that "feature" (that is a module) available as 
"auth" . That's why the decorator call (auth.requires_*) goes into error: 
in your app "auth" doesn't exist.

Just delete the def data(): function and live happy for the time being ^_^

On Wednesday, July 17, 2013 10:35:37 AM UTC+2, Jeremy Hankenson wrote:
>
> Hello all, 
> Just learning how to program for the web and creating a simple blog to 
> learn off of. 
>
> I created app called blog and a new controller called blog.py and a model 
> called db.py. My blog controller looks like this:
> def index():
>     return dict()
>
> def create_post():
>     return dict()
>
> def remove_post():
>     return dict()
>
> def edit_post():
>     return dict()
>
>
>
> My model is incredibly simple as can be. 
> # -*- coding: utf-8 -*-
>
> db = DAL("sqlite://blog.sqlite")
>
> db.define_table('post',
>     Field('title', unique=True),
>     Field('author'),
>     Field('body', 'text'))
>
> When I run my website blog, I get a error as such: 
> <type 'exceptions.NameError'> name 'auth' is not defined
> but if I remove "@auth.requires_signature()" above the action "data" 
> inside the "default.py" file. My application will run just fine. 
>
> Why is this? What is the point of @auth.requires_signature() and why do I 
> only get this error after creating a model?
>
> Thank you very much, and thanks for the great framework!
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to