I am using version Version 1.99.4 (2011-12-14 14:46:14) stable
The whole traceback msg is
Traceback (most recent call last):
File "C:\workspaces\Python\portal_iUrnik_web2py\gluon\restricted.py", line
204, in restricted
exec ccode in environment
File
"C:/workspaces/Python/portal_iUrnik_web2py/applications/portalov_iurnik/controllers/default.py"
<http://192.168.100.101/admin/default/edit/portalov_iurnik/controllers/default.py>,
line 35, in <module>
File "C:\workspaces\Python\portal_iUrnik_web2py\gluon\globals.py", line 172,
in <lambda>
self._caller = lambda f: f()
File
"C:/workspaces/Python/portal_iUrnik_web2py/applications/portalov_iurnik/controllers/default.py"
<http://192.168.100.101/admin/default/edit/portalov_iurnik/controllers/default.py>,
line 33, in user
form = auth()
NameError: global name 'auth' is not defined
On Friday, August 24, 2012 1:08:43 PM UTC+2, Anthony wrote:
>
> Also, what version of web2py are you using?
>
> On Friday, August 24, 2012 7:07:49 AM UTC-4, Anthony wrote:
>>
>> Can you show the traceback(). Also, maybe pack and attach a minimal app
>> that reproduces the problem.
>>
>> On Friday, August 24, 2012 5:14:20 AM UTC-4, Yebach wrote:
>>>
>>> Hello
>>>
>>> So I am really struggling with web2py user registration
>>> I have a database that contains come required tables for webapp to work.
>>> Now I want to create a user register form etc.
>>> In db.py I added a create table
>>> #This is used to connect also to all other tables, SHOULD I CREATE A
>>> NEW CONNECTION FOR USER TABLES?????
>>> db =
>>> DAL('postgres://postgres:postgres@localhost/'+request.vars['school'],
>>> migrate=False)
>>>
>>> from gluon.tools import Auth
>>> auth = Auth(db, hmac_key=Auth.get_or_create_key())
>>> auth.define_tables()
>>> ## configure auth policy
>>> auth.settings.registration_requires_verification = False
>>> auth.settings.registration_requires_approval = False
>>> auth.settings.reset_password_requires_verification = True
>>>
>>> And In my controler I have the following code in default.py
>>> def user():
>>> return dict(form=auth())
>>>
>>> In view I have the following script
>>> {{='auth' in globals() and auth.navbar(separators=(' ',' | ',''))}}
>>>
>>> I copied all this from web2py welcome app.
>>>
>>> I get an error NameError: global name 'auth' is not defined
>>>
>>> Any suggestions? The tables for user are not created yet. Is a user
>>> function in a wrong controler, should I created a new one? Because If I do,
>>> then the wrong funciton is called and again I get an error.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
--