Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
228 lines (175 sloc) 11.1 KB
<!DOCTYPE html>
<html lang="en">
<title>Django Requirements for a project</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./theme/css/main.css" type="text/css" />
<link href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="pydanny Atom Feed" />
<!--[if IE]>
<script src=""></script><![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" media="all" href="./css/ie.css"/>
<script src="./js/IE8.js" type="text/javascript"></script><![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="all" href="./css/ie6.css"/><![endif]-->
<body id="index" class="home">
<a href="">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="" alt="Fork me on GitHub" />
<header id="banner" class="body">
<h1><a href=".">pydanny </a></h1>
<li><a href="./pages/about.html">About</a></li>
<li><a href="./pages/tools.html">Tools</a></li>
<li><a href="./pages/upcoming.html">Upcoming</a></li>
<li ><a href="./category/audrey.html">Audrey</a></li>
<li ><a href="./category/blog.html">Blog</a></li>
<li class="active"><a href="./category/django.html">Django</a></li>
<li ><a href="./category/python.html">Python</a></li>
</header><!-- /#banner -->
<section id="content" class="body">
<h1 class="entry-title">
<a href="django-requirements-for-a-project.html" rel="bookmark"
title="Permalink to Django Requirements for a project">Django Requirements for a project</a></h1>
<a href="" class="twitter-share-button" data-count="horizontal" data-via="pydanny">Tweet</a><script type="text/javascript" src=""></script>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2012-05-09T08:00:00">
Wed 09 May 2012
<address class="vcard author">
By <a class="url fn" href="./author/Daniel-Greenfeld.html">Daniel-Greenfeld</a>
<p>In <a href="./category/django.html">django</a>. </p>
<p>tags: <a href="./tag/python.html">python</a><a href="./tag/django.html">django</a><a href="./tag/setup.html">setup</a></p>
</footer><!-- /.post-info -->
<p>Today I'm starting a new project. I'm working as fast as I can and hope to launch on Friday. What are my package dependencies?</p>
<div class="section" id="django-1-4">
<h2><a class="reference external" href="">Django==1.4</a></h2>
<p>Unlike my last quick project which was <a class="reference external" href="">Flask</a>, this effort really falls into <a class="reference external" href="">Django</a>'s sweet spot. I need sessions, forms, templates, and models to do things in an ideal Django pattern.</p>
<div class="section" id="psycopg2-2-4-5">
<h2><a class="reference external" href="">psycopg2==2.4.5</a></h2>
<p>I need transactions and hard-type validation in the database, which means PostgreSQL. If I didn't need transactions or the hard-type validation I would consider MongoDB instead.</p>
<div class="section" id="django-debug-toolbar-0-9-4">
<h2><a class="reference external" href="">django-debug-toolbar==0.9.4</a></h2>
<p>Because not using this tool is insane.</p>
<div class="section" id="django-extensions-0-8">
<h2><a class="reference external" href="">django-extensions==0.8</a></h2>
<p>Because amongst other things this library gives you, I never want to write my own <tt class="docutils literal">TimeStampedModel</tt> ever again. :-)</p>
<div class="section" id="south-0-7-5">
<h2><a class="reference external" href="">South==0.7.5</a></h2>
<p>Django gives you the freedom to migrate data in the way you want. The way I want to do it is via South.</p>
<div class="section" id="django-registration-0-8-0">
<h2><a class="reference external" href="">django-registration==0.8.0</a></h2>
<p>Normally <a class="reference external" href="">django-social-auth</a> is my go-to tool for registration, but in this case I need simple username/password registration. This is a very solid tool, but you do have to make your own templates or find someone's fork that has a copy of templates that match.</p>
<div class="section" id="django-floppyforms-0-4-7">
<h2><a class="reference external" href="">django-floppyforms==0.4.7</a></h2>
<p>An excellent tool for making your forms HTML5-ish out of the box.</p>
<div class="section" id="django-crispy-forms-1-1-3">
<h2><a class="reference external" href="">django-crispy-forms==1.1.3</a></h2>
<p>The child of my own django-uni-forms, this will let me create forms using div-based controls super fast, and do layout customizations if I need them.</p>
<div class="section" id="django-heroku-postgresify-0-2">
<h2><a class="reference external" href="">django-heroku-postgresify==0.2</a></h2>
<p>This tool makes getting the PostGreSQL settings out of Heroku trivial.</p>
<div class="section" id="django-heroku-memcacheify-0-1">
<h2><a class="reference external" href="">django-heroku-memcacheify==0.1</a></h2>
<p>This tool makes getting the memcache settings for Heroku trivial.</p>
<div class="section" id="gunicorn-0-14-2">
<h2><a class="reference external" href="">gunicorn==0.14.2</a></h2>
<p>All the cool kids who play in devops swear by Gunicorn. I use it because Heroku seems to recommend it for Django deployments.</p>
<hr class="docutils" />
<div class="section" id="installing-the-above-packages">
<h2>Installing the above packages</h2>
<p>Never copy/paste these libraries directly into your projects. If you do that, you'll end up hating yourself later as your local instances become unmaintained forks of the real project. Also, unless you are really careful in your copy/pasting, you'll be in violation of various open source licenses. Odds are the FOSS police aren't going to find you, but I can assure you that when you bring in one of the authors of these packages to help you fix a problem he/she is going to be mighty annoyed at the lack of attribution.</p>
<p>Do it the right way: do proper Python dependency management.</p>
<p>Create a <tt class="docutils literal">requirements.txt</tt> file and install them as proper dependencies. The file should contain the following text:</p>
<pre class="literal-block">
<p>Once you have that, you install them thus in your <a class="reference external" href="">virtualenv</a>:</p>
<pre class="literal-block">
pip install -r requirements.txt
<p>Now that I have all this, it's time to code!</p>
<hr class="docutils" />
<a class="reference external image-reference" href=""><img alt="" class="align-center" id="blizzard-of-2010" src="" /></a>
</div><!-- /.entry-content -->
<div class="comments">
<h2>Comments !</h2>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_identifier = "django-requirements-for-a-project.html";
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
<section id="extras" class="body">
<div class="social">
<li><a href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">atom feed</a></li>
<li><a href="">twitter</a></li>
<li><a href="">github</a></li>
<li><a href="">facebook</a></li>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="">Pelican</a>, which takes great advantage of <a href="">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="">Smashing Magazine</a>, thanks!</p>
</footer><!-- /#contentinfo -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E"));
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-18066389-3");
} catch(err) {}</script>
<script type="text/javascript">
var disqus_shortname = 'pydanny';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);