Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
Hmmm, this delete statement is taking longer than I thought it would… If you ever have to manually run a SQL delete statement in psql, you can back-up the rows you’re about to delete: \copy ( select * from $table where id in ( ... ) ) to '/tmp/backup.csv'…
-
Managing South migrations on a multi-developer Django project can be painful.
-
The excellent virtualenvwrapper supports a postmkvirtualenv script to bootstrap your virtual environments.
-
At Tangent, we use Zabbix for monitoring and alerting.
-
It was rightly pointed out yesterday that it’s dangerous to link to lines or blocks of code on Github without explicitly specifying the commit hash in the URL.
-
New developers joining a project will often find that the project won’t build cleanly on their machine, and hours of time will be sunk into setting up the project so work can start.
-
If you’re not doing this already, then you should use the Silver Searcher within Vim for rapid, convenient file searching.
-
Oscar 0.7 was released this week, a comparatively minor house-keeping release that allowed us to reduce our pull-request and issue backlogs.
-
We finally released Oscar 0.6 last week.
-
Despite its extensive documentation, getting GeoDjango installed and configured can be a pain.
-
Confession: I am a pedant, especially around commit messages.
-
I wasted at least twenty minutes getting this to work.
-
TLDR: Parameterised tests are a useful testing technique.
-
At Tangent we handle environment-specific configuration of Django projects using the method outlined by David Cramer.
-
The problem It’s common for UX professionals to design forms like the following: where radio buttons are employed to split the form into sections, each of which can have its own fields which are only mandatory if the parent radio button is checked.
-
Thanks to @kuramanga, it’s now possible to add shiny PyPi badges to your Python project READMEs that indicate the latest released version on PyPI and the total number of downloads.
-
Every now and again, an innocent python developer checks out a new git branch then proceeds to bang their head against a bug caused by an orphaned .pyc file from the previous branch.
-
Consider this curio: import mock from django.utils.functional import curry no_database = curry( mock.patch, 'django.db.backends.util.CursorWrapper', Mock(side_effect=RuntimeError("Using the database is not permitted"))) This snippet creates a decorator th…
-
Problem You want to install PIL on 64-bit Ubuntu 12.04 (Precise Pangolin).
-
Using the Hub library, it’s possible to convert Github issues into pull requests.
-
Problem You’re using Postgres with Django.
-
Problem You’re using Postgres.app on a Mac for local development but are getting SQL errors from your application.
-
Structure and Interpretation of Computer Programs is full of interesting footnotes.
-
I work at an agency where we pay $200 a month to Github for their platinum plan.
-
External parties often need to upload data to your application.
-
Since watching Carl Meyer’s superb ‘Testing and Django’ talk, I’ve been using Ian Bicking’s WebTest library for functional tests, via django-webtest.
-
Inspired by Jacob Kaplan-Moss’s excellent talk “Django doesn’t scale” at this year’s OSCon, I’ve put together a Django package for re-populating caches asynchronously.
-
All Django developers will deal with file uploads at some point.
-
Problem You want to add i18n support to an existing project.
-
How to use a South data migration to avoid accidentally sending emails from example.com.
-
Problem You are serving a Django application using Nginx to proxy to an Apache server running mod_wsgi and you want to allow slashes in your URL keywords.
-
Working with URLs in Python feels clunky when it should be pleasant.
-
Problem You want to embed HTML within a message using Django’s messages framework.
-
Problem You want a unix-like tool for manipulating CSV data from the command-line.
-
Problem For some reason, you need to reload your Django URL config.
-
Problem You want to validate a post/zip-code when you only know the country at runtime.
-
Problem You want to all the PyCon videos on your iPhone for offline viewing.
-
Here’s a few tips for using a Git pre-commit hook.
-
I gave two presentations at Confoo 2012 - below are the abstracts and slides.
-
Problem You want to test how your application handles HTTPS requests.
-
Django provides several mechanisms for loading initial data for models, such as leveraging JSON fixtures or files of raw SQL - James Bennett offers a good overview.
-
Listed below is a Fabric function for determining the appropriate git reference to deploy during a deployment.
-
A client site went down today.
-
Problem You’re a python hacker using virtualenv and virtualenvwrapper on a range of projects.
-
For some reason, I keep finding myself writing unit tests that need to make assertions about an XML document.
-
I rewrote this blog recently with the following aims: to make it as easy as possible to create a new article, using reStructuredText (RST); to clean up and simplify the design, focussing on the readability of articles that include code snippets.
-
This is just for my own reference as I always forget the dependencies for setting up MySQL on a new machine.
-
Problem The python package installer pip can be used to install directly from Github, like so: pip install git+git://github.com/tangentlabs/django-oscar.git#egg=django-oscar This will install from the HEAD of the master branch.
-
Problem By default in Python (and Django), the documented console handler emits to STDERR, but you want it to use STDOUT instead.
-
If you use virtual environments on your django servers, then getting manage.py commands to run from cron is a little tricky.