The default model is an empty stub that the rest of Pylons does not
depend on, so you can put it anywhere. This is not true for templates
or controllers. If you want to share those, you'll have to adjust the
paths in environment.py.
--
Mike Orr <slugg...@gmail.com>
The whole way Setuptools works is a bug, and the fact that package
management isn't built into Python is another bug. Entry points have
a way of sometimes working and sometimes not, and when
pkg_resources.require() fails it tells you what it was looking for but
not who was asking for it, so it can be hard to track down where the
dependency is. So one should just be happy it works at all.
In this case it says "Pylons" in the error message so there's a little
more to go on.
$ grep -r 'is a Pylons app' ~/hg/Pylons/pylons | egrep -v 'Binary|\.pyc'
/home/mso/hg/Pylons/pylons/commands.py:
"this is a Pylons app?")
Here's the source:
===
# Import all objects from the base module
base_module = pkg_name + '.lib.base'
found_base = can_import(base_module)
if not found_base:
# Minimal template
base_module = pkg_name + '.controllers'
found_base = can_import(base_module)
if not found_base:
raise ImportError("Could not import base module. Are you sure "
"this is a Pylons app?")
===
So you may not be able to do your applications-under-a-namespace idea
without hacking Pylons.
If your goal is to share a model, it would make more sense to put the
model in a separate package and make both applications depend on it.
--
Mike Orr <slugg...@gmail.com>
I just wanted to say I have this exact same problem. With a project we
decided to namespace, our current solution is to not use paster shell,
due to the setuptools problems Mike outlined
BUT it breaks paster shell as it can't find the model due to the fact
that development.ini isn't in the same package, I know the problem we
just haven't had time to fix it as this is nice to have but not a
priority.
Here is a nice writeup on how to use the tool + another good
explanation on why this is a good thing,
http://www.percious.com/blog/archives/13