- Flask is a micro webdevelopment framework for Python. You are currently + Flask is a micro web development framework for Python. You are currently looking at the documentation of the development version.
What you were looking for is just not there. -
go somewhere nice - {% endblock %} - + {% extends "layout.html" %} + {% block title %}Page Not Found{% endblock %} + {% block body %} +
What you were looking for is just not there. +
go somewhere nice
+ {% endblock %}
diff --git a/docs/patterns/fabric.rst b/docs/patterns/fabric.rst
index 7270a569..3dbf2146 100644
--- a/docs/patterns/fabric.rst
+++ b/docs/patterns/fabric.rst
@@ -43,36 +43,25 @@ virtual environment::
env.hosts = ['server1.example.com', 'server2.example.com']
def pack():
- # create a new source distribution as tarball
+ # build the package
local('python setup.py sdist --formats=gztar', capture=False)
def deploy():
- # figure out the release name and version
+ # figure out the package name and version
dist = local('python setup.py --fullname', capture=True).strip()
- # upload the source tarball to the temporary folder on the server
- put('dist/%s.tar.gz' % dist, '/tmp/yourapplication.tar.gz')
- # create a place where we can unzip the tarball, then enter
- # that directory and unzip it
- run('mkdir /tmp/yourapplication')
- with cd('/tmp/yourapplication'):
- run('tar xzf /tmp/yourapplication.tar.gz')
- # now setup the package with our virtual environment's
- # python interpreter
- run('/var/www/yourapplication/env/bin/python setup.py install')
- # now that all is set up, delete the folder again
- run('rm -rf /tmp/yourapplication /tmp/yourapplication.tar.gz')
- # and finally touch the .wsgi file so that mod_wsgi triggers
- # a reload of the application
- run('touch /var/www/yourapplication.wsgi')
+ filename = '%s.tar.gz' % dist
+
+ # upload the package to the temporary folder on the server
+ put('dist/%s' % filename, '/tmp/%s' % filename)
-The example above is well documented and should be straightforward. Here
-a recap of the most common commands fabric provides:
+ # install the package in the application's virtualenv with pip
+ run('/var/www/yourapplication/env/bin/pip install /tmp/%s' % filename)
-- `run` - executes a command on a remote server
-- `local` - executes a command on the local machine
-- `put` - uploads a file to the remote server
-- `cd` - changes the directory on the serverside. This has to be used
- in combination with the ``with`` statement.
+ # remove the uploaded package
+ run('rm -r /tmp/%s' % filename)
+
+ # touch the .wsgi file to trigger a reload in mod_wsgi
+ run('touch /var/www/yourapplication.wsgi')
Running Fabfiles
----------------
@@ -156,6 +145,7 @@ location where it's expected (eg: :file:`/var/www/yourapplication`).
Either way, in our case here we only expect one or two servers and we can
upload them ahead of time by hand.
+
First Deployment
----------------
diff --git a/docs/patterns/favicon.rst b/docs/patterns/favicon.rst
index acdee24b..21ea767f 100644
--- a/docs/patterns/favicon.rst
+++ b/docs/patterns/favicon.rst
@@ -49,5 +49,5 @@ web server's documentation.
See also
--------
-* The `Favicon Error: {{ error }}
{% endif %}
- Upload new File
-
'''
@@ -104,9 +104,9 @@ before storing it directly on the filesystem.
>>> secure_filename('../../../../home/username/.bashrc')
'home_username_.bashrc'
-Now one last thing is missing: the serving of the uploaded files. In the
-:func:`upload_file()` we redirect the user to
-``url_for('uploaded_file', filename=filename)``, that is, ``/uploads/filename``.
+Now one last thing is missing: the serving of the uploaded files. In the
+:func:`upload_file()` we redirect the user to
+``url_for('uploaded_file', filename=filename)``, that is, ``/uploads/filename``.
So we write the :func:`uploaded_file` function to return the file of that name. As
of Flask 0.5 we can use a function that does that for us::
@@ -181,4 +181,4 @@ applications dealing with uploads, there is also a Flask extension called
blacklisting of extensions and more.
.. _jQuery: https://jquery.com/
-.. _Flask-Uploads: http://pythonhosted.org/Flask-Uploads/
+.. _Flask-Uploads: https://pythonhosted.org/Flask-Uploads/
diff --git a/docs/patterns/flashing.rst b/docs/patterns/flashing.rst
index b2de07ce..7efd1446 100644
--- a/docs/patterns/flashing.rst
+++ b/docs/patterns/flashing.rst
@@ -9,7 +9,9 @@ application. Flask provides a really simple way to give feedback to a
user with the flashing system. The flashing system basically makes it
possible to record a message at the end of a request and access it next
request and only next request. This is usually combined with a layout
-template that does this.
+template that does this. Note that browsers and sometimes web servers enforce
+a limit on cookie sizes. This means that flashing messages that are too
+large for session cookies causes message flashing to fail silently.
Simple Flashing
---------------
@@ -76,7 +78,7 @@ And here is the :file:`login.html` template which also inherits from
{% if error %}