Skip to content

Instantly share code, notes, and snippets.

@N3MIS15
Created June 23, 2012 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save N3MIS15/2976868 to your computer and use it in GitHub Desktop.
Save N3MIS15/2976868 to your computer and use it in GitHub Desktop.
webroot stuff
if WEBROOT:
if WEBROOT[0] != '/':
WEBROOT = '/' + WEBROOT
d = wsgiserver.WSGIPathInfoDispatcher({WEBROOT: app})
else:
d = wsgiserver.WSGIPathInfoDispatcher({'/': app})
SERVER = wsgiserver.CherryPyWSGIServer(('0.0.0.0', PORT), d)
# Set up webroot for .less
less_webroot = os.path.join(RUNDIR, 'static/less/webroot.less')
f = open(less_webroot, 'w')
if WEBROOT:
f.write('@webroot: "%s/static";' % (WEBROOT[1:]))
else:
f.write('@webroot: "static";')
This should fix the mobile.py issue and also make sure that jquery and python are using absolute (/webroot/whatever rather than webroot/whatever).
it also tackles the user including the slash in the webroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment