[web2py] Re: Django urls to web2py

2011-11-21 Thread Constantine Vasil
Exactly - I needed to go everywhere and change to lowercase. But it works 
now.

[web2py] Re: Django urls to web2py

2011-11-21 Thread rochacbruno
For me it does not works wit Uppercase app name even in rocket server.

[web2py] Re: Django urls to web2py

2011-11-21 Thread Constantine Vasil
When using trunk and to work on GAE I needed to rename 
my app and all internal references to it to lowercase.




[web2py] Re: Django urls to web2py

2011-11-21 Thread Massimo Di Pierro
Is the problem on GAE only? Do you also get the problem when running with 
dev_appserver?

[web2py] Re: Django urls to web2py

2011-11-21 Thread Constantine Vasil


When routes.py is the pattern based system,

it works locally, but uploading to the GAE

cannot find the icons, stylesheets, etc.


On the server I see the massage:

select routing parameters: BASE



[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
Nothing works as expected with the trunk version after upload to GAE.

Be careful for production environment.




[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
For My App added in routes.py:
http://web2py.com/book/default/chapter/04

routes_in = (
  ('/admin/$anything', '/admin/$anything'),
  ('/static/$anything', '/MyApp/static/$anything'),
  ('/appadmin/$anything', '/MyApp/appadmin/$anything'),
  ('/favicon.ico', '/MyApp/static/favicon.ico'),
  ('/robots.txt', '/MyApp/static/robots.txt'),
  ('/$c/$f/$anything', '/MyApp/$c/$f/$anything'),
  #('/(?P.*)', '/MyApp/\g'),
)

routes_out = (
  ('/admin/$anything', '/admin/$anything'),
  ('/MyApp/static/$anything', '/static/$anything'),
  ('/MyApp/appadmin/$anything', '/appadmin/$anything'),
  ('/MyApp/static/favicon.ico', '/favicon.ico' ),
  ('/MyApp/static/robots.txt', '/robots.txt' ),
  ('/MyApp/$c/$f/$anything', '/$c/$f/$anything'),
  #('/MyApp/\g', '/(?P.*)'),
)

MyApp is the welcome example generated from the wizard.
When I click on Login the link is:
http://192.168.1.66:8000/MyApp/default/user/login?_next=/MyApp/default/index

e.g. MyApp is still in the generated links or in other words cannot get
rid from application prefix.




[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
routes.example.py is working
with also: 

http://web2py.com/book/default/chapter/04

Here is a more complex example that exposes a single app "myapp" without 
unnecessary prefixes but also exposes *admin*, *appadmin* and static:

1.
2.
3.
4.
5.
6.
7.
8.

routes_in = (
  ('/admin/$anything', '/admin/$anything'),
  ('/static/$anything', '/myapp/static/$anything'),
  ('/appadmin/$anything', '/myapp/appadmin/$anything'),
  ('/favicon.ico', '/myapp/static/favicon.ico'),
  ('/robots.txt', '/myapp/static/robots.txt'),




[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
OK I did it, it found "appname"
but could not render it right -
cannot find the stylesheets.


routers = dict(
BASE = dict(
default_application = 'appname',
default_controller='default'
),
)


[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
I am just reporting you guys are awesome!

Now will read it ;)


[web2py] Re: Django urls to web2py

2011-11-20 Thread Massimo Di Pierro
You can also do keeping the same notation as Django:

#in routes.py
routes_in=[
(r'^faq/$', 'MyView/default/url_help_faq'),
(r'^faq/(?P\S*)/(?P\S*)', '/MyView/default/url_help_faq/$a/
$b'),
]

# in app MyView, in app controller default.py
def url_help_faq():
if len(request.args) == 2:
 
else:
 

On Nov 20, 5:52 pm, Anthony  wrote:
> In the default.py controller:
>
> def faq():
>     if len(request.args) > 1:
>         #perform routine extracting topic0100 and faq0100
>         #topic0100 will be in request.args(0), and faq0100 will be in
> request.args(1)
>     else:
>         #perform default routine
>
> Note, by default, that will give you a url 
> likehttp://www.mysite.com/appname/default/faq/topic0100/faq0100, but you can
> easily remove /appname/default from the URL using routes.py
> (seehttp://web2py.com/book/default/chapter/04#Parameter-Based-System). In
> routes.py:
>
> routers = dict(
>     BASE = dict(
>         default_application = 'appname',
>         default_controller='default'
>     ),
> )
>
> Anthony
>
>
>
>
>
>
>
> On Sunday, November 20, 2011 5:53:50 PM UTC-5, Constantine Vasil wrote:
>
> > I have in Django urls these statements:
>
> >     (r'^faq/$', 'MyView.views.url_help_faq'),
> >     (r'^faq/(\S*)/(\S*)', 'MyView.views.url_help_faq'),
>
> > Which is making possible *MyView.views.url_help_faq*
> > to serve the following requests:
>
> >http://www.MySite.com/faq
> >http://www.MySite.com/faq/topic0100/faq0100
>
> > def url_help_faq(request, topic=None, faq=None):
>
> >   if not topic and not faq:
> >      #perform default routine
>
> >   if topic and faq:
> >      #perform routine extracting topic0100 and faq0100
>
> >   return topic, faq
>
> > How to make this in web2py?


[web2py] Re: Django urls to web2py

2011-11-20 Thread Anthony
In the default.py controller:

def faq():
if len(request.args) > 1:
#perform routine extracting topic0100 and faq0100
#topic0100 will be in request.args(0), and faq0100 will be in 
request.args(1)
else:
#perform default routine

Note, by default, that will give you a url like 
http://www.mysite.com/appname/default/faq/topic0100/faq0100, but you can 
easily remove /appname/default from the URL using routes.py 
(see http://web2py.com/book/default/chapter/04#Parameter-Based-System). In 
routes.py:

routers = dict(
BASE = dict(
default_application = 'appname',
default_controller='default'
),
)

Anthony

On Sunday, November 20, 2011 5:53:50 PM UTC-5, Constantine Vasil wrote:
>
> I have in Django urls these statements:
>
> (r'^faq/$', 'MyView.views.url_help_faq'),
> (r'^faq/(\S*)/(\S*)', 'MyView.views.url_help_faq'),
>
> Which is making possible *MyView.views.url_help_faq*
> to serve the following requests:
>
> http://www.MySite.com/faq   
> http://www.MySite.com/faq/topic0100/faq0100
>
> def url_help_faq(request, topic=None, faq=None):
>
>   if not topic and not faq:
>  #perform default routine
>
>   if topic and faq:
>  #perform routine extracting topic0100 and faq0100
>   
>   return topic, faq
>
> How to make this in web2py?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>