I forgot to state that this I require only in situations where I set
protocol keyword, because I have urls that require HTTPS, but that in
turn depends on whether HTTPS is set or not in a custom config var (not
set for dev, set for production), for example:
url('login', protocol=config['site_url_scheme'])
Otherwise using simply url('login') returns absolute URI (but relative
URL overall) which at least in FireFox is relative to the port set.
Speaking of which, I checked the Routes docs, but found no other
meaningful way to force https for individual URLs.
Also, where would you suggest I put the wrapper function, to have it
globally available like url(), but without modifying the framework (only
the files in the project)?
Thanks,
Vlad
On 05/06/10 05:37, Mike Orr wrote:
> On Wed, May 5, 2010 at 1:35 PM, Haron Media <[email protected]> wrote:
>
>> I have a tiny little problem. I'd like to develop Pylons apps using no
>> additional services (ie. a webserver) under Linux, meaning using paster
>> serve. However, in order to bind to port 80, I'd have to run it as root.
>> Otherwise, routes' url() method does not include the port number unless
>> I specify "qualified=True". Is there a way to force url() to generate
>> fully qualified URL in development, and without port number in
>> production, from a single configuration parameter (in .ini)?
>>
> No but you could write a wrapper function to do that.
>
> We could possibly change RoutesMiddleware to take a URLGenerator class
> in the constructor. Then you could subclass routes.util.URLGenerator
> and add this feature, and it would be on pylons.url . What do you
> think, Ben?
>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.