Re: cherrypy + jinja2 html template question: a href tag cannot go correct web page

Eugen Hildt <[email protected]> Sun, 14 May 2017 07:27:58 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
If i understand you correctly you want to set 127.0.0.1 to another ip.
This is done by setting the config file or you can do it like this

cherrypy.config.update({'server.socket_host': '64.72.221.48',
                        'server.socket_port': 80,
                       })


I recommend you to read the documentation here 
http://docs.cherrypy.org/en/latest/config.html  


Am Freitag, 23. Oktober 2015 19:41:48 UTC+2 schrieb Tim Roberts:
>
> 闫旭 wrote: 
> > Hello, i m a newbie of cherrypy 
> > 
> > i have a jinja2 html template: 
> > 
> > <li><ahref="{{ link }}">{{ descript}}</a></li> 
> > 
> > when i run the server the link is like: 127.0.0.1/XXXXXXX 
> > 
> > how can i get rid of the 127.0.0.1 ? 
> > 
>
> This is not a CherryPy question, it is a Jinja2 question.  You need to 
> ask the Jinja2 list. 
>
> However, assuming you were running this on your local system, 
> http://127.0.0.1/XXXXXXX is entirely correct as an absolute URL.  If you 
> want the url to be relative instead of absolute, then you need to fix 
> the "link" variable before you pass it to Jinja. 
>
> -- 
> Tim Roberts, [email protected] <javascript:> 
> Providenza & Boekelheide, Inc. 
>
>

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.