Routing to different web2py apps in pythonanywhere

369 views
Skip to first unread message

Jim S

unread,
Feb 8, 2013, 8:30:11 AM2/8/13
to web...@googlegroups.com
Hi

Just got started with PythonAnywhere.  I have multiple web2py apps I'd like to host there under the same web2py instance.  However, I want different domain names to point to them.  Can I use the web2py routes.py to do that, or is there a better way to handle it with pythonanywhere.  Their support didn't offer much for me.

Massimo Di Pierro

unread,
Feb 8, 2013, 1:54:08 PM2/8/13
to web...@googlegroups.com
I just talked to them about this. If you have multiple web2py instances you can have multiple wsgi config files pointing different domains to the different apps. I do not like this solution very much.

You can indeed use routes.

Perhaps we can add a feature to web2py so that instead of using routes.py the relevant parameters is set in the wsgi config file to you can have multiple ones (for different domains) pointing to one of the same web2py instance but behaving differently.

Massimo

Jim S

unread,
Feb 8, 2013, 2:31:36 PM2/8/13
to web...@googlegroups.com
Thanks Massimo.  Since I'm wsgi illiterate I'll try it with routes.py.  My skills aren't much in this area but I'll give it a try and see what I can come up with.

-Jim

Jim Steil

unread,
Apr 11, 2013, 10:28:23 AM4/11/13
to web...@googlegroups.com
Here is the code in routes.py that got it working for me.

routers = dict(

    # base router
    BASE=dict(
        default_application='welcome',
        domains={'www.app1.com':'app1',
                'www.app2.org':'app2'}
    ),
)


On Thu, Apr 11, 2013 at 8:07 AM, Cenk Yıldız <scyi...@gmail.com> wrote:
Hello,

I'd like to do the same thing with you, but I did not totally understand what to do in routes.py. Seems like I should modify routes_in and routes_out? Did you manage?

Cenk

--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/h9WzRiLPCn4/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages