Index ¦ Archives ¦ Atom > Tag: python

Avoiding cached datetimes with Django querysets

In Django we often need to filter out objects from a queryset which shouldn't be visible to public users, a typical example of this would be a news post in a blog. A staff user could edit a news post to have a publish date in the future, allowing it …


Fixing GDAL and GEOS for Django on macOS

As a user of MacPorts for all the additional packages needed when working with Django on macOS, a recent upgrade to GEOS managed to break all my projects which used GeoDjango:

$ ./manage.py help
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)

  ...

  File …

The cost of Dirty Fields

After installing Django Dirty Fields on projects a few months ago and seeing a dramatic reduction in the number of writes to our main Postgres database - everything seemed fine. However on a brand new project, something wasn't quite right performance wise:

$ siege --concurrent=1 --reps=10 "http://127.0.0 …

Modern Django with Ubuntu Trusty

At this point Ubuntu 14.04 Trusty Tahr is nearly 2.5 years old, with another 2.5 years support left until it reaches end of life for support. However for those of us still working with Trusty, it's often desirable to try and get a few backported modern packages …


Upgrading packages in all Python virtual environments

If you're working with a lot of Python virtual environments in a wide variety of projects, over time you'll end up with outdated packages in some of the older ones - potentially missing out on new features.

For most of the packages you'll want to keep them at a specific version …

© Alex Tomkins.