On my site I wanted visitors to the home page to be immediately redirected to the member’s area if they were already logged in. This saves them a click or two and gets them straight down to business, as opposed… Read More »Redirecting an already logged in user in Django using Class Based Views
Retool is a website application that allows you to quickly create dashboards and management information system (MIS) reports. The dashboards are intended for internal use – you don’t show them to the public. I use it because it can quickly… Read More »Integrating Django Rest Framework and Retool
Sometimes you may wish to raise a 404 in the middle of a class based view. Perhaps you determine in the middle of get_context_data() that you don’t want this user accessing the object for some reason. Consider a horse stable,… Read More »Raising a 404 error from a Class Based View in Django
Every Django Application has the magnificent Django Admin built in enabling you to access your database tables in a very nice way. The url is typically admin/ The problem is that hackers also know the default admin url for a… Read More »Securing your Django Admin by using a HoneyPot
Sometimes you have large data sets. Most of the time this makes Django slow. For example there are 17,000 suburbs in Australia – so having an address with a foreign key to suburb is going to create slowness in forms… Read More »Choose, and choose quickly: Optimising ModelChoiceField
Yes. Yes you should. There is almost no reason not to, and plenty of reasons why it’s the right choice. Background A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. When generated according… Read More »Should I use UUIDs as my model ID in Django?
I recently came across this bug while working through the alpha of HorseRecords. Image upload worked perfectly in development but in production it bailed out on all but very small images. The solution was to adjust the nginx config variable… Read More »Fixing Ubuntu error “entity too large” in nginx, Django