Our Current Requirements.txt
distribute>=0.6.28
mysql-python>=1.2.4
Django>=1.5
pillow
south>=0.8,<2.0
sorl-thumbnail
hamlpy
requests>=1.0
djangorestframework>=2.3.4
unicodecsv
# Django Enhancements
django-extensions
django-model-utils
django-templated-email
django-grappelli>=2.4.5
django-floppyforms
django-filter
django-braces
# Datetime
pytz
iso8601
python-dateutil>=1.5,<2.0
# Deployment
uwsgi
Werkzeug
fabric
# Analytics
numpy
pandas
# Caching
redis
hiredis
django-redis-cache
johnny-cache
# Django Compressor
django-compressor>=1.3
lxml
BeautifulSoup<4.0
cssmin
slimit
django-sekizai
# Celery
django-celery-with-redis
django-celery-transactions
# Social
gdata
google-api-python-client
oauth2client
django-social-auth>=0.7.22
facepy
# Services
mixpanel-celery>=0.6.0
raven>=3.0
lettuce>=0.2.18
Cleaner Frontend Code
-
HamlPy (Template loader)
- More readable and concise html generation
- (Also more version control friendly since it's line based)
-
Django Compressor
- Supports LessCSS and Coffeescript
-
lxml, BeautifulSoup, cssmin, slimit for minification
- NPM Packages: less, jshint, recess, uglify-js, coffee-script
-
django-sekizai
- Adding resources in template fragments on demand
Haml Templates
<p>A bunch of placeholder text about your company.</p>
<div class="actions">
<div class="action-container pull-left">
<a class="flat-button block-level call-to-action" href="{% url "join" %}">Join our Site!</a>
</div>
<div class="action-container pull-right">
<a class="flat-button block-level call-to-action" href="{% url "login" %}">Sign In</a>
</div>
</div>
%p
A bunch of placeholder text about your company.
.actions
.action-container.pull-left
%a.flat-button.block-level.call-to-action{'href': '{% url "join" %}'}
Join our Site!
.action-container.pull-right
%a.flat-button.block-level.call-to-action{'href': '{% url "login" %}'}
Sign In
Another Haml Template
<div class="product-information-container">
<div class="product-information">
<h4>
{% if headline %}{{ headline }}{% endif %}
{% if url %}
<p>
<p>
<a href="{{ url }}">{{ url|format_url }}</a>
</p>
</p>
{% endif %}
</h4>
{% if description %}
<p class="description">{{ description }}</p>
</div>
</div>
.product-information-container
.product-information
%h4
- if headline
= headline
- if url
%p
%a{'href': '={url}'}
= url|format_url
- if description
%p.description<
= description
Django Sekizai
Base Template
{% render_block "js" %}
or with Django Compressor Processors (Coffeescript)
{% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %}
Included Fragment Example
- addtoblock "js"
%script{'type': 'text/javascript', 'src': '{% static "js/jquery/jquery.timeago.js" %}'}
- endaddtoblock "js"
Included Fragment Example (Coffeescript)
{% addtoblock "js" %}
<script type="text/coffeescript" src="{% static js/directives/date.coffee" %}"></script>
{% endaddtoblock "js" %}