Django

Deploy Django to Openshift 3 Powered by MySQL and Gunicorn

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. Download oc clients from here So let's get started: Contents of this Post In the blog, we are going to discuss about how we can deploy production grade django server, using mysql as Database. We are also going…

Keep reading

Categories: Django, Openshift, MySQL, Gunicorn, Docker, technical-blogs

Boilerplate For Angular 1.X and Django(Powered by Webpack2, Docker, Yarn, DRF)

Simple and clean boilerplate for using django and angular 1.x togather, with basic structure comes built-in. Tech Stack Python3 Django 1.11.6, Django Rest Framework Webpack 2 JavaScript(ES6)/AngularJS 1.x Yarn Prerequisite Require Yarn. How to install Yarn: https://yarnpkg.com/lang/en/docs/install/ Require Docker if you want to use this boiler plate with docker. How to install Docker: https://docs.docker.com/engine/installation/ ** If you don't want docker, you can still use this boilerplate. Look here for details Setup Frontend Run make…

Keep reading

Categories: Django, AngularJs, BoilerPlate, technical-blogs

Using VS Code for Python/Django Development

VS Code is an editor developed by Microsoft. I have been using this editor for Python development for a few months now. Previously I have been using Pycharm Community Edition for development, but I had to switch to an editor which was less resource consuming than Pycharm, hence I found VS Code. It was initially suggested to my by one of my colleagues. My first impression was, what is this? Is it really usable? Is it as bad as Atom?(I have a dreadful experience with Atom, although Atom is…

Keep reading

Categories: Python, Django, VSCode, Virtual-Environment, IDE, technical-blogs

Play With Pillow

Who hasn't heard PIL? It's an image processing library made by python (Python Image Library). Pillow is an extension of it. So installing pillow is really easy: pip install pillow Now we are going to do some image processing cool stuff: First Load Image: from PIL import Image, ImageOps img = Image.open('image.png') Resize Image Suppose We want to resize an image and maintain its aspect ratio. Here we need to get the aspect ratio after resizing. Here is a snippet for it: def get_resize_image_size(image,…

Keep reading

Categories: image-processing, Python, pil, pillow, Django, technical-blogs

Python: Selenium with PhantomJs to capture Screenshots

PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. And Selenium is a portable software-testing framework for web applications. Selenium provides a record/playback tool for authoring tests without the need to learn a test scripting language (Selenium IDE) Using the combination of selenium and PhantomJs can give you a way to capture screenshots and use it in your choices. For that let's install PhantomJs in your computer. For Ubuntu/Debian…

Keep reading

Categories: Django, Selenium, PhantomJs, Python, technical-blogs