Added a security section to the foreword and a footnote to the g
Before adoption: this commit came in with the history the project adopted, so no landing records it.
variable
authored by Armin Ronacher · committed by Armin Ronacher · parent 4e7aa9e · Browse files · 4 files·+48 added−3 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+48 added−3 removed
- other:+48 added−3 removed
Provenance
- Commit
4671429- Tree
776cbcf- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
4e7aa9e
4 files changed+48 added−3 removed
modified:docs/_themes/flasky/static/flasky.css_t+11 added-1 removed
241 unmodified lines242 border: 1px solid #888;243 padding: 0.25em 0.7em;244 }245 246-table.field-list {246+table.field-list, table.footnote {247 border: none;248 -webkit-box-shadow: none;249 -moz-box-shadow: none;250 }251 252+table.footnote {253+ border: 1px solid #eee;254+ -webkit-box-shadow: 1px 1px 1px #d8d8d8;255+ -moz-box-shadow: 1px 1px 1px #d8d8d8;256+}257+258 table.field-list th {259 padding: 0 0.8em 0 0;260 }261 262 table.field-list td {263 padding: 0;264 }265+266+table.footnote td {267+ padding: 0.5em;268+}269 270 pre {271 background: #FDFDFD;272 padding: 10px;31 unmodified linesmodified:docs/foreword.rst+28 added
43 unmodified lines44 framework. Flask itself is just one way to implement a framework on top45 of existing libraries. Unlike many other microframeworks Flask does not46 try to implement anything on its own, it reuses existing code.47 48+Web Development is Dangerous49+----------------------------50+51+I'm not even joking. Well, maybe a little. If you write a web52+application you are probably allowing users to register and leave their53+data on your server. The users are entrusting you with data. And even if54+you are the only user that might leave data in your application, you still55+want that data to be stored in a secure manner.56+57+Unfortunately there are many ways security of a web application can be58+compromised. Flask protects you against one of the most common security59+problems of modern web applications: cross site scripting (XSS). Unless60+you deliberately mark insecure HTML as secure Flask (and the underlying61+Jinja2 template engine) have you covered. But there are many more ways to62+cause security problems.63+64+Whenever something is dangerous where you have to watch out, the65+documentation will tell you so. Some of the security concerns of web66+development are far more complex than one might think and often we all end67+up in situations where we think "well, this is just far fetched, how could68+that possibly be exploited" and then an intelligent guy comes along and69+figures a way out to exploit that application. And don't think, your70+application is not important enough for hackers to take notice. Depending71+ont he kind of attack, chances are there are automated botnets out there72+trying to figure out how to fill your database with viagra adverisments.73+74+So always keep that in mind when doing web development.75+76 Target Audience77 ---------------78 79 Is Flask for you? Is your application small-ish (less than 4000 lines of15 unmodified linesmodified:docs/patterns.rst+2 added
14 unmodified lines15 :meth:`~flask.Flask.request_shutdown` decorators in combination with the16 special :class:`~flask.g` object.17 18 19+.. _database-pattern:20+21 Using SQLite 3 with Flask22 -------------------------23 24 So here a simple example how you can use SQLite 3 with Flask::226 unmodified linesmodified:docs/quickstart.rst+7 added-2 removed
311 unmodified lines312 <h1>Hello World!</h1>313 {% endif %}314 315 Inside templates you also have access to the :class:`~flask.request`,316-:class:`~flask.session` and :class:`~flask.g` objects as well as the317-:func:`~flask.get_flashed_messages` function.316+:class:`~flask.session` and :class:`~flask.g` [#]_ objects317+as well as the :func:`~flask.get_flashed_messages` function.318 319 Templates are especially useful if inheritance is used. If you want to320 know how that works, head over to the :ref:`template-inheritance` pattern321 documentation. Basically template inheritance makes it possible to keep15 unmodified lines337 Markup(u'<blink>hacker</blink>')338 >>> Markup('<em>Marked up</em> » HTML').striptags()339 u'Marked up \xbb HTML'340 341+.. [#] Unsure what that :class:`~flask.g` object is? It's something you342+ can store information on yourself, check the documentation of that343+ object (:class:`~flask.g`) and the :ref:`database-pattern` for more344+ information.345 346+347 Accessing Request Data348 ----------------------349 350 For web applications it's crucial to react to the data a client sent to246 unmodified lines