I’m currently developing a Python project which is growing and I may implement it as a webapp in GAE in the future.
As the project is growing I’m pruning potentially reusable code into separate packages & modules, which at present are on my PYTHONPATH.
Do you have any advice on how to structure my project, and reusable packages so that it will fit nicely into a GAE project in the future?
Looking at recommendations on GAE project structure in other posts (such as this and this and this) seem fairly flat – is that the best way to go?
What about 3rd party packages/modules? Is it best to bite the bullet and use VirtualEnv from the beginning?
Thanks very much.
Prembo.
Just put your various libraries in packages off the root directory of your app. The root directory is automatically added to your app’s
sys.path.If you wish you can put them in a
libdirectory off the root, you can do so, but you’ll have to write a module that adds that directory to the end ofsys.path, and import it before you import anything fromlib.Using virtualenv is an option, but I personally don’t think it gains you much, since you can’t run a virtualenv in production, and the
dev_appserveremulates the production environment.