Biblioteca de fragmentos

Fragmentos probados y listos para copiar en Python, Flask, JavaScript, SQL, HTML, CSS y Bash. Abre cualquiera en el playground.

4 fragmentos

flask

Safe file upload

Check the extension, size and filename before saving an upload.

intermediate #uploads#security#files
python

Generate a secure random token

Use the secrets module (never random) for passwords, tokens and reset links.

beginner #security#secrets#auth
flask

Rate limit a route

Stop brute-force attempts with Flask-Limiter.

beginner #security#rate-limit#login
flask

Send CSRF token with fetch

Put the token in a meta tag and send it as X-CSRFToken from JavaScript.

beginner #csrf#security#javascript