Groups
Groups
Sign in
Groups
Groups
web2py-users
Conversations
Labels
About
Send feedback
Help
How to import 'configuration' into a module
30 views
Skip to first unread message
Andrew Rogers
unread,
Dec 8, 2020, 8:34:30 AM
12/8/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
I want to use the auth functionality in a module.
I think I need to do this:
auth = Auth(db, host_names=configuration.get('host.names'))
Which means I need:
from gluon.tools import Auth
But how do I import the
'configuration'
module?
I couldn't find any mention of it here:
https://web2py.readthedocs.io/en/latest/index.html
Thanks
Andrew
Andrew Rogers
unread,
Dec 8, 2020, 8:38:46 AM
12/8/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
I found the answer 2 seconds after I posted the question which I did 20 minutes after looking through a lot of pages and code.
from
gluon.contrib.appconfig
import
AppConfig
from
gluon.tools
import
Auth
configuration = AppConfig()
Reply all
Reply to author
Forward
0 new messages