Re: Cherrypy support HTML/CSS3 fully?

Michiel Overtoom <motoom-qWit8jRvyhVmR6Xm/[email protected]> Wed, 16 Aug 2017 10:15:38 +0200
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
Hi Matt,

> #addbttn { background-image: url(http://127.0.0.1:9090/static/images/login.png)}
> This would be a reason to put cherrypy behind an apache.

CherryPy can serve static files, but in production you can indeed have your reverse proxy serve the static content.


# Serve all content in current directory as static

import os
import cherrypy

class Root(object):
    pass

path = os.path.abspath(os.path.dirname(__file__))

cherrypy.log("Serving static files from %s" % path)

config = {
    '/': {
        'tools.staticdir.on': True,
        'tools.staticdir.dir': path,
        'tools.staticdir.index': 'index.html',
        },
    }

cherrypy.quickstart(Root(), "/", config)


Greetings,

-- 
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.