I have problem when developing in Python Bottle on Apache. Each time I change file dbmanager.py that I import to main app.wsgi, nothing change. I need to "touch" app.wsgi to see changes in dbmanager.py or restart apache. I tried everything: changes in .htaccess, apache Virtual Host config. But still nothnig. Any ideas?
Path to my files is:
/var/www/paka/public_html/edi/api/app.wsgi
I have two files:
app.wsgi
import os, sys
from os.path import dirname
sys.path.append(dirname(__file__))
import bottle
from bottle import route, run, template, post, request, response
bottle.debug(True)
bottle.TEMPLATES.clear()
import dbmanager
c = dbmanager.connect()
@route('/hello/<name>')
def index(name):
#return hello.world() # only log in console
return template('<b>Hello {{name}}</b>!' + c, name=name)
application = bottle.default_app()
and dbmanager.py
import mysql, mysql.connector
def connect():
return "123456"
My .htaccess
# DISABLE CACHING
ExpiresActive On
ExpiresDefault A1
Header append Cache-Control must-revalidate
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|png|pdf|swf|txt|py|pcc)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
</IfModule>
</FilesMatch>
My VirtualHost config:
WSGIDaemonProcess bottle user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias / /var/www/paka/public_html/edi/api/app.wsgi
<Directory /var/www/paka/public_html/edi/api/>
WSGIProcessGroup bottle
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>