On Saturday, July 18, 2020 at 2:15:13 PM UTC-7, [email protected] wrote:
>
> Hi,
>
> Im replicating the example from the book for better testing:
>
> ./modules/mytest.py
>
> from gluon import current
>
> def ip():
> return current.request.client
>
> ./controllers/test.py
>
> from applications.mdplenus.modules.mytest import ip
>
I have a function restuff() in dot/modules/restuff.py
I use "import restuff"
I admit that for those files I'm on python 2.7.something and several bumps
back on web2py versions (I've tried newer ones, just haven't needed to go
all in for them yet). So it's possible that something changed that broke
things, but I expect the regression tests Massimo has would have caught it.
web2py, unlike the newer py4web, uses a custom importer.
> def index():
> return "Your ip is " + mytest.ip()
>
>
> * Same error: ImportError('No module named apptest.modules.mytest',)
>
>
/dps
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/c1e19587-9ad9-40d0-9718-fb7200da3f64o%40googlegroups.com.