Re: How to serve css and js in cherry py?

Tim Roberts <[email protected]>
Newsgroups gmane.comp.python.cherrypy
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Florin Marinescu wrote:
>
> I am trying to build a login page. I use static html.
> ...
> The html header is like this:
>
>  <head>
>         <title>Login Page</title>
>         <meta charset="UTF-8">
>         <meta name="viewport" content="width=device-width">
>         <link rel="stylesheet" type="text/css"
> href="../public/css/custom.css">
>  </head>
>
> In browser, I can see the html code but no css is applied. What I'm
> doing wrong?

Exactly what URL are you using to get to that header?  Remember that the
"href" path in the <link> tag is referring to the URL address, not to
the disk address.  As an example, if that page is presented via
http://127.0.0.1/root.py, then you would not want the "../" in the href.

Most browsers today have a developer pane that can show you the exact
requests the browser is making to fetch its resources.  That might help.

-- 
Tim Roberts, [email protected]
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.