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
- Host: GitHub
- URL: https://github.com/pjcunningham/flask-protected-resource
- Owner: pjcunningham
- Created: 2017-07-31T12:02:50.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T10:01:02.000Z (over 3 years ago)
- Last Synced: 2026-04-03T13:10:51.890Z (3 months ago)
- Topics: flask, flask-security, protected-routes, python, sqlalchemy
- Language: Python
- Size: 1.04 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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.