We've been doing quite a few projects lately where old incoming links need redirecting to new pages (both for visitors and the much sought-after Google juice). In such projects SEO is mostly tacked-on as an afterthought and often neglected, however giving your users the tools to set this up themselves is always appreciated. The default redirects app in Django works pretty well for users, but …
Read MoreWhen it comes to Django everyone has their own way of structuring a project. The default layout when running startproject is reasonable for smaller projects, but it quickly gets messy when those projects grow. Two Scoops of Django has a whole chapter on the subject, but rightfully states that no two developers would structure their project in the same way. The default project structure of …
Read MoreRestORM structures the way you access a RESTful API and allows you to easily access related resources. It tries to be as generic as possible so it's not tailored to any specific API or server-side API library. With RestORM you can mock an entire API and replace the real client with a mock version in unit tests. RestORM is very extensible but offers many functionalities out of the box to get you up and running quickly.
Read MoreAllow custom choices in the Django admin in a select widget.
Read MoreMore elegant approach to do nested resources in Django Tastypie and make authentication work while at it.
Read MoreYou have a model A with a relation to another model B. In the Django admin, you have full permissions for model A and none for model B. However, if you create a new object for model A, you need to select a related object from model B. Tough luck: Permission denied!
Read MoreSo we had some issues using django-piston (a webservice framework for Django) in combination with HTTP Basic authorization. By default both Squid and mod_wsgi will not forward the HTTP_AUTHORIZATION headers to the next layer. So if you have a wsgi application that does its own authorization you need to do the following: In your squid.conf you need to add the login=PASS to the cache_peer entries …
Read MoreFor our subversion repositories we only allow users to connect through ssh public key login. We are switching towards using Fabric for doing automated deployments (in combination with zc.buildout, which we already use). Unfortunately it seems that both Fabric and paramiko, the python library Fabric uses for making ssh connections, don't support the ForwardAgent option in ~/.ssh/config which allows you to forward your ssh-agent to …
Read MoreTo import large amounts of CSV data from a file into a MySQL database you can use the LOAD DATA [LOCAL] INFILE command. There are some caveats using this command having to do with security. In order for LOAD DATA to work you will have to enable the command on both the server and client. To do this for the server, you can edit your …
Read More