pyramid and paster setup-app

18 views
Skip to first unread message

oO

unread,
Feb 28, 2011, 1:45:06 AM2/28/11
to pylons-devel
What's the best way to modify a pyramid project to make use of paster
setup-app? I'm using pyramid with traversal and mongodb for
persistence, so I started with the default template which doesn't set
anything up for the setup-app portion, and I don't really know where
to start.

Any pointers? I obviously will need to access the settings so I can
create a MongoDB connection and setup the collections and indexes that
the app will use, as well as bootstrapping some of the data.

oO

Chris McDonough

unread,
Feb 28, 2011, 10:17:52 AM2/28/11
to pylons...@googlegroups.com
On Sun, 2011-02-27 at 22:45 -0800, oO wrote:
> What's the best way to modify a pyramid project to make use of paster
> setup-app? I'm using pyramid with traversal and mongodb for
> persistence, so I started with the default template which doesn't set
> anything up for the setup-app portion, and I don't really know where
> to start.

Pyramid itself does not implement a paster command named 'setup-app', so
there really is no "setup-app portion". Instead I'd suggest using a
console script. Here's where, if I had one, I'd add a link to
documentation for creating a console script that loaded the environment
from an .ini file. However, I don't have one so I'll likely have to
just point you to the docs for "pyramid.paster" and "pyramid.scripting"
in the API section of the Pyramid docs.

- C

oO

unread,
Feb 28, 2011, 5:28:45 PM2/28/11
to pylons-devel
Is there any reason why Pyramid wouldn't implement a paster setup-app
command? I understand I can create a script command (which I've done a
few times in Pylons) but I think that a standard hook would be very
beneficial, since most Pyramid based app probably need to bootstrap
some sort of persistence model default values and data.

oO

Chris McDonough

unread,
Feb 28, 2011, 5:35:52 PM2/28/11
to pylons...@googlegroups.com
It seemed like too much framework for not much benefit over suggesting
that folks use a console script.

- C

Wichert Akkerman

unread,
Feb 28, 2011, 5:38:55 PM2/28/11
to pylons...@googlegroups.com

It would be useful, but unfortunately paste's setup-app magic is so
fragile that it probably is not worth the effort.

Wichert.

Reply all
Reply to author
Forward
0 new messages