configuring an app on pythonanywhere

36 views
Skip to first unread message

Maurice Waka

unread,
Aug 30, 2019, 11:28:51 AM8/30/19
to web2py-users
After doing all the procedures for a new app e.g. www.myapp.com, completing registration on godaddy.com, upgrading on pythonanywhere etc. The app in web2py is also 'myapp'(same as domain name)

I went to the web2py folder and changed/ added in the routes.py this:

routers = dict(
    BASE  
= dict(default_application='rivelar'),
    rivelar
= dict(languages=['en', 'it', 'jp'], default_language='en'),
)
 

I reloaded the app through the web tab...etc

but when trying to open the app as usual www.myapp.com, I get www.myapp.com/welcome/default/index.

where is this line stored:  'welcome/default/index'

How can I change or remove it  to get www.myapp.com/myapp/default/index or simply www.myapp.com/index

Regards

Dave S

unread,
Sep 3, 2019, 3:00:45 AM9/3/19
to web2py-users
It's in main.py, but routes.py is the correct way to override it.  Works fine for me on a AWS-Linux instance
just specifying

    BASE=dict(
        default_application='mydefaultapp',
        root_static = ['favicon.ico', 'robots.txt'],
    ),
 
You need to reload web2py, though, not just the app.  But doesn't the admin page have a button for "reload routes"?  Yes, at the top, to the right of "Change admin password".

/dps

Reply all
Reply to author
Forward
0 new messages