1+ <!DOCTYPE html>
2+ < html lang ="en "> < head > < meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 ">
3+ < meta charset ="utf-8 ">
4+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6+ < meta name ="description " content ="Full Stack Python shows how an entire Python web application is built and deployed. Each section of the guide explains a different key concept, from the server through the Python WSGI web framework to the front end JavaScript. ">
7+ < meta name ="author " content ="Matt Makai ">
8+ < link rel ="shortcut icon " href ="theme/img/full-stack-python-logo-bw.png ">
9+ < title > Full Stack Python</ title >
10+ <!-- Bootstrap core CSS -->
11+ < link href ="theme/css/fsp.css " rel ="stylesheet ">
12+ <!--[if lt IE 9]>
13+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
14+ <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
15+ <![endif]-->
16+ < style >
17+ html ,
18+ body {
19+ font-size : 18px ;
20+ color : # 222 ;
21+ background : # fefefe ;
22+ }
23+ body {
24+ padding-top : 30px ;
25+ }
26+ .footer {
27+ padding : 20px 0 30px 0 ;
28+ }
29+ a , a : hover {border-bottom : 1px dotted; color : # 444 ;}
30+ a : hover {text-decoration : none; color : # 000 ;}
31+ .logo-title {font-size : 56px ; color : # 403072 ; padding-top : 80px ;
32+ font-family : "News Cycle" , "Arial Narrow Bold" , sans-serif;
33+ font-weight : bold; line-height : 30px ; margin-left : 5px ;}
34+ .logo-title a , .logo-title a : hover {color : # 000 ; text-decoration : none;
35+ border-bottom : none;}
36+ .logo-title a : hover {color : gray;}
37+ .logo-image {vertical-align : top; border : none;}
38+ a .list-group-item .active {background : # 444 ; border : 1px solid # 222 ;}
39+ a .list-group-item .active : hover {background : # 444 ; border : 1px solid # 222 ;}
40+ # sidebar {margin-top : 30px ;}
41+
42+ @media (max-width : 600px ) {
43+ .logo-header-section {
44+ margin : 20px 32px 0 0 ;
45+ }
46+ }
47+ </ style >
48+
49+ < script type ="text/javascript ">
50+ var _gaq = _gaq || [ ] ;
51+ _gaq . push ( [ '_setAccount' , 'UA-19910497-7' ] ) ;
52+ _gaq . push ( [ '_trackPageview' ] ) ;
53+
54+ ( function ( ) {
55+ var ga = document . createElement ( 'script' ) ; ga . type = 'text/javascript' ; ga . async = true ;
56+ ga . src = ( 'https:' == document . location . protocol ? 'https://ssl' : 'http://www' ) + '.google-analytics.com/ga.js' ;
57+ var s = document . getElementsByTagName ( 'script' ) [ 0 ] ; s . parentNode . insertBefore ( ga , s ) ;
58+ } ) ( ) ;
59+ </ script >
60+ </ head >
61+
62+ < body >
63+ < a href ="https://github.com/makaimc/fullstackpython.github.com " class ="github ">
64+ < img style ="position: absolute; top: 0; right: 0; border: 0; " src ="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png " alt ="Fork me on GitHub " />
65+ </ a >
66+ < div class ="container ">
67+ < div class ="row ">
68+ < div class ="col-md-12 ">
69+ < div class ="logo-header-section ">
70+ < a href ="/ " style ="text-decoration: none; border: none; "> < img src ="theme/img/full-stack-python-logo-bw.png " height ="42 " width ="42 " class ="logo-image " /> </ a >
71+ < span class ="logo-title "> < a href ="/ "> Full Stack Python</ a > </ span >
72+ </ div >
73+ </ div >
74+ </ div >
75+ < div class ="row ">
76+ < div class ="col-md-8 ">
77+ < h1 > Application Dependencies</ h1 >
78+ < p > Application dependencies are the Python libraries and their versions
79+ required for an application to work properly. These dependencies are
80+ installed separately from system-level packages to prevent library version
81+ conflicts.</ p >
82+ < p > The most common way to install Python library dependencies is with
83+ the < a href ="http://www.pip-installer.org/en/latest/ "> pip</ a >
84+ command combined with
85+ < a href ="http://www.virtualenv.org/en/latest/ "> virtualenv</ a > to isolate the
86+ dependencies of individual applications from each other.</ p >
87+ < p > Pip and virtualenv work together and have complementary responsibilities.
88+ Pip downloads and installs application dependencies from the central
89+ < a href ="https://pypi.python.org/pypi "> PyPi</ a > repository. Virtualenv creates an
90+ isolated Python installation is where those dependencies are installed into.</ p >
91+ < h2 > requirements.txt</ h2 >
92+ < p > The pip convention for specifying application dependencies is with a
93+ < a href ="http://www.pip-installer.org/en/1.4.1/cookbook.html#requirements-files "> requirements.txt</ a >
94+ file. When you build a Python web application you should include a
95+ requirements.txt file with
96+ < a href ="https://devcenter.heroku.com/articles/python-pip "> pegged dependencies</ a > .</ p >
97+ < h2 > setup.py</ h2 >
98+ < p > There is another type of dependency specification for Python libraries
99+ known as
100+ < a href ="http://stackoverflow.com/questions/1471994/what-is-setup-py "> setup.py</ a > .
101+ Setup.py is a standard for distributing and installing Python libraries.
102+ If you're building a Python library, such as
103+ < a href ="http://www.python-requests.org/en/latest/ "> requests</ a > or
104+ < a href ="https://github.com/makaimc/underwear "> underwear</ a > you must include setup.py
105+ so a dependency manager can correctly install both the library as well as
106+ additional dependencies for the library.</ p >
107+ < h2 > Application dependency resources</ h2 >
108+ < ul >
109+ < li >
110+ < p > < a href ="https://twitter.com/jonathanchu "> Jon Chu</ a > wrote a great introduction on
111+ < a href ="http://www.jontourage.com/2011/02/09/virtualenv-pip-basics/ "> virtualenv and pip basics</ a > .</ p >
112+ </ li >
113+ < li >
114+ < p > "< a href ="http://dabapps.com/blog/introduction-to-pip-and-virtualenv-python/ "> A non-magical introduction to virtualenv and pip</ a >
115+ breaks down what problems these tools solve and how to use them.</ p >
116+ </ li >
117+ < li >
118+ < p > < a href ="http://www.clemesha.org/blog/modern-python-hacker-tools-virtualenv-fabric-pip/ "> Tools of the modern Python hacker</ a >
119+ contains detailed explanations of virtualenv, Fabric, and pip.</ p >
120+ </ li >
121+ < li >
122+ < p > Occasionally arguments about using Python's dependency manager versus
123+ one of Linux's depenency managers comes up. This provides
124+ < a href ="http://notes.pault.ag/debian-python/ "> one perspective on that debate</ a > .</ p >
125+ </ li >
126+ </ ul >
127+ < br />
128+ Next read the
129+ < a href ="/static-content.html "> static content</ a > section.
130+
131+ </ div >
132+ < div class ="col-md-offset-1 col-md-3 " id ="sidebar ">
133+ < div class ="list-group ">
134+ < a href ="/introduction.html " class ="list-group-item "> Introduction</ a >
135+ < a href ="/servers.html " class ="list-group-item "> Servers</ a >
136+ < a href ="/operating-systems.html " class ="list-group-item "> Operating Systems</ a >
137+ < a href ="/web-servers.html " class ="list-group-item "> Web Servers</ a >
138+ < a href ="/platform-as-a-service.html " class ="list-group-item "> Platform-as-a-service</ a >
139+ < a href ="/databases.html " class ="list-group-item "> Databases</ a >
140+ < a href ="/wsgi-servers.html " class ="list-group-item "> WSGI Servers</ a >
141+ < a href ="/web-frameworks.html " class ="list-group-item "> Web Frameworks</ a >
142+ < a href ="/application-dependencies.html " class ="list-group-item active "> Application Dependencies</ a >
143+ < a href ="/static-content.html " class ="list-group-item "> Static Content</ a >
144+ < a href ="/source-control.html " class ="list-group-item "> Source Control</ a >
145+ < a href ="/caching.html " class ="list-group-item "> Caching</ a >
146+ < a href ="/task-queues.html " class ="list-group-item "> Task Queues</ a >
147+ < a href ="/api-integration.html " class ="list-group-item "> API Integration</ a >
148+ < a href ="/no-sql-datastore.html " class ="list-group-item "> NoSQL Data Stores</ a >
149+ < a href ="/web-application-security.html " class ="list-group-item "> Web Security</ a >
150+ < a href ="/logging.html " class ="list-group-item "> Logging</ a >
151+ < a href ="/monitoring.html " class ="list-group-item "> Monitoring</ a >
152+ < a href ="/configuration-management.html " class ="list-group-item "> Configuration Management</ a >
153+ < a href ="/web-analytics.html " class ="list-group-item "> Web Analytics</ a >
154+ < a href ="/about-author.html " class ="list-group-item "> About the Author</ a >
155+ < a href ="/change-log.html " class ="list-group-item "> Change Log</ a >
156+ </ div >
157+ </ div > </ div >
158+ < hr />
159+ < div class ="footer pull-right ">
160+ < a href ="http://www.mattmakai.com/ " class ="underline "> Matt Makai</ a > 2014
161+ </ div >
162+ </ div >
163+
164+ < script src ="http://code.jquery.com/jquery-2.1.0.min.js "> </ script >
165+ < script src ="theme/js/bootstrap.min.js "> </ script >
166+ </ body >
167+ </ html >
0 commit comments