Categories
Capitalism

A Summary of Free To Choose – Milton Friedman

Introduction Adam Smith in the Wealth of Nations: An inidividual who intends only his own gain is led by an invisible hand…by pursuing his own interest he frequently promotes that of society more effectually than when he really intends to promote it. I have never known much good done by those who affected to trade […]

Categories
django

Wrangling with Django’s DecimalField and representations

I’ve been building an application that needs precicion as it is dealing with money, finance and trading. For these tasks there is a special datatype called decimal.Decimal that python has built in. It has many advantages but has a few disadvantages when displaying the decimal to the user. The trailing zeroes are shown (which is […]

Categories
django

Running multiple django sites on a single server with gunicorn and nginx

When days are dark, friends are few, cash is low and we need to take our django sites and put them on a single server. I am assuming you have site up and running that is using django with nginx and gunicorn. Now we need to do a few modifications to get the new site […]

Categories
Database django MySQL

Going Live with Django, MySQL on Ubuntu and server going down

Ever got to deploy day only to have errors streaming in about the site not being able to be accesses. Most likely in your logs or error emails / alerts you get something like this: (2003, “Can’t connect to MySQL server on ‘127.0.0.1’ (111)”) What the hell does this mean, it means MySQL is down […]

Categories
django

Django displaying CheckboxSelectMultiple in columns with Bootstrap

The django-bootstrap3 package is used to show django forms with bootstrap. Most of the fields have their own bootstrap widgets except for: WIDGETS_NO_REQUIRED = ( AdminFileWidget, HiddenInput, FileInput, CheckboxInput, CheckboxSelectMultiple ) Unfortunately that makes the CheckboxSelectMultiple render as a single line of vertical checkboxes. Not making use of space that well. So how do we change […]