Re: Moving the .py(c|o) files out of the app?

2009-09-28 Thread Adam Stein

Another option is to use a build tool.  I use waf
(http://code.google.com/p/waf/), a Python-based framework for
configuring, compiling and installing applications.  I have it set up so
that it compiles the Python files, copies Python and other types of
files to an installed location, then remove the Python source files from
that installed location.

On Sun, 2009-09-27 at 15:53 -0400, Ned Batchelder wrote:
> Python doesn't give you a way to write the .pyc files anywhere except 
> next to their .py files.  But you can compile everything ahead of time, 
> and then either move the .pyc files somewhere else or just delete the 
> .py files (assuming you have another copy!)
> 
> The python module compileall is just for this purpose:
> 
> $ python -m compileall .
> 
> will search the tree rooted in the current directory for .py files newer 
> than their .pyc files, and compile them.
> 
> --Ned.
> http://nedbatchelder.com
> 
> Christophe Pettus wrote:
> > This is more a deployment question, but: Is there a way of specifying  
> > a directory other than the app folder hierarchy for the .pyc or .pyo  
> > files to be written to?  In production, I'm not wild about the idea of  
> > the app folders being writable by the Apache process.  Any guidance?
> > Thanks?
> >
> > --
> > -- Christophe Pettus
> > x...@thebuild.com
> >
> >
> > >
> >
> >   
> 
> -- 
Adam Stein @ Xerox Corporation   Email: a...@eng.mc.xerox.com

Disclaimer: Any/All views expressed
here have been proven to be my own.  [http://www.csh.rit.edu/~adam/]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Moving the .py(c|o) files out of the app?

2009-09-27 Thread Ned Batchelder

Python doesn't give you a way to write the .pyc files anywhere except 
next to their .py files.  But you can compile everything ahead of time, 
and then either move the .pyc files somewhere else or just delete the 
.py files (assuming you have another copy!)

The python module compileall is just for this purpose:

$ python -m compileall .

will search the tree rooted in the current directory for .py files newer 
than their .pyc files, and compile them.

--Ned.
http://nedbatchelder.com

Christophe Pettus wrote:
> This is more a deployment question, but: Is there a way of specifying  
> a directory other than the app folder hierarchy for the .pyc or .pyo  
> files to be written to?  In production, I'm not wild about the idea of  
> the app folders being writable by the Apache process.  Any guidance?
> Thanks?
>
> --
> -- Christophe Pettus
> x...@thebuild.com
>
>
> >
>
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Moving the .py(c|o) files out of the app?

2009-09-27 Thread Christophe Pettus

This is more a deployment question, but: Is there a way of specifying  
a directory other than the app folder hierarchy for the .pyc or .pyo  
files to be written to?  In production, I'm not wild about the idea of  
the app folders being writable by the Apache process.  Any guidance?
Thanks?

--
-- Christophe Pettus
x...@thebuild.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---