Friday, August 8, 2014

The Third PaaS

Here and now, we're adding a third PaaS to the tests: PythonAnywhere. It isn't strictly speaking a PaaS because it also incorporates ideas from IaaS, but the app-hosting part of it is PaaS-like. We had some difficulty getting the app up and running, but not on the part of the Platform. Rather, we forgot to include an __init__.py in our application's directory. Remember: if you need to import things from a directory, ALWAYS include an __init__.py.

 It looks like this:

#For each module in the directory, import it
from Mod1 import *
from Mod2 import *
#...
#etc.

#Then, put __all__ to handle a * import of the current directory
__all__ = ["Mod1","Mod2",...]

No comments:

Post a Comment