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() 
 
On Tuesday, 8 December 2020 at 23:34:30 UTC+10 Andrew Rogers wrote:

> 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
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/15d16738-c6b9-427b-a738-c6a683966ba3n%40googlegroups.com.

Reply via email to