Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1ec3c0288b
Fetching contributors…

Cannot retrieve contributors at this time

228 lines (175 sloc) 11.33 kb
<!DOCTYPE html>
<html lang="en">
<head>
<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="http://html5shiv.googlecode.com/svn/trunk/html5.js"></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]-->
</head>
<body id="index" class="home">
<a href="https://github.com/pydanny/pydanny.github.com">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
</a>
<header id="banner" class="body">
<h1><a href=".">pydanny </a></h1>
<nav><ul>
<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>
</ul></nav>
</header><!-- /#banner -->
<section id="content" class="body">
<article>
<header>
<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="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="pydanny">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</header>
<div class="entry-content">
<footer class="post-info">
<abbr class="published" title="2012-05-09T08:00:00">
Wed 09 May 2012
</abbr>
<address class="vcard author">
By <a class="url fn" href="./author/Daniel-Greenfeld.html">Daniel-Greenfeld</a>
</address>
<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="http://pypi.python.org/pypi/Django/1.4">Django==1.4</a></h2>
<p>Unlike my last quick project which was <a class="reference external" href="http://flask.pocoo.org/">Flask</a>, this effort really falls into <a class="reference external" href="http://djangoproject.com">Django</a>'s sweet spot. I need sessions, forms, templates, and models to do things in an ideal Django pattern.</p>
</div>
<div class="section" id="psycopg2-2-4-5">
<h2><a class="reference external" href="http://pypi.python.org/pypi/psycopg2">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>
<div class="section" id="django-debug-toolbar-0-9-4">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-debug-toolbar">django-debug-toolbar==0.9.4</a></h2>
<p>Because not using this tool is insane.</p>
</div>
<div class="section" id="django-extensions-0-8">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-extensions">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>
<div class="section" id="south-0-7-5">
<h2><a class="reference external" href="http://pypi.python.org/pypi/South">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>
<div class="section" id="django-registration-0-8-0">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-registration">django-registration==0.8.0</a></h2>
<p>Normally <a class="reference external" href="http://pypi.python.org/pypi/django-social-auth">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>
<div class="section" id="django-floppyforms-0-4-7">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-floppyforms">django-floppyforms==0.4.7</a></h2>
<p>An excellent tool for making your forms HTML5-ish out of the box.</p>
</div>
<div class="section" id="django-crispy-forms-1-1-3">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-crispy-forms">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>
<div class="section" id="django-heroku-postgresify-0-2">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-heroku-postgresify">django-heroku-postgresify==0.2</a></h2>
<p>This tool makes getting the PostGreSQL settings out of Heroku trivial.</p>
</div>
<div class="section" id="django-heroku-memcacheify-0-1">
<h2><a class="reference external" href="http://pypi.python.org/pypi/django-heroku-memcacheify">django-heroku-memcacheify==0.1</a></h2>
<p>This tool makes getting the memcache settings for Heroku trivial.</p>
</div>
<div class="section" id="gunicorn-0-14-2">
<h2><a class="reference external" href="http://pypi.python.org/pypi/gunicorn">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>
</div>
<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">
Django==1.4
South==0.7.5
django-crispy-forms==1.1.3
django-debug-toolbar==0.9.4
django-extensions==0.8
django-floppyforms==0.4.7
django-registration==0.8.0
django-heroku-memcacheify==0.1
django-heroku-postgresify==0.2
django-registration==0.8.0
gunicorn==0.14.2
psycopg2==2.4.5
</pre>
<p>Once you have that, you install them thus in your <a class="reference external" href="http://pypi.python.org/pypi/virtualenv">virtualenv</a>:</p>
<pre class="literal-block">
pip install -r requirements.txt
</pre>
<p>Now that I have all this, it's time to code!</p>
<hr class="docutils" />
<a class="reference external image-reference" href="http://www.flickr.com/photos/pydanny/4358842735/"><img alt="http://farm5.staticflickr.com/4027/4358842735_38991c0944.jpg" class="align-center" id="blizzard-of-2010" src="http://farm5.staticflickr.com/4027/4358842735_38991c0944.jpg" /></a>
</div>
</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 = 'http://pydanny.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>
</article>
</section>
<section id="extras" class="body">
<div class="social">
<h2>social</h2>
<ul>
<li><a href="/feeds/all.atom.xml" type="application/atom+xml" rel="alternate">atom feed</a></li>
<li><a href="http://twitter.com/pydanny">twitter</a></li>
<li><a href="https://github.com/pydanny">github</a></li>
<li><a href="http://www.facebook.com/daniel.greenfeld">facebook</a></li>
</ul>
</div><!-- /.social -->
</section><!-- /#extras -->
<footer id="contentinfo" class="body">
<address id="about" class="vcard body">
Proudly powered by <a href="http://pelican.notmyidea.org/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">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 + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-18066389-3");
pageTracker._trackPageview();
} 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 + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.