Deploy Django, Gunicorn, NGINX, Postgresql using Docker

This post mainly based on this blog: https://docs.docker.com/compose/django/. I will be extending this post by serving django+gunicorn using Nginx, also I will using Postgresql docker container to use it as database. Lets not waste time and go to the following steps. 1. Let's make an empty directory named myproject and add another folder inside name it src. src should contain the django project. For testing purpose lets put a simple django project inside named mydjango. 2. Let's create a subdirectory inside myproject and name…

Keep reading

Make OSX Notifications From RSS Feed Using Python

Today we are going to see how make OSX notifications from RSS Feed of any website using Python. So first of all, let us see how to make a simple notification. We are going to use AppleScript for this. Go to terminal and Type: >>osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"' We shall see a notification popping up in right up corner like this: Now, we will use this command to pop up notifications using python from rss feeds. Now, we are…

Keep reading

Make .CSV file using MySQL and Python

In this blog, I am going to show how to develop an application by which we can make .csv files from MySQL database using Python. Now, let us start by getting data from Database. Lets say we have a DB names csv_test and it contains a table named test with fields id and name, and for testing purpose let us have some values inserted into it like this: +------+--------+ | id | name | +------+--------+ | 1 | test_1 | | 2 | test_2 | | 3 | test_3 | +------+--------+ Now, to get all…

Keep reading

Django 1.7 + Scrapy

Today I am going to share how to use Scrapy and Django together to crawl to a website and store scrapped data to Database using Django. First, let us build a Django application using the following commands. pip install django==1.7 django-admin.py startproject example_project cd example_project Inside the example_project directory, we will create a django app named app: python manage.py startapp app Then, we will update the models.py like this: from django.db import models class ExampleDotCom(models.Model): title = models.CharField(max_…

Keep reading

Make a Blog using Django Part 2

From previous post, you have configured and ran django, also added admin site to the django. To view the working source of this tutorial, check here at: https://github.com/ruddra/myblog Now click on the myblog section and click add to add new blog, which will look like this: You can create new tags using Tags section of the admin page or clicking the (+) button right beside the Tags section on the new blog creation page, marked with blue circle in the previous image. After successfully adding a new…

Keep reading