How to serve css and js in cherry py?
Florin Marinescu <marinescu.florin.alexandru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
| Newsgroups | gmane.comp.python.cherrypy |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am trying to build a login page. I use static html.
My folder structure is( i took example this one:
https://bitbucket.org/Lawouach/twiseless/src/d171fde9e454?at=default) :
- root.py
- template
- login.html
- public
- css
- custom.css
- js
- custom.js
The root.conf file is like this:
[global]
server.socket_host = "127.0.0.1"
server.socket_port = 8080
server.thread_pool = 10
[/]
tools.staticdir.on = True
tools.staticdir.dir = "/template"
[/static]
tools.staticdir.on = True
tools.staticdir.dir = "/public"
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?
Thank you
--
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.