Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cherrypy socket an environmental variable setting #21

Open
gregelin opened this issue Aug 28, 2015 · 0 comments
Open

Make cherrypy socket an environmental variable setting #21

gregelin opened this issue Aug 28, 2015 · 0 comments
Milestone

Comments

@gregelin
Copy link
Contributor

Socket that cherrypy runs on should be set by environmental value. The default is 127.0.0.1.

if __name__ == '__main__':
    conf = {
        '/': {
            'tools.sessions.on': True,
            'tools.staticdir.root': os.path.abspath(os.getcwd()),
            'tools.encode.on': True,
            'tools.encode.encoding': 'utf-8'
        },
        '/static': {
            'tools.staticdir.on': True,
            'tools.staticdir.dir': './public'
        },
        '/output': {
            'tools.staticdir.on': True,
            'tools.staticdir.dir': 'output'
        },
        '/assets': {
            'tools.staticdir.on': True,
            'tools.staticdir.dir': 'web/assets'
        }
    }
    # This next line should be set by config file or environmental variable.
    cherrypy.config.update({'server.socket_host': '104.131.136.182'})
    cherrypy.quickstart(StringGenerator(), '/', conf)
@gregelin gregelin added this to the Backlog milestone Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant