AlterEgo
old web2py blog
Useful Links
List all entries
Book
Interactive Examples
F.A.Q.
Free Applications
Plugins
Recipes
Demo of Admin Interface
Semantic web extension
Some of the information here may be outdated, please check the book instead
Edit page
Title:
Security Code:
Body:
(use
this
wiki markup)
I could not find a way to automatically create urls with scheme and host, so I aliased URL: URL_WITHOUT_HOST = URL def URL(a=None,c=None,f=None,r=None,args=[],vars={},host=None,scheme=None): path = URL_WITHOUT_HOST(a=a,c=c,f=f,r=r,args=args,vars=vars) if host or scheme: if not isinstance(host,str): host = r.env.http_host if not isinstance(scheme,str): scheme = r.env.wsgi_url_scheme return '%s://%s%s' % (scheme,host,path) return path more versatile: a=URL(r=request,args=[0],vars={'a':1,'b':2}) b=URL(r=request,host=True,args=[0],vars={'a':1,'b':2}) c=URL(r=request,scheme='https',args=[0],vars={'a':1,'b':2}) d=URL(r=request,scheme='https',host='www.google.com',args=[0],vars={'a':1,'b':2}) output: a: /init/default/index/0?a=1&b=2 b: http://localhost:8080/init/default/index/0?a=1&b=2 c: https://localhost:8080/init/default/index/0?a=1&b=2 d: https://www.google.com/init/default/index/0?a=1&b=2
© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by
web2py
- design derived from a theme by
the earlybird
The content of this book is released under the
Artistic License 2.0
- Modified content cannot be reproduced.