OK.. Here is what my problems..
I use celery with pylons.. The following script initialize my pylons
environment so that I would be able to use the project models, lib etc
from outside paster. In my celery task, I use my models defined in the
project..
import pylons
from paste.deploy import appconfig
conf = appconfig('config:' + get_config_file(),
relative_to=relative_path)
load_environment(conf.global_conf, conf.local_conf)
How to do the similar things in pyramid? Please note that I do not
want to serve the web page in this mode..Also I run the celery as a
standalone mode some thing like
> celeryd -B
and the celery load the settings from celeryconfig.py..
I found the following in Mike Orr's migration guide
https://bytebucket.org/sluggo/pyramid-docs/wiki/html/migration.html
Document yet to complete
import logging.config
import os
import paste.deploy.loadwsgi as loadwsgi
ini_path = "/path/to/development.ini"
logging.config.fileConfig(ini_path)
app_dir, ini_file = os.path.split(ini_path)
app = loadwsgi.loadapp("config:" + ini_file, relative_to=app_dir)
So does this initialize pyramid as well? If it does, then I am done
with that..The only difference I am seeing here is that in Pylons, we
call load_environment where in pyramid it seems like calling
loadwsgi.loadapp, hope this will not serve the app..
Thanks,
Gopalakrishnan Subramani
On May 19, 10:00 pm, Kai Groner <[email protected]> wrote:
> This is the template I've been using for my paster
> commands.https://gist.github.com/981224
>
> If you don't want the paster stuff, the loadapp and threadlocal_manager bits
> are the important ones.
>
> Kai
>
> On Thu, May 19, 2011 at 11:29 AM, Gopalakrishnan S <
>
>
>
>
>
>
>
> [email protected]> wrote:
> > I have a stand-alone python program which needs the pyramid to be
> > initialised so that it can take use of models, sessions, etc without
> > serving web request..
>
> > Is it possible in Pyramid? I was using the same with pylons, wonder
> > how Pyramid support this.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pylons-discuss" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/pylons-discuss?hl=en.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.