NameError: name 'auth' is not defined

1,292 views
Skip to first unread message

joscha

unread,
Jan 2, 2010, 4:49:03 PM1/2/10
to web2py-users
Hello,

I am new to web2py. I am trying to follow the documentation, but I
cannot get the image blog example to work. I copied the lines into the
db.py. If I select the database administration, I get the following
traceback:

Traceback (most recent call last):
File "C:\Users\sharky\Documents\_MEINE.DATEN\Programmierung\eclipse
\web2py\gluon\restricted.py", line 173, in restricted
exec ccode in environment
File "C:/Users/sharky/Documents/_MEINE.DATEN/Programmierung/eclipse/
web2py/applications/images/views/appadmin.html", line 44, in <module>
<p>{{=T('The "query" is a condition like "db.table1.field1==\'value
\'". Something like "db.table1.field1==db.table2.field2" results in a
SQL JOIN.')}}<br/>
NameError: name 'auth' is not defined

The line 44 contains:
if not auth.user:

I tried the windows version, the current hg clone and the source
version of web2py. It is always the same. What is my fault ?

mdipierro

unread,
Jan 2, 2010, 4:52:45 PM1/2/10
to web2py-users
Hi,

just to make sure I understand. Can you point me to the image blog
example?

When you edited db.py did you append the content or did you replace
it?
You are supposed to append it since db.py defines auth.

joscha

unread,
Jan 3, 2010, 9:07:11 AM1/3/10
to web2py-users
Hello.

The example starts on page 72(scribd page number. Its page 56 in the
documentation). The following page contains the db.py example.

I thought I have to replace the existing content. That was my fault.
Thx a lot.

Yarko Tymciurak

unread,
Jan 3, 2010, 12:57:57 PM1/3/10
to web2py-users
On Jan 3, 8:07 am, joscha <zippel...@web.de> wrote:
> Hello.
>
> The example starts on page 72(scribd page number. Its page 56 in the
> documentation). The following page contains the db.py example.

... yeah, there are 16 physical pages before page numbering starts w/
"1" (in the PDF you notice this)...

Reply all
Reply to author
Forward
0 new messages