-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/23/2014 12:50 PM, Seth wrote:
> Apologies for any confusion. Basically I just want to know my app's
> root path so that I can do various random things like store extra logs
> there, read the pyramid.pid file, etc.
> 
> Based on your feedback, this seems to work, unless anybody has a
> better suggestion:
> 
> from pkg_resources import resource_filename 
> resource_filename('myappspkgname', '')

For "runtime writable" stuff, I would normally *not* use the software
directory (sufficiently-hardened apps may be running as a user without
permissions to create / modify files there).  Instead, I use the
following layout:

  /path/to/virtualenv_or_buildout
     bin/
     etc/
        production.ini
     include/
     lib/
     src/
        myapp/
     var/
        log/

Only 'var' and its contents would need to be writable by the service user.
So, the INI file specifies the writable directory using
'%(here)s/../var'.  For examples using '%(here)s', see:

 
https://github.com/Pylons/pyramid/blob/master/pyramid/scaffolds/alchemy/production.ini_tmpl

 
https://github.com/Pylons/pyramid/blob/master/pyramid/scaffolds/zodb/production.ini_tmpl

(note that those are templates used by 'pcreate' to render a scaffold).



Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          [email protected]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlNYekQACgkQ+gerLs4ltQ6uQQCggiLVyYEeKMbBkfIlQb6YAA/T
iwQAoJhDMfl+jjomfeWpin7cBbXyxZ/j
=btgX
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to