Skip to content Skip to sidebar Skip to footer

Integrating Css And Cherrypy: How To Fix The 404 "/" Not Found Error?

I've been working on testing Twitter Bootstrap with CherryPy 3.2.2, and have reviewed several of the SO posts, but have been unable to successfully get Cherry to run with my config

Solution 1:

Take a look at https://github.com/btsuhako/bootstrap-cherrypy-jinja2

In the configuration files, it's easier to setup a static dir in your CherryPy app config file:

[/css]
tools.staticdir.on: True
tools.staticdir.dir: 'css'

[/js]
tools.staticdir.on: True
tools.staticdir.dir: 'js'

Solution 2:

Final answer: I decided that I should just start troubleshooting, so I hacked down all of the CherryPy configurations and just did a basic cherrypy.quickstart(HelloWorld()) with the template I had. I was still getting the 404 error, so that meant that there was something fundamentally wrong with my code, not a config error. I kept looking through everything and then I found it. On vim, my code alignment was a little off and that's when I noticed that index.exposed = True was not set outside the index function! D'oh! I replaced it and now it's working with CSS, so anyone who's interested in learning how to implement CherryPy with CSS, there ya go!

Post a Comment for "Integrating Css And Cherrypy: How To Fix The 404 "/" Not Found Error?"