make your app name show first

75 views
Skip to first unread message

David Shavers

unread,
Jan 2, 2017, 2:48:12 AM1/2/17
to web2py-users
Hi, I have an app and I had to name it 'init' because the 'welcome' app kept coming up first. How can I make it so that a different app (e.g. 'jbtus') comes before 'init?'

Marlysson Silva

unread,
Jan 2, 2017, 6:52:41 AM1/2/17
to web2py-users

Jaimee S

unread,
Jan 2, 2017, 11:16:26 AM1/2/17
to Marlysson Silva
I am interested in using the routes.py method. Do I create the file inside of init or do I create it inside of the actual web2py application?

David Shavers
Founder, Just Between Us 
jbthe...@gmail.com
www.jbtus.com
From: Marlysson Silva
Sent: Monday, January 2, 2017 5:52 AM
To: web2py-users
Subject: [web2py] Re: make your app name show first

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/gyyLcQzs24g/unsubscribe.
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/d/optout.

Anthony

unread,
Jan 2, 2017, 2:44:08 PM1/2/17
to web2py-users
Use routes.py and specify your app as the default app (you can also remove the welcome app if you don't want it to be shown). The routes.py file goes in the /web2py folder, and there is no need to name your app "init" in this case. See http://web2py.com/books/default/chapter/29/04/the-core#Parameter-based-system.

Anthony

Shavers

unread,
Jan 2, 2017, 4:03:42 PM1/2/17
to Marlysson Silva
I've read both links that you guys have sent and now I know what code I need to put into the routes.py file, but It's still not clear to me where I should place it. By "in the /web2py folder," do you mean in the folder that contains the downloaded web2py application?


For instance, on mac.. mac/user/downloads/web2py/routes.py?

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/gyyLcQzs24g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

Dave S

unread,
Jan 3, 2017, 2:51:04 AM1/3/17
to web2py-users


On Monday, January 2, 2017 at 1:03:42 PM UTC-8, David Shavers wrote:
I've read both links that you guys have sent and now I know what code I need to put into the routes.py file, but It's still not clear to me where I should place it. By "in the /web2py folder," do you mean in the folder that contains the downloaded web2py application?


For instance, on mac.. mac/user/downloads/web2py/routes.py?


Quick answer:  yes

Better answer:  it goes in the directory where web2py.py lives; this is also the parent directory to the applications directory.  If you happen to have installed web2py under the ~/downloads directory, then that is where it goes.  Web2py does not need its directory to be in ~/downloads, but it's okay to have it there (for a development environment; production environments may require a different organizing scheme).

/dps

 
On Mon, Jan 2, 2017 at 1:44 PM, Anthony <abas...@gmail.com> wrote:
Use routes.py and specify your app as the default app (you can also remove the welcome app if you don't want it to be shown). The routes.py file goes in the /web2py folder, and there is no need to name your app "init" in this case. See http://web2py.com/books/default/chapter/29/04/the-core#Parameter-based-system.

Anthony


On Monday, January 2, 2017 at 2:48:12 AM UTC-5, David Shavers wrote:
Hi, I have an app and I had to name it 'init' because the 'welcome' app kept coming up first. How can I make it so that a different app (e.g. 'jbtus') comes before 'init?'

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/gyyLcQzs24g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

David Shavers

unread,
Jan 3, 2017, 4:22:25 PM1/3/17
to web2py-users
Thanks! That was exaclty what i was looking for! but what if i have multiple web2py websites? For instance, one app will be on jbtus.com and Another app will have a domain of jbtus2.com


Should i just copy the whole web2py program and make two different routes.py? 

David Shavers

unread,
Jan 3, 2017, 6:28:05 PM1/3/17
to web2py-users
I posted this:

routers = dict( 
    BASE = dict( 
        default_application='MyApp', 
    ) 


 into routes.py that i created in Applications/web2py/. I changed MyApp to the name of my app and i also am hosted on python anywhere. i saved the file and reloaded my domain bye pressing the green button that's located on the web tab. Init was still the first app the popped up. Should i delete routes.example.py?

What am i doing wrong? 

黄祥

unread,
Jan 3, 2017, 6:50:32 PM1/3/17
to web2py-users
had you already hit "reload routes" button in web2py admin app?

best regards,
stifan

David Shavers

unread,
Jan 3, 2017, 7:04:21 PM1/3/17
to web2py-users
I hadn't tried that previously, but after you recommended it. Tried it and it was still the same result. 

Also, my app is named JBTUS and that's the name that i used in routes.py as well. Should it be lower case?

黄祥

unread,
Jan 3, 2017, 10:41:12 PM1/3/17
to web2py-users
in python anywhere console
Copy routes to web2py folders
cp web2py/examples/routes.parametric.example.py web2py/routes.py

edit
default_application='welcome'
into or whatever application you want
default_application='jbtus',

go to web2py admin page and hit "reload routes" button

best regards,
stifan

David Shavers

unread,
Jan 8, 2017, 2:40:30 AM1/8/17
to web2py-users
I haven't tried that before today, but it still didn't work. I appreciate the suggestion though. Do you have any more?
Reply all
Reply to author
Forward
0 new messages