librelist archives

« back to archive

Path of application wsgi vs local

Path of application wsgi vs local

From:
Thomas Beugin
Date:
2010-11-27 @ 02:21
Hello,

When i run my app with wsgi and on local 127.0.0.1, the path of the
application is differente why?

Local /home/kimkof/flask-first-brid
apache wsgi /home/kimkof


Best regards,
Beugin Thomas

Re: [flask] Path of application wsgi vs local

From:
Thomas Beugin
Date:
2010-11-27 @ 19:06
Ok  :)

the code :

@download.route("/test")
def test():
	a = os.getcwd()
	return Response(a)


LOCAL  Flask standalone test server:


Url : http://127.0.0.1:5000/download/test
Response : /home/kimkof/flask-first-brid


WSGI :
Url : http://XX.XX.XX.XX/download/test
Response : /home/kimkof/

<VirtualHost *:80>
        DocumentRoot /home/kimkof/flask-first-brid/

        # WSGI Settings
        WSGIScriptAlias / /home/kimkof/flask-first-brid/wsgi.py
        WSGIDaemonProcess flask-first-brid user=kimkof group=kimkof
processes=10 maximum-requests=100
        WSGIProcessGroup flask-first-brid

        # Static Directories
        Alias /static /home/kimkof/flask-first-brid/firstbridapp/static
        <Location "/static">
                SetHandler None
        </Location>

</VirtualHost>



Cordialement,
Beugin Thomas



2010/11/27 Robert Mela <rmela@rcn.com>:
> I can think of many situations and contexts that could lead to this
> question.
>
> Unfortunately, the question does not include enough detail to determine
> which of those many situations you're encountering.
>
> I could provide many answers to cover all possible different questions, and
> still not guess correctly at what question you're really asking.
>
> For example, I don't know whether you're talking about WSGI on two different
> hosts, vs. whether you're asking about differences between a mod_wsgi
> instance and a Flask standalone test server.
>
> The word "path" also has multiple potential meanings, depending on the
> situation you're referring to.
>
> Maybe if you provide some details ( what two servers are you comparing I
> could figure out what you're asking.  What is your mod_wsgi config?  What
> are your routes in Flask?    What are you typing into your browser for both
> instances?
>
>
> On 11/26/10 9:21 PM, Thomas Beugin wrote:
>>
>> Hello,
>>
>> When i run my app with wsgi and on local 127.0.0.1, the path of the
>> application is differente why?
>>
>> Local /home/kimkof/flask-first-brid
>> apache wsgi /home/kimkof
>>
>>
>> Best regards,
>> Beugin Thomas
>>
>
>

Re: [flask] Path of application wsgi vs local

From:
Armin Ronacher
Date:
2010-11-27 @ 19:43
Hi,

On 11/27/10 8:06 PM, Thomas Beugin wrote:
> 	a = os.getcwd()
os.getcwd is not reliable and must not be used in WSGI environments. 
Use app.root_path instead.


Regards,
Armin

Re: [flask] Path of application wsgi vs local

From:
Thomas Beugin
Date:
2010-11-27 @ 20:01
Thanks armin

 i will test :)



Cordialement,
Beugin Thomas



2010/11/27 Armin Ronacher <armin.ronacher@active-4.com>:
> Hi,
>
> On 11/27/10 8:06 PM, Thomas Beugin wrote:
>>       a = os.getcwd()
> os.getcwd is not reliable and must not be used in WSGI environments.
> Use app.root_path instead.
>
>
> Regards,
> Armin
>