Looking online for answers to the question “how do I dynamically refresh content in the Django admin?” turns up roll-your-own JavaScript solutions, possibly with the help of jQuery. Those solutions were great back in grandad’s day, but nowadays all the cool kids are using HTMX!
Tag – Django
Multi-page Forms in Django
Multi-page, or multi-step, forms are a common way to manage complex user inputs. This technical post outlines the techniques we use to build them in Django.
How to keep all your websites in sync with scraping technology
Would you like to pull in the header and/or footer from a related but separate website for use on your own pages? Here's how.
Using HubSpot’s Custom CRM Cards Without an Integration
The marketing software company HubSpot offers a nifty feature called "custom CRM cards." The idea is that a HubSpot dashboard can send a GET request to an API that you maintain, retrieve some JSON-formatted information and render it in some "cards" alongside other data. One of our clients wished to use…
Migrate Away from cmsplugin-filer in a Few Easy Steps
Companion code for this post: https://github.com/ImaginaryLandscape/deprecate_cmsplugin_filer If you've been building projects using django CMS for any length of time, chances are you're familiar with Divio's cmsplugin-filer application which provided image, link, file, folder and video plugins for interacting with django-filer. And if you're here, chances are you're aware that cmsplugin-filer has now...
Upgrade Django 1.11 to 2.2 and django CMS 3.4 to 3.7
Through the use of the Poetry project, incremental changes, and a little luck, the Django 1.11 -> 2.2 and django CMS 3.4 -> 3.7 upgrade was a success, but not without some excessively harsh profanity.
Website Search using Django and PostgreSQL Trigrams
Over the years I've become increasingly wary of the word "easy" in software documentation. Pick a software project at random, and there's a good chance the documentation will lead off with something like "Booloogent makes the process of frobnifying your wakalixes easy!" And then you try to use the package...
Django shell_plus with Pandas, and Jupyter Notebook
The Django shell provides an environment where developers can interact with the database via Django's ORM. While the shell is great for basic interactions, it quickly becomes laborious to work in, be it due to manual imports, having to scroll through shell history to repeat commands, or working with / viewing queries returning more than, say, 20 records. These issues, and more, can be remedied by interacting with the ORM in Jupyter notebooks, using Pandas.
Guide to Ansible/NGINX/uWSGI/Django, Part 2: Getting uWSGI Working with NGINX and Django
In Part 1 of this post, I described the trials, tribulations and ultimate success of running Ansible to provision a cloud server, which we do often here at Imaginary Landscape. Part 2 concludes the post by describing the process for getting uWSGI working with NGINX and Django. When I first tested the...
Guide to Ansible/NGINX/uWSGI/Django, Part 1: Running the Ansible Scripts
Here at Imaginary Landscape, we are frequently tasked with spinning up new cloud servers for our clients. Once a new server is online, we usually follow up by provisioning it with useful software. To automate that process, we began using Ansible a few years ago, and have had a lot...
Continuous Integration and Deployment with Drone, Docker, Django, Gunicorn and Nginx - Part 3
Django Web Development, Django Web Framework, Integration and Deployment with Drone, Docker, Django, Gunicorn and Nginx
The case for a Django upgrade
It boils down to this. An upgrade costs money, sometimes a lot of money, but the result has no visible outcome. In fact, in many cases the only outcome is an assurance that you've reduced the probability of attack, intrusion, breach and related unpleasantness. By any measure, that's a tough...
Django Version Viewer Announcement
Django Verison Viewer, Django Plugin, Open source Django Plugin
Continuous Integration and Deployment with Drone, Docker, Django, Gunicorn and Nginx - Part 2
The Introduction This is the second part of a multi-part tutorial covering a simple(ish) setup of a continuous integration/deployment pipeline using Drone.io. Since Part 1, I’ve added a GitHub project outlining a simple Django application that you can use as a reference. In Part 2, we will be adding a publish step...
Continuous Integration and Deployment with Drone, Docker, Django, Gunicorn and Nginx - Part 1
Integration and Deployment with Drone, Docker, Django, Gunicorn and Nginx
Writing Functional Python
The recent buzz surrounding Functional Programming (FP for short) is well deserved. Languages like Haskell and Clojure in use by big name companies such as Barclays Captial, Atlassian, and Walmart have helped FP ideas gain a major foothold in industry. I am a Clojurist hobbyist who has been interested in FP for...
End User Focused Django Tutorials
Django is being used by corporations worldwide. Every day, Imaginary does its part to increase this footprint by deploying Django websites and applications to our clients. As a result, Django is being exposed to greater numbers of end users. I'm not talking end user developers. I'm talking Samantha in marketing...
How to Use Amazon S3 Storage for Select Apps
At Imaginary Landscape, we often have the need to add remote file storage capabilities for our clients. At first glance, this sounds easy enough: "pip install django-storages", add the right credentials, and boom, you're done! However, this was not the case for one particular situation we encountered. We didn't want...
Braintree Integration with Django
Braintree Integration in Django Introduction Much has been written about how to implement online payment using the services available from Braintree, but not much has been written about how to do it within a Django framework. Combining the two does not require any special contortions, but as Braintree’s own online...
Django Class-Based Views: The Basics
Class-based views are my favorite feature of Django, so there is an obvious bias when discussing function views and class-based views. I’ll throw my two cents in here and move on. I prefer the structure and predictability that class-based views provide. I recognize that there are many instances when a...
Django CMS Plugin Authenticated User Variations
Note: a companion app for this post can be found here: https://github.com/ImaginaryLandscape/cmsplugin-auth-content-example In a recent project using django CMS, we found ourselves in need of serving alternate plugin content to authenticated users. This is not the first time a request such as this has been made, and on past occasions...
A Python Solution for Making Custom PDFs from HTML
The client wanted to give their users the option of printing completed forms to a pdf file. They also wanted the pdf to be rendered with formatting and style that varied slightly from the online display of the completed form, and so desired a solution other than the browser’s own...
Introducing django-nocaptcha-recaptcha
This week, Google announced a radically new way of handling human detection with a revamped reCAPTCHA. This new iteration, called No CAPTCHA reCAPTCHA replaces the hard-to-read distorted text image transcription with a simple checkbox. We've never been big fans of CAPTCHA technology. It transfers the burdeon of proof from the server to...