Web2py default app
Asked Answered
B

2

9

I am planning to publish my site soon on Dreamhost using passenger WSGI as mentioned in the dreamhost setup documentation.

My issue is that I am wanting www.mydomain.com to go directly to my new application, instead of needing to go to web2py.mydomain.com/MyApp/Default.

What is the best way to solve this issue? Do I use DNS redirects or can this be done through the web2py configuration?

Brechtel answered 21/6, 2010 at 13:10 Comment(0)
E
7

Another option available since web2py version 1.83 (Aug 11, 2010):

Default Application, Controller, and Function
The name of the default application, controller and function can be changed from init, default, and index respectively to another name by setting the appropriate value in routes.py:

default_application = "myapp"
default_controller = "admin"
default_function = "start"
Exodontist answered 17/9, 2010 at 16:28 Comment(2)
i don't get this to work in the current version, i still go to /welcome/default/indexLaurent
if routes.py doesn't exist, you have to create it with these 3 lines and restart web2py (if you started web2py from gui window, you have to close it first)Barker
P
5

You can in web2py. You have two options: 1) call your app "init"

2) use routes to do the mapping. Create a file web2py/routes.py and in it add

routes_in=[('/','/MyApp/default/index')]
Patagonia answered 9/7, 2010 at 13:23 Comment(2)
i don't get this to work in the current version, i still go to /welcome/default/indexLaurent
@RobinManoli What are you currently using? It worked just fine for me. I just needed to change MyApp to the name of my app.Pittel

© 2022 - 2024 — McMap. All rights reserved.