An open API service indexing awesome lists of open source software.

https://github.com/pjcunningham/flask-protected-resource


https://github.com/pjcunningham/flask-protected-resource

flask flask-security protected-routes python sqlalchemy

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

### Using protected resources (images/css/js) in Flask

Resources are not served from the ```static``` folder. Resources are referenced through protected routes and delivered via Flask's ```send_file``` method. Protected routes are configured to set no browser caching on the response header.

In this example resources are stored under the Flask ```instance_path``` folder.

Don't forget to set the Flask ```instance_path``` particular to your set-up, for example :

```app = Flask(__name__, instance_path='D:/Paul/Documents/GitHub/flask-protected-resource/instance')```

A user with email ```jane.smith@example.com``` and password ```password``` is created in the ```before_first_request``` event.