Hi Awais,
I use webfaction and I've always created a custom app ("listening on port").
I know it's not the most helpful answer, but you might consider setting up
the app to listen on a certain port, configuring paster to run on that port,
and then running:
$ bin/paster serve --daemon production.ini start
As for the other issues, I'm not clear on how you're transferring the code
to the server. Unless you are using the server as your development
environment, it might help to build the application on your computer,
package it into an egg, and install it on the server with easy_install. You
can always use the "--install-dir=/some/other/directory" option with
easy_install if you really want it to be placed somewhere other than the
site-packages directory of your virtualenv, although personally I think that
is the best place. If you release revisions later on you can deploy a new
egg with a new version number and not have to worry about keeping all the
folders and subfolders of an entire application in sync in two different
spots.
Lastly,if you want uploaded files sent somewhere else you'd need to install
the application in a different directory or specify a different path for
uploading. For production applications on webfaction I run a separate static
application to serve images/css/js and then mount it at myappurl/static/, to
prevent requests for those files from having to go through the application.
Anyway, I hope this gives you a better starting point, but I realize I
haven't fully answered your questions. Maybe someone more familiar with
mod_wsgi can jump in.
Take care,
Eric
On Wed, Aug 10, 2011 at 1:13 PM, AwaisMuzaffar <[email protected]>wrote:
>
> Hi Guys,
>
> I followed the following guide (http://www.kemeneur.com/clients/pylons/
> docs/pyramid/tutorials/modwsgi/index.html) to set up my application
> using mod_wsgi in WebFaction. However, I am a little bit puzzled about
> a few things.
>
> When I create a new app as shown in step 6 in webfaction:
>
> $ cd ~/modwsgi/env
> $ bin/paster create -t pyramid_starter myapp
>
> Every time I copy 'myapp' development files from my local machine to
> the server via ftp I have to do:
>
> $ ../bin/python setup.py install
>
> for the app on the server to update. Why?
>
> And secondly, I have an upload function in the app, and when I
> uploaded my files in the app I discovered they were placed in:
>
> ./modwsgi/env/lib/python2.6/site-packages/myapp-0.0-py2.6.egg/myapp/
> static/uploads/file.jpg
>
> The function is using this to get my directory:
>
> _current = os.path.dirname(__file__)
>
> Why are they being placed in the site-packages folder?
>
> Please could someone clarify these issues for me, and whether I am
> doing things the right way
>
> Thanks for your time and help.
>
> Regards,
> Awais
>
> --
> 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.