Skip to content

Content Tagged "django"

Page 1 of 2

Content Tagged "django"

Send JSON Graph Data from Django

February 3, 2019Categories: Software, Tutorial
I'm trying to write a Django application to deal with my finances. I've got a nice page listing various transactions, but I thought it'd be nice to have a graph too, to see where I actually am on the spot. To do this, I'll need two components: A JSON sender from Django A receiver and renderer on the…

Build a Django Docker Image with Cx-Oracle

July 17, 2018Categories: Software, Tutorial
TL;DR: Don't use alpine images. There's a glibc issue . We added a cx-oracle dependency to one of our django apps. As the previous image was just an alpine basic (python) image we needed to put in place a process to build the new image. Initially, I've tried to use the same alpine image (oh…

DRF: What is 'source' in Fields?

September 30, 2017Categories: Software, Tutorial
For a couple of days I've been trying to de-serialise a JSON to a model. My problem is the model and the JSON have different fields, mainly to keep the model pythonic and independent of a specific JSON source. So... I've been trying to use the source parameter for each Field in my serialiser to…

Timestamp to DateTime Serializer Field for DRF

September 29, 2017Categories: Software, Tutorial
I'm currently trying to deserialize JSON data to a Django model. This is quite straight forward for most numeric fields, but I have a DateTime field which is stored as a timestamp in the original JSON. At first, I thought I should read the timestamp as an integer and convert it through post…

Save Pandas DataFrame as Django Model

August 7, 2017Categories: Software, Tutorial
TL;DR: use bulk_upload coupled with a comprehension to speed up loading. Initially, I started to convert the data frame to a Model object row by row and save it. While easy, it's also arguably the slowest method to load records, because the save() call performs a commit . Then I looked up…

Load Templates with Pebble

July 7, 2017Categories: Software, Tutorial
Pebble is a templating engine. It looks particularly familiar to me because I have been using Django . You have access to blocks, include/import features, loops etc. This post is a simple exercise in loading some templates. Prerequisites I've been using Eclipse IDE, but you can use whatever you…

Change a django password manually

May 4, 2016Category: Software
The other day I've been confronted with a strange situation: I forgot the admin password for a django application. I was playing with installing my own pypi repository, I've configured and deployed a test application and, after a couple of weeks, I forgot the password. I tried several times bu I…

Python classes to generate CSS

February 4, 2015Categories: Idea, Software
A while ago I got fed up with CSS and its cumbersomeness. As my poison of choice is python , I was thinking it would be quite useful to have a bunch of classes capable of generating CSS automatically in python. One could have a base class, a set of properties, a name-value dictionary and a way to…

Formless Step in FormWizard

May 7, 2014Category: Software
Sometimes you'd need to show a purely informational page as part of a FormWizard. As far as I could see, there are two solutions to the problem: If the info is something like a summary, you have it available in the "success" page (the one after the wizard is finished) Alternatively, you can make it…

Create Data Once in a FormWizard

May 6, 2014Category: Software
At one of the sites I'm building I need to walk users through a registration process: Select a supported tool Generate an ID Create a configuration based on the previous two steps To do this, I chose to use a FormWizard with three steps, one for each of the above. The problem then becomes to…
Next

All tags