All articles tagged Django

Thumbnail image for Single-file Python/Django Deployments

Single-file Python/Django Deployments

<p>This post covers portions of my talk,</p><p>Containerless Django</p><p>, from DjangoCon US 2018.</p><p>Deploying Python has improved significantly since I started working with it over a decade ago. We have virtualenv, pip, wheels, package hash verification, and</p><p>lock</p><p>files …</p>
Thumbnail image for Cracking Django Password Hashes

Cracking Django Password Hashes

<p>Most of the Django projects I work with take advantage of</p><p>django.contrib.auth</p><p>. It manages users and groups and is tightly coupled with</p><p>django.contrib.admin</p><p>. In this post, we are going to explore how it resists a potential attacker.</p><p>The …</p>
Thumbnail image for Goodbye manage.py

Goodbye manage.py

<p>Every Django project starts with a</p><p>manage.py</p><p>file in its root. It’s a convenience script that allows you to run administrative tasks like Django’s included</p><p>django-admin</p><p>.</p><p>In</p><p>our last post</p><p>, we discussed the merits of including a</p><p>setup.py …</p>
Thumbnail image for Django Logging, The Right Way

Django Logging, The Right Way

<p>Good logging is critical to debugging and troubleshooting problems. Not only is it helpful in local development, but in production it’s indispensable. When reviewing logs for an issue, it’s rare to hear somebody say, “We have too much logging in …</p>
Thumbnail image for Disabling Error Emails in Django

Disabling Error Emails in Django

<p>One of Django’s nice “batteries included” features is the ability to send emails when an error is encountered. This is a great feature for small sites where minor problems would otherwise go unnoticed.</p><p>Once your site start getting lots of …</p>
Thumbnail image for Django Patterns: Fat Models and cached_property

Django Patterns: Fat Models and cached_property

<p>One of my favorite patterns in Django is the combination of “fat” models and</p><p>cached_property</p><p>from</p><p>django.utils.functional</p><p>.</p><p>Fat models are a general MVC concept which encourages pushing logic into methods on your Model layer rather than the Controller (“view” …</p>
Thumbnail image for Django Anti-Patterns: Signals

Django Anti-Patterns: Signals

<p>Django’s</p><p>Signal Dispatcher</p><p>is a really powerful feature that you should never use. Ok, it has valid use cases, but they may be rarer than you think.</p><p>First, to dispel a misconception about signals, they are not executed asynchronously. There …</p>
Thumbnail image for Sharing Media Files Without S3

Sharing Media Files Without S3

<p>Nowadays, it’s common to deploy multiple application servers, but it poses a very common problem; How are these application servers going to share the media files contributed by the users?</p><p>Cloud providers like Google, Rackspace or Amazon Web Services solve …</p>