routers = dict(
BASE = dict(
default_application='init',
default_controller='default',
default_function='index'
),
init = dict(
functions=['list', 'of', 'functions', 'in', 'default', 'controller']
),
)
routers = dict( BASE = dict(default_application='myapp'), )
routers = dict(
BASE = dict(default_application='init'),
)
routers = dict(
BASE = dict(default_application='init'),
)
Thanks Anthony, when you say "specify the functions in the default controller ", what do you mean exactly? I just want to make sure I understand you correctly.
routers = dict(
BASE = dict(
default_application='init'
),
init = dict(
default_controller='default',
default_function='index',
functions=['call', 'download', 'index', 'user']
)
)
Thanks very much Anthony for all your help with this one. I copied the exact code you posted but nothing changed.
I wonder if this has to do with having multiple apps in the web2py directory. I just can't fix this issue no matter what I do.Btw, even if I was to manage somehow to get rid off the "init", is it possible to have this URL mysite.com/robot.txt - probably not possible, right? Even on the link you sent, it would be mysite.com/default/robot.txt - which means the search engines wouldn't find it.
Hi Dave, I have reloaded the apps in web2py if that's what you mean. I can't restart web2py, I can only reload the apps, I guess.Is there an other way on pythonanywhere? I mean, restarting web2py instead of reloading the apps?
Re: robots.txtIf I put robots.txt in my static folder the URL will still have to be mysite.com/init/static/robots.txt to reach it- this is the issue I am trying to solve - I am trying have mysite.com/robots.txt
Thanks very much Anthony for all your help with this one. I copied the exact code you posted but nothing changed.I wonder if this has to do with having multiple apps in the web2py directory.
Btw, even if I was to manage somehow to get rid off the "init", is it possible to have this URL mysite.com/robot.txt - probably not possible, right?
But, I can't even get rid of the "init", which is frustrating. I asked about this on pythonanywhere, but they don't know. They say it's a web2py issue.
Hi Dave, I have reloaded the apps in web2py if that's what you mean. I can't restart web2py, I can only reload the apps, I guess.Is there an other way on pythonanywhere? I mean, restarting web2py instead of reloading the apps?Re: robots.txtIf I put robots.txt in my static folder the URL will still have to be mysite.com/init/static/robots.txt to reach it- this is the issue I am trying to solve - I am trying have mysite.com/robots.txt
My file structure on pythonanywhere looks like this:
/home/username/web2py/applications/my_app_directory/applications/init
In the web2py directory, I have a routes.py file which contains this code:
routers = dict(
BASE = dict(
default_application='init'
),
init = dict(
default_controller='default',
default_function='index',
functions=['call', 'download', 'index', 'user']
)
)
So, the web2py directory contains an application directory which contains all
my app directories. Then, all the app directories also have an application
directory which contains the app, named init.
I am not so sure if this is the optimal structure. Is it?
In any case, I used the button on the pythonanywhere Web tab to Reload www.myapp.com. And, nothing changed.
I would love to resolve this, and find out what's wrong.
Thanks again for all your help.
Cheers,
Joe
Hi Anthony,My file structure on pythonanywhere looks like this:
/home/username/web2py/applications/my_app_directory/applications/init
init being the app name.
In the web2py directory, I have a routes.py file which contains this code:
routers = dict(
BASE = dict(
default_application='init'
),
init = dict(
default_controller='default',
default_function='index',
functions=['call', 'download', 'index', 'user']
)
)
So, the web2py directory contains an application directory which contains all my app directories. Then, all the app directories also have an application directory which contains the app, named init.
I am not so sure if this is the optimal structure. Is it?
In any case, I used the button on the pythonanywhere Web tab to Reload www.myapp.com. And, nothing changed.
I would love to resolve this, and find out what's wrong.
Thanks again for all your help.
Cheers,
Joe
In any case, can you advise me on how to fix this problem? My directory structure is clearly wrong:/home/username/web2py/applications/my_app_directory/applications/initCan you please post how the correct structure should look like on pythonanywhere?
Btw, on the web2py.com website I see a similar problem. When you first go to the web2py site you land on this URL: http://web2py.com/ then after you visit an other page and then go back to the index page, the URL changes to this:http://web2py.com/init/default/index
In pythonanywhere you have to create a folder first before you install the app.So you mean, it should be /web2py/applications/my_app_directory/init
/home/username/web2py/applications
Enter the path for a new directory to contain the web2py code
failed to remove ‘/home/my_user_name/web2py/applications’: Directory not empty
/home/username/web2py/applications
/home/username/web2py/applications/new_directory/applications/init
Yes, this is how the structure should look like, but it seems pythonanywhere doesn't allow me to setup the structure this way.If I try to use this path to install a new app:
/home/username/web2py/applicationsI get this pythonanywhere error msg during the process:
Enter the path for a new directory to contain the web2py code
failed to remove ‘/home/my_user_name/web2py/applications’: Directory not empty
HiThis is a very good discussion.I followed it and it worked for me.However, I have multiple controllers with different views, How can I make it (HIDE ALL CONTROLLER NAMES) for all pages.
--
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 the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/c21f4800-bedb-41c1-818d-29d9babb9d8c%40googlegroups.com.
routers = dict(
BASE=dict(
default_application='myapp',
default_controller='default',
default_function='index',
functions=dict(
default=['list', 'of', 'functions', 'in', 'default.py'],
foo=['list', 'of', 'functions', 'in', 'foo.py']
)
),
admin=dict(
default_function='site',
functions=['list', 'of', 'functions', 'in', 'default.py']
)
)
routes_in = ( ('/testme', '/examples/default/index'), ) routes_out = ( ('/examples/default/index', '/testme'), )