-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallation.html
More file actions
237 lines (218 loc) · 11.6 KB
/
Copy pathinstallation.html
File metadata and controls
237 lines (218 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!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="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Installation — baseq 0.01 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" src="_static/documentation_options.js"></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="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="installation">
<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
<div class="section" id="python-version">
<h2>Python Version<a class="headerlink" href="#python-version" title="Permalink to this headline">¶</a></h2>
<p>We recommend using the latest version of Python 3. supports Python 3.4
and newer, Python 2.7, and PyPy.</p>
</div>
<div class="section" id="dependencies">
<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
<p>These distributions will be installed automatically when installing Flask.</p>
<ul class="simple">
<li><a class="reference external" href="http://werkzeug.pocoo.org/">Werkzeug</a> implements WSGI, the standard Python interface between
applications and servers.</li>
<li><a class="reference external" href="http://jinja.pocoo.org/">Jinja</a> is a template language that renders the pages your application
serves.</li>
<li><a class="reference external" href="https://pypi.org/project/MarkupSafe/">MarkupSafe</a> comes with Jinja. It escapes untrusted input when rendering
templates to avoid injection attacks.</li>
<li><a class="reference external" href="https://pythonhosted.org/itsdangerous/">ItsDangerous</a> securely signs data to ensure its integrity. This is used
to protect Flask’s session cookie.</li>
<li><a class="reference external" href="http://click.pocoo.org/">Click</a> is a framework for writing command line applications. It provides
the <code class="docutils literal notranslate"><span class="pre">flask</span></code> command and allows adding custom management commands.</li>
</ul>
<div class="section" id="optional-dependencies">
<h3>Optional dependencies<a class="headerlink" href="#optional-dependencies" title="Permalink to this headline">¶</a></h3>
<p>These distributions will not be installed automatically. Flask will detect and
use them if you install them.</p>
<ul class="simple">
<li><a class="reference external" href="https://pythonhosted.org/blinker/">Blinker</a> provides support for <span class="xref std std-ref">signals</span>.</li>
<li><a class="reference external" href="https://simplejson.readthedocs.io/">SimpleJSON</a> is a fast JSON implementation that is compatible with
Python’s <code class="docutils literal notranslate"><span class="pre">json</span></code> module. It is preferred for JSON operations if it is
installed.</li>
<li><a class="reference external" href="https://github.com/theskumar/python-dotenv#readme">python-dotenv</a> enables support for <span class="xref std std-ref">dotenv</span> when running <code class="docutils literal notranslate"><span class="pre">flask</span></code>
commands.</li>
<li><a class="reference external" href="https://pythonhosted.org/watchdog/">Watchdog</a> provides a faster, more efficient reloader for the development
server.</li>
</ul>
</div>
</div>
<div class="section" id="virtual-environments">
<h2>Virtual environments<a class="headerlink" href="#virtual-environments" title="Permalink to this headline">¶</a></h2>
<p>Use a virtual environment to manage the dependencies for your project, both in
development and in production.</p>
<p>What problem does a virtual environment solve? The more Python projects you
have, the more likely it is that you need to work with different versions of
Python libraries, or even Python itself. Newer versions of libraries for one
project can break compatibility in another project.</p>
<p>Virtual environments are independent groups of Python libraries, one for each
project. Packages installed for one project will not affect other projects or
the operating system’s packages.</p>
<p>Python 3 comes bundled with the <code class="xref py py-mod docutils literal notranslate"><span class="pre">venv</span></code> module to create virtual
environments. If you’re using a modern version of Python, you can continue on
to the next section.</p>
<p>If you’re using Python 2, see <a class="reference internal" href="#install-install-virtualenv"><span class="std std-ref">Install virtualenv</span></a> first.</p>
<div class="section" id="create-an-environment">
<span id="install-create-env"></span><h3>Create an environment<a class="headerlink" href="#create-an-environment" title="Permalink to this headline">¶</a></h3>
<p>Create a project folder and a <code class="file docutils literal notranslate"><span class="pre">venv</span></code> folder within:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>mkdir myproject
<span class="nb">cd</span> myproject
python3 -m venv venv
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>py -3 -m venv venv
</pre></div>
</div>
<p>If you needed to install virtualenv because you are on an older version of
Python, use the following command instead:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>virtualenv venv
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>\Python27\Scripts\virtualenv.exe venv
</pre></div>
</div>
</div>
<div class="section" id="activate-the-environment">
<span id="install-activate-env"></span><h3>Activate the environment<a class="headerlink" href="#activate-the-environment" title="Permalink to this headline">¶</a></h3>
<p>Before you work on your project, activate the corresponding environment:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>. venv/bin/activate
</pre></div>
</div>
<p>On Windows:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>venv\Scripts\activate
</pre></div>
</div>
<p>Your shell prompt will change to show the name of the activated environment.</p>
</div>
</div>
<div class="section" id="install-flask">
<h2>Install Flask<a class="headerlink" href="#install-flask" title="Permalink to this headline">¶</a></h2>
<p>Within the activated environment, use the following command to install Flask:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pip install Flask
</pre></div>
</div>
<div class="section" id="living-on-the-edge">
<h3>Living on the edge<a class="headerlink" href="#living-on-the-edge" title="Permalink to this headline">¶</a></h3>
<p>If you want to work with the latest Flask code before it’s released, install or
update the code from the master branch:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pip install -U https://github.com/pallets/flask/archive/master.tar.gz
</pre></div>
</div>
</div>
</div>
<div class="section" id="install-virtualenv">
<span id="install-install-virtualenv"></span><h2>Install virtualenv<a class="headerlink" href="#install-virtualenv" title="Permalink to this headline">¶</a></h2>
<p>If you are using Python 2, the venv module is not available. Instead,
install <a class="reference external" href="https://virtualenv.pypa.io/">virtualenv</a>.</p>
<p>On Linux, virtualenv is provided by your package manager:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Debian, Ubuntu</span>
sudo apt-get install python-virtualenv
<span class="c1"># CentOS, Fedora</span>
sudo yum install python-virtualenv
<span class="c1"># Arch</span>
sudo pacman -S python-virtualenv
</pre></div>
</div>
<p>If you are on Mac OS X or Windows, download <a class="reference external" href="https://bootstrap.pypa.io/get-pip.py">get-pip.py</a>, then:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>sudo python2 Downloads/get-pip.py
sudo python2 -m pip install virtualenv
</pre></div>
</div>
<p>On Windows, as an administrator:</p>
<div class="highlight-bat notranslate"><div class="highlight"><pre><span></span>\Python27\python.exe Downloads\get-pip.py
\Python27\python.exe -m pip install virtualenv
</pre></div>
</div>
<p>Now you can continue to <a class="reference internal" href="#install-create-env"><span class="std std-ref">Create an environment</span></a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#python-version">Python Version</a></li>
<li><a class="reference internal" href="#dependencies">Dependencies</a><ul>
<li><a class="reference internal" href="#optional-dependencies">Optional dependencies</a></li>
</ul>
</li>
<li><a class="reference internal" href="#virtual-environments">Virtual environments</a><ul>
<li><a class="reference internal" href="#create-an-environment">Create an environment</a></li>
<li><a class="reference internal" href="#activate-the-environment">Activate the environment</a></li>
</ul>
</li>
<li><a class="reference internal" href="#install-flask">Install Flask</a><ul>
<li><a class="reference internal" href="#living-on-the-edge">Living on the edge</a></li>
</ul>
</li>
<li><a class="reference internal" href="#install-virtualenv">Install virtualenv</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/installation.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<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>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2018, Xiannian Zhang.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.4</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
<a href="_sources/installation.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>