How to add line numbers and filename when printing in Python
We all do it. Yes we all use print for debugging.
Should we do it? Maybe.
Should we feel guilty about it? No!
We all do it. Yes we all use print for debugging.
Should we do it? Maybe.
Should we feel guilty about it? No!
Django-Q is a native Django task-queue and scheduler. I like it because it can use your database as a data store rather than having to branch out to other tools like Redis. And while Django-Q can handle Redis – the… Read More »Installing a simple Queuing tool in Django
I was building a form today in django-unicorn and wanted to implement a radio button. This is how you do it: This will render to: The main trick for rendering radio buttons is to write unicorn:model=”new_event_frequency” in each radio html… Read More »Adding a radio button using django-unicorn
For those you run pipenv install django-unicorn And you get a dependency resolution conflict relating to orjson like this: Then you are probably running a 32 bit version of python. orjson needs a 64 bit version. To fix this I… Read More »Resolving orjson dependency conflict when installing django-unicorn in Windows
Sometimes we need to create a secret key, but we don’t want to go to a website and generate it. While I’m sure those websites are generally good guys – it only takes one bad guy stealing secret keys and… Read More »Create a Django Secret Key in your Terminal
Say you have a model that handles images like this: To get it showing in your template you need these settings (here all files go into the media directory): THEN in your main urls.py file you need this line so… Read More »Displaying uploaded images in Django
Recently I had the following model that held a list of countries: And my admin file was like this: Problem was in the Django Admin the incorrect plural was rendered: Now as a person of style and class it is… Read More »Adjusting the Plural of a Model in Django Admin
I was recently interviewed by Nick Janetakis from the Running in Production podcast to discuss the software stack I’m using for HorseRecords.info. Check it out here: HorseRecords interviewed by Running in Production 6:11 – About 60ish users signed up about a… Read More »A SaaS stack using Django
We’ve all wanted to do it – to just have a table sortable on the front end. You click on the column and the table sorts to that column. We don’t want to write heaps of code on the back… Read More »Making HTML tables sortable without backend shenanigans
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