Created
June 23, 2012 04:34
-
-
Save N3MIS15/2976868 to your computer and use it in GitHub Desktop.
webroot stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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