diff options
Diffstat (limited to 'studio/static/doc/flask-docs/extensions.html')
-rw-r--r-- | studio/static/doc/flask-docs/extensions.html | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/studio/static/doc/flask-docs/extensions.html b/studio/static/doc/flask-docs/extensions.html new file mode 100644 index 0000000..d5ee4a7 --- /dev/null +++ b/studio/static/doc/flask-docs/extensions.html @@ -0,0 +1,153 @@ + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>Flask Extensions — Flask 0.8 documentation</title> + + <link rel="stylesheet" href="_static/flasky.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '0.8', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="top" title="Flask 0.8 documentation" href="index.html" /> + <link rel="next" title="Working with the Shell" href="shell.html" /> + <link rel="prev" title="Modular Applications with Blueprints" href="blueprints.html" /> + + + <link rel="apple-touch-icon" href="_static/touch-icon.png" /> + + <link media="only screen and (max-device-width: 480px)" href="_static/small_flask.css" type= "text/css" rel="stylesheet" /> + + </head> + <body> + <div class="related"> + <h3>Navigation</h3> + <ul> + <li class="right" style="margin-right: 10px"> + <a href="genindex.html" title="General Index" + accesskey="I">index</a></li> + <li class="right" > + <a href="shell.html" title="Working with the Shell" + accesskey="N">next</a> |</li> + <li class="right" > + <a href="blueprints.html" title="Modular Applications with Blueprints" + accesskey="P">previous</a> |</li> + <li><a href="index.html">Flask 0.8 documentation</a> »</li> + </ul> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body"> + + <div class="section" id="flask-extensions"> +<h1>Flask Extensions<a class="headerlink" href="#flask-extensions" title="Permalink to this headline">¶</a></h1> +<p>Flask extensions extend the functionality of Flask in various different +ways. For instance they add support for databases and other common tasks.</p> +<div class="section" id="finding-extensions"> +<h2>Finding Extensions<a class="headerlink" href="#finding-extensions" title="Permalink to this headline">¶</a></h2> +<p>Flask extensions are listed on the <a class="reference external" href="http://flask.pocoo.org/extensions/">Flask Extension Registry</a> and can be +downloaded with <tt class="docutils literal"><span class="pre">easy_install</span></tt> or <tt class="docutils literal"><span class="pre">pip</span></tt>. If you add a Flask extension +as dependency to your <tt class="docutils literal"><span class="pre">requirements.rst</span></tt> or <tt class="docutils literal"><span class="pre">setup.py</span></tt> file they are +usually installed with a simple command or when your application installs.</p> +</div> +<div class="section" id="using-extensions"> +<h2>Using Extensions<a class="headerlink" href="#using-extensions" title="Permalink to this headline">¶</a></h2> +<p>Extensions typically have documentation that goes along that shows how to +use it. There are no general rules in how extensions are supposed to +behave but they are imported from common locations. If you have an +extension called <tt class="docutils literal"><span class="pre">Flask-Foo</span></tt> or <tt class="docutils literal"><span class="pre">Foo-Flask</span></tt> it will be always +importable from <tt class="docutils literal"><span class="pre">flask.ext.foo</span></tt>:</p> +<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">flask.ext</span> <span class="kn">import</span> <span class="n">foo</span> +</pre></div> +</div> +</div> +<div class="section" id="flask-before-0-8"> +<h2>Flask Before 0.8<a class="headerlink" href="#flask-before-0-8" title="Permalink to this headline">¶</a></h2> +<p>If you are using Flask 0.7 or earlier the <tt class="xref py py-data docutils literal"><span class="pre">flask.ext</span></tt> package will not +exist, instead you have to import from <tt class="docutils literal"><span class="pre">flaskext.foo</span></tt> or <tt class="docutils literal"><span class="pre">flask_foo</span></tt> +depending on how the extension is distributed. If you want to develop an +application that supports Flask 0.7 or earlier you should still import +from the <tt class="xref py py-data docutils literal"><span class="pre">flask.ext</span></tt> package. We provide you with a compatibility +module that provides this package for older versions of Flask. You can +download it from github: <a class="reference external" href="https://github.com/mitsuhiko/flask/raw/master/scripts/flaskext_compat.py">flaskext_compat.py</a></p> +<p>And here is how you can use it:</p> +<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">flaskext_compat</span> +<span class="n">flaskext_compat</span><span class="o">.</span><span class="n">activate</span><span class="p">()</span> + +<span class="kn">from</span> <span class="nn">flask.ext</span> <span class="kn">import</span> <span class="n">foo</span> +</pre></div> +</div> +<p>Once the <tt class="docutils literal"><span class="pre">flaskext_compat</span></tt> module is activated the <tt class="xref py py-data docutils literal"><span class="pre">flask.ext</span></tt> will +exist and you can start importing from there.</p> +</div> +</div> + + + </div> + </div> + </div> + <div class="sphinxsidebar"> + <div class="sphinxsidebarwrapper"><p class="logo"><a href="index.html"> + <img class="logo" src="_static/flask.png" alt="Logo"/> +</a></p> + <h3><a href="index.html">Table Of Contents</a></h3> + <ul> +<li><a class="reference internal" href="#">Flask Extensions</a><ul> +<li><a class="reference internal" href="#finding-extensions">Finding Extensions</a></li> +<li><a class="reference internal" href="#using-extensions">Using Extensions</a></li> +<li><a class="reference internal" href="#flask-before-0-8">Flask Before 0.8</a></li> +</ul> +</li> +</ul> +<h3>Related Topics</h3> +<ul> + <li><a href="index.html">Documentation overview</a><ul> + <li>Previous: <a href="blueprints.html" title="previous chapter">Modular Applications with Blueprints</a></li> + <li>Next: <a href="shell.html" title="next chapter">Working with the Shell</a></li> + </ul></li> +</ul> + <h3>This Page</h3> + <ul class="this-page-menu"> + <li><a href="_sources/extensions.txt" + rel="nofollow">Show Source</a></li> + </ul> +<div id="searchbox" style="display: none"> + <h3>Quick search</h3> + <form class="search" action="search.html" method="get"> + <input type="text" name="q" /> + <input type="submit" value="Go" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + Enter search terms or a module, class or function name. + </p> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> + </div> + </div> + <div class="clearer"></div> + </div> + <div class="footer"> + © Copyright 2010, Armin Ronacher. + Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>. + </div> + </body> +</html>
\ No newline at end of file |