Browse article archive
Tips, tricks and insights from a modern web development perspective
Read all articles
Django pattern: download to FileField
Downloading and saving images or other files to your database models is a common pattern in Django. Here are a few ways to do it.
Testing field validation in Django
How to simplify model and form tests involving ValidationError and make them more robust
WebCamp Zagreb 2017 was again an incredible experience and we're happy to have taken part in it.
Setting up a Let's Encrypt SSL certificate
Using a third-party acmetool client it's easy to set up HTTPS in just a few minutes - here's how to do it for an nginx web server
Optimal project structure for Django-based single-page apps
Automating Django deployment and updates with make
Make is one of the oldest tools in existence, but still pretty useful for automating inter-dependent tasks
Environment-based Django settings
We describe a simple yet flexible Django settings organization we developed iterating through dozens of projects we've worked on
Using Python 3 for all new Django projects
The scales have tipped and Python 3 is now the default — at least for us
Bezier curves in HTML5 canvas
We show a straightforward way to draw Bezier curves through multiple points in HTML5 canvas and provide a handy function you can reuse
QR Code as a service in Go
We love using Go for writing specialized network servers, and we've just open sourced one.
All set for WebCamp Zagreb 2016
WebCamp Zagreb, one of the largest regional developer conferences is upon us again. Here's what we've been cooking.
For the past several months, we have been running intensive company-internal workshops every week. Here's our experience
Exposing version information from your Django project
Adding a custom header identifying the git/hg revision of your project can make it easy to identify the version of the code running. Here's how to do it.
Visiting Bett 2016
Last week we visited Bett, Europe's largest education technology trade fair. Having a product in the space (our web-based shared whiteboard AWW), we were interested to learn about what's on the cutting edge of edtech.
A year in review - 2015 recap
Year 2015 was a great year here at Good Code. We produced a lot of things, were engaged in open source and web development communities, grew, started some new projects and had loads of fun doing it all.
WebCamp Zagreb 2015 Redux
As is tradition, start of fall in Croatia means there's a big community-driven web conference - WebCamp Zagreb. This years' conference was the biggest yet, with two days packed with talks, more than 800 attendees, participants and speakers from all over the world.
Building highly-available and fault tolerant sites on a budget
At this year's WebCamp Zagreb I gave a talk on increasing the website reliability "just enough to get by", without going to unneeded extremes. I shared a few tips on how to maximise the uptime and minimise unexpected downtime of a typical web application.
Finding a good open source component to use in your project
Using Docker in your development environment
Here at GoodCode we love Docker. Some of us have been fans since we saw the intro in a lightning talk at PyCon. We’re fans for a reason. Docker solves a lot of problems for us. We do mostly custom webapps some of which have complicated architectures and many ...
Here at GoodCode we’re big fans of Ansible. We use it to provision our production servers as well as our dev/vagrant instances. We’re also big fans of docker containers and Ansible fits very nicely with that as well.
Python tricks: accessing dictionary items as object attributes
Python’s dictionaries are great for creating ad-hoc structures of arbitrary number of items. Sometimes, though, it can be awkward using the dictionary syntax for setting and getting the items. For example, let’s say you have the following data structures:
Detecting duplicate SQL queries in Django
Django’s ORM is a very powerful tool, and possibly the most complex part of the entire framework. The ORM makes it easy to do quite complex operations on the data without worrying about SQL syntax details, but can be dangerous (in terms of performance) unless you’re familiar with ...
Using Django for (mostly) static sites
While Django is a great framework for building websites and web applications, it’s often considered as “too big” for fulfilling simple needs, such as mostly static content or single-page sites. While alternatives like static website generators (such as Jekyll or Hyde) or microframeworks (such as Flask) indeed are more ...
OAuth2 in Python
A guide on OAuth2 concepts and using it from Python.
Come to the EU, we have cookies
If you’re involved in building a website or a web application that caters to the EU visitors, you’ve probably heard of the EU cookie law. Ideally, the law would provide website visitors with transparency of how the sites they visit are tracking them. In reality, the effect is ...
Putting a price on a software development contract: fixed vs. agile
In some industries, it’s easy to calculate a price for a product sold or service rendered. Often it’s cost plus some margin, or time spent and the cost of the raw materials used.
Using CasperJS in automated end-to-end tests for Django applications
Singleton models in Django
Sometimes it’s useful to have a database table with just one row. A typical example are user-editable settings – we want to store them with all the other data (in the database), but there’s really only one set of settings at any time.
Easy multi-language models in Django
If you’ve written an application that needs to be localized into multiple languages, you’ve probably faced the problem of translating the application interface and data to the target languages.
When to do git merging or rebasing
This one pops up fairly often, and can indeed be quite confusing – when to use merge versus rebase in git? Here’s the answer.
Auto rsync local changes to remote server
When developing software that’s intended to run on a server, I like to edit the code directly on my laptop, but don’t want to run the development server locally.
Django setup using Nginx and Gunicorn
This is a howto on setting up Django on a Linux (Ubuntu) system using Nginx as a reverse proxy and Gunicorn as a Django service.
Fast WordPress/Nginx setup on a cheap VPS
I’ve got a single Linode 512 VPS server hosting a few of my WordPress powered sites (including this blog), a few Python web apps, a mail server and a few other fairly standard things. It’s not a high-traffic site so the server is not under much stress, but ...