Skip to content

(Flask) Includes don't change upon modification and reloading webpage #49

@therealadityashankar

Description

@therealadityashankar
  • pypugjs version: 5.8.0
  • Flask version: 1.0.2
  • Python version: 3.6.7
  • Operating System: Ubuntu 18.04.2 LTS (bionic)

Description

when having a template with an include statement, if the contents of the included templates are changed the page still shows the old included page (perhaps some sort of a caching issue ?), unless the template with the include statement is itself modified

(ps: I understand that you're an active Django dev and this is a Flask issue, I'll hopefully put a pull request shortly)

What I Did

  1. create files with the following structure
app.py
templates/foo.pug
templates/bar.pug
  1. contents of app.py
import flask

app = flask.Flask(__name__)
app.jinja_env.add_extension('pypugjs.ext.jinja.PyPugJSExtension')


@app.route('/')
def foo():
    return flask.render_template('foo.pug')


if __name__ == '__main__':
    app.run(debug=True)
  1. contents of foo.pug
p abc
include bar
  1. contents of bar.pug
p this text does not change
  1. run app.py with python3 app.py
  2. open the webpage on a browser (I am using firefox)
  3. while the app is running modify bar.pug to (DO NOT modify foo.pug)
p i told you so
  1. reload the webpage
  2. (Issue) the webpages' content does not change
  3. modify the contents of foo.pug and save the file, then reload the page
  4. the webpages' content changes
no commands other than running the file, no error traceback

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions