Posts Tagged with Django
24 Apr 2019, 20:36
The Problem When you are using Openshift, you will be using routes to expose a route from a service. Let’s say you want to expose a path in example.com/dummy. When you do that for a django application(without any reverse proxy server), it usually becomes a problem, because the sub path does not work well with Django’s urls.
10 Feb 2019, 00:38
Suppose you are dealing with a poorly written API, which returns different type of objects at different scenarios. For example, sometimes it returns a string(ie. abcd), sometimes it returns a list(ie. [1,2,3,4]), or maybe None. Now, you are suppose to save that data, which you can’t predict. As you can’t predict the data type of object, you can’t design your Django Model accordingly.
26 Jan 2019, 14:58
Linked list is a data structure where each object has points to next. In django, linked list can provide an interesting solution when it comes to custom ordering/grouping issues.
Lets think of an example like this: you are making a blog site, and you have made a Post Model like this:
03 Jan 2019, 02:00
Every now and then I see some questions pop up in stackoverflow with title:
ValueError: Related model ‘app.User’ cannot be resolved
This is a very common issue and pops up when the user tries to run the migration. So, lets talk more about what is this problem and how can we solve it.
22 Dec 2018, 02:00
“I’m not a great programmer; I’m just a good programmer with great habits.” ― Kent Beck
Test Driven Development - in short TDD is a practice where you write the tests first then the actual code. It makes the code less vulnerable and it makes a testable software rather than writing the software, then test it.
29 Apr 2018, 10:00
Simple and clean boilerplate for using django and angular 1.x togather, with basic structure comes built-in.
24 Feb 2018, 13:32
If you want to use Openshift for deploying Django, you can follow this post and simply do that. You don’t need to learn Kubernetes. We will use docker file only. No other fancy stuff.
Also, before starting, I am also hoping you are little bit familiar with Openshift 3 and oc tools.
24 Feb 2017, 18:52
This is no longer maintained. Use it at your own risk.
Django Encrypt File is a simple Library which can be used to encrypt uploaded files and store them.
Installation Use pip to install it:
pip install djangoencryptfile Or
pip install https://github.com/ruddra/django-encrypt-file/tarball/0.7 Basic Usage from djangoencryptfile import EncryptionService from django.
14 Nov 2016, 15:43
In previous two posts, we have deployed Django with Postgres, Nginx, now its time to do some async stuff using Celery. In this post, I will do the magic tricks first, explain them later.
Add Celery to Django To add celery, we need make a container for celery. We can re-use the Dockerfile of django for making celery’s container like this:
02 Nov 2016, 17:24
This is more of a follow up post of my previous blog.
Before I start, I am assuming you have successfully deployed django using docker & nginx, but having some problems serving static files.
Steps No worries, its easy. Just follow these steps:
1. In your django settings.py file, add static file directory i.