灵符lingfu

ling-web

↓ 986 downloads

Sessions, flash, templates, CSRF, static files — Flask-style

Keywords web, flask, sessions, csrf, templates
lingfu install ling-web
LicenseApache-2.0 OR MIT
AuthorsLing Lin, Sanny Lin
READMECode / FilesVersionsDependency GraphDependentsSecurityBuildsSettings

Code / Files (15)

examples/templates/index.html
<!doctype html>
<html>
<head><title>ling-web guestbook</title></head>
<body>
  <h1>ling-web guestbook</h1>
  <p>You've visited {{ visits }} time(s) this session.</p>

  {% for f in flashes %}
    <p class="flash {{ f.category }}">{{ f.message }}</p>
  {% endfor %}

  <form method="post" action="/">
    <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
    <input type="text" name="name" placeholder="Your name" required>
    <button type="submit">Sign the guestbook</button>
  </form>

  <ul>
  {% for entry in entries %}
    <li>{{ entry }}</li>
  {% endfor %}
  </ul>
</body>
</html>

← Back to index