Index ¦ Archives ¦ Atom > Tag: django

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 …


Easier PostgreSQL Extension Installations

Postgres has a number of extensions which require superuser access for a user to install them, PostGIS being one of them. If you're wanting to install a GeoDjango app, you'll probably encounter an error such as:

$ ./manage.py migrate
Traceback (most recent call last):
  ..
django.db.utils.ProgrammingError: permission denied …

© Alex Tomkins.