On Friday, April 8, 2011 7:45:40 AM UTC-4, 黄祥 wrote:
>
> hi,
>
> is it possible to change default controller into another controller, i
> mean, when i click my application on
> http://127.0.0.1:8000/admin/default/site,
> is it possible to redirect to another controller?
The links to the apps on the admin 'site' page explicitly point to the
/default/index page of each app (whether it exists or not). That's set in a
'for' loop in the /views/default/site.html view of the admin application, so
it's the same for every app. I suppose you could edit that line to something
like:
<h3 class="editableapp">{{=A(a,_href='/'+a)}}</h3>
That should create a link with just the app name, which will normally go to
/default/index, but can be changed for specific apps via routes.py (
http://web2py.com/book/default/chapter/04#URL-Rewrite).
Note, if you go to your app's 'edit' page in admin, you can easily click to
any URL by clicking the functions linked in the "Controllers" section.
Anthony