Arquivos estáticos não carregados em um aplicativo Bottle quando a barra final é omitida
stou servindo um arquivo de teste através do apache usando o Bottl
Segue a minha configuração do apache:
WSGIDaemonProcess temp user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias /temp /opt/gridops/usage/temp/adapter.wsgi
<Directory /opt/gridops/usage/temp>
WSGIProcessGroup temp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
adapter.wsgi
:
import os,sys
os.chdir(os.path.dirname(__file__))
sys.path = ['/opt/gridops/usage/temp'] + sys.path
os.chdir(os.path.dirname(__file__))
sys.stdout = sys.stderr
import bottle
print "++"*10
import index # This loads your application
application = bottle.default_app()
index.py
:
from bottle import mount, run
from routes import app
from bottle import default_app
default_app.push(app)
#run()
#run(app=app, host='192.168.1.3', port=8085)
routes.py
:
from bottle import Bottle , run,route,static_file,view,template,post,request
app = Bottle()
print str(dir(app))
@app.route('/static/<filename>')
def server_static(filename):
return static_file(filename, root='static')
@app.route('/')
def index():
return template('template',text='This is index page!')
template.tpl
:
<html>
<head>
<link rel="stylesheet" type="text/css" href="static/prettify.css" />
</head>
<body>
{{text}}
</body>
</html>
Listagem de diretóri
temp/
adapter.wsgi
index.py
routes.py
static/
prettify.css
views/
template.tpl
Meu problema é sempre que tento acessar o aplicativo Bottle usandohttp://192.168.1.3/temp
a página da Web aparece sem os arquivos estáticos, mas sempre que eu acessarhttp://192.168.1.3/temp/
[Observe o @ ext/
] a página carrega corretamente. Que modificação devo fazer para que o resultado de ambos oshttp://192.168.1.3/temp
ehttp://192.168.1.3/temp/
tornar-se o mesmo?
Qualquer ajuda seria muito útil