Bottle Displays Old Template?
Question: I made a first draft of a template, called `batch.tpl`. I have updated it,
however, the old template still displays. I have shut off the controller
script and turned it back on multiple times. I have removed everything from
the template except for the following:

`cat views/batch.tpl`

    
    
    <HTML>
    <HEAD>
            <TITLE> Batch Manager </TITLE>
    </HEAD>
    
    <BODY>
        THIS ISN'T DISPLAYING IN BROWSER
    </BODY>
    </HTML>
    

Yet that will not show, just the old template.

Here is my controller:

`cat brew_bottle.py`

    
    
        from bottle import route, run, template, debug, post, request
    import MySQLdb
    import pymongo
    from datetime import datetime, timedelta
    import datetime
    
    
    @route('/batch')
    def batch():
        con = MySQLdb.connect('localhost', 'root', 'pi', 'brew')
        cursor = con.cursor()
        batch_sql = "SELECT name, material, start_date, active, end_begin_date, end_end_date, min_temp, max_temp FROM batch WHERE active='Y'"
        cursor.execute(batch_sql)
        batches = cursor.fetchall()
        return template('batch', batches=batches)
    #...
    debug(True)
    run(host='0.0.0.0', port='8080', reloader=True)
    

However, when I go to `http://<hostname>:8080/batch`, I see the old template
that I had wrote:

![enter image description here](http://i.stack.imgur.com/OVNpR.png)

I am sure I am missing something easy. What is it?

I created a new directory and moved everything to it. Then when I start the
python script, I am able to see the correct page. But the python script in the
old directory displays the old template?


Answer: According to the [Bottle
docs](http://bottlepy.org/docs/dev/tutorial.html#auto-reloading), auto
reloading (`reloading`) is only triggered by changes to module files.

> Changes in template files will not trigger a reload. Please use debug mode
> to deactivate template caching.

Turn on [Bottle's debug
mode](http://bottlepy.org/docs/dev/tutorial.html#debug-mode) this way:

    
    
    bottle.debug(True)
    

> Here is an incomplete list of things that change in debug mode:
>
> The default error page shows a traceback. Templates are not cached. Plugins
> are applied immediately. Just make sure not to use the debug mode on a
> production server.

* * *

N.B., I see that someone already asked you whether restarting the server
caused the updated template to appear, and that you indicated that it did not.
That's highly suspicious. In any case, try fixing the problem above and see
whether that solves your problem. Good luck!

