> Hi,
>
>
> On Sun, Jan 12, 2014 at 11:01 PM, C Anthony Risinger
> <[email protected]>wrote:
> [snip]
>
>> Internal routing routes to a mountpoint/UWSGI_APPID/application, not a
>> callable. You need something that looks like this (unverified):
>>
>> mount=vapp=my_wsgi_server:verifyapp
>> route=^/verify uwsgi:,,,vapp
>>
>> ...I used "vapp" to demonstrate a mountpoint is just an arbitrary
>> string,
>> but if not explicitly routed (IIRC) it will match the PATH_INFO CGI
>> variable as well.
>>
>
> Thanks for pointing out the "mount" option.
>
> The example above gave me syntax errors, and looking at the example from
> the docs, i.e.,
>
>> mount /pinax=/var/www/pinax/deploy/pinax.wsgi
>
> I tried this:
>
>> mount /vapp=my_wsgi_server.verifyapp
>> route = ^/verify uwsgi:,,,vapp
>
> Which results in the rule being recognized when uwsgi runs:
>
>> [rule: 2] subject: path_info regexp: ^/verify action: uwsgi:,,,verifyapp
>
> But when I go to
> http://localhost/verify<http://localhost/verify?code=blahhahaaaqq> the
> function "verifyapp()" is not being called; it winds up using
> "application()" instead.
>
> I also tried putting the verifyapp() function into a separate file, and
> doing this:
>
>> mount /vapp=verifyapp.py
>> route = ^/verify uwsgi:,,,vapp
>
> But with the same result, i.e., it was ignored, and the function
> "application()" in my_wsgi_server.py is the only one that is ever called.
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
An example:
#app1.py
def application(e, sr):
sr('200 OK',[('Content-Type','text/plain')])
return ["app1"]
#app2.py
def application(e, sr):
sr('200 OK',[('Content-Type','text/plain')])
return ["app2"]
uwsgi --mount "/app1=app1.py" --mount "/app2=app2.py" --http-socket :9090
--route "^/app1 setapp:/app1" --route "^/app2 setapp:/app2"
once an app is mounted you can call it at the request phase using the
setapp:<mountpoint> routing action
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi