0

I am new to using Flask. I have written basic Flask code for Hello World but after updating function I am still seeing old value on the web page. From what I read on other posts and blogs, this might be Cache problem. But I am not sure how to clear it.

Old Function:

def hello_world():
    print('Hello World')

New Function:

def hello_world():
    print('Hello Hi')

I am still seeing Hello World as an output in the web page instead of Hello Hi.

I am running code in PyCharm 2018.2.5 if this helps

from flask import Flask
from flask_caching import Cache

app = Flask(__name__)
cache = Cache'(config={'CACHE_TYPE': 'simple'})

@app.route('/')
def hello_world():
    print('Hello Hi')

if __name__ == '__main__':
    cache.init_app(app)

    with app.app_context():
        cache.clear()
    app.run(debug=True)

Thank you in advance.

Nikhil Redij
  • 1,011
  • 1
  • 14
  • 21

1 Answers1

0

I restarted machine. One more process was running API that is why even after making changes they were not reflected. I am still not sure which process. But it is working fine now.

Nikhil Redij
  • 1,011
  • 1
  • 14
  • 21