1

How to set Flask static folder path to ionic production build folder "www" in python flask , Ionic 5?

I want to set flask static folder to ionic production build folder "www", without creating any static_folder or template_folder separately. So that we can run our application in one server .

1 Answers1

0

I changed my static folder by just mention the name while instantiating the app.

app = Flask(__name__, static_folder='my_folder')

After this, for confirmation, I just run this command.

print(url_for('static', filename='hi.txt'))

I got this output like this /my_folder/hi.txt.

Note: Make sure that, you app user have the right permission for www folder.

NavaneethaKrishnan
  • 1,213
  • 1
  • 9
  • 22