Hello World I am back! I know it took *a bit* long resuming this blog as I got pretty busy in other stuff related to my work. Alright so this post is about writing applications in Go, a programming language create at Google by Ken Thompson(“K” from famous K&R) and the creator of Unix and Rob Pike. I had not thought of learning another programming but there a few reasons I go for the Go Go is a minimal language like Python. Since it was developed by Googlers who are also Python lovers, they came up a language which is simple to write like Python but more efficient like…
-
-
Develop database driven applications in Python with Peewee
It is not uncommon that most of the applications these days are interacting with database these days. Specially with RDBMS based engines( DB engines that support SQL). Like any other languages Python also provides native and 3rd party libraries to interact with database. Normally you have to write SQL queries for CRUD operations. That’s OK but at times it happens that things get messy: The Big Boss decided to move from MySQL to.. MSSQL and you have no choice but to nod at him and making changes in your queries compatible with other Db Engine. You gotta make multiple queries just to retrieve a single piece of info from the…
-
How to automate your deployment and SSH activities with Fabric
It is not uncommon for developers to interact with remote servers. Beside FTP clients many use terminals or consoles to carry out different tasks. SSH is usually used to connect with remote servers and execute different commands; from running git to initiating a web or db server, almost every thing can be done by using an SSH Client. Recently I came across an awesome tool called Fabric. It’s a Python based tool that automates your command line activities. What is Fabric? From official website: Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. It provides a…
-
Develop your first web application in Django 1.10 – Part 5
In last post I talked about using forms, in this last part of the series I am going to discuss about Django Admin and how can this powerful feature be used for records management. Django Admin Before we get into coding, we need to create a superuser(Admin). Open Terminal, go in your project’s root folder where manage.py resides and run the following command: Adnans-MacBook-Pro:ohbugztracker AdnanAhmad$ python manage.py createsuperuser Username (leave blank to use 'adnanahmad'): kadnan Email address: mymail@mail.com Password: Password (again): Superuser created successfully. Adnans-MacBook-Pro:ohbugztracker AdnanAhmad$ The interactive tool will ask a series of things. Once it’s over, check your settings.py file that whether admin app is available in INSTALLED_APPS or not. It…
-
Develop your first web application in Django 1.10 – Part 4
Learn how to use Django Forms to submit user input data into Database. In previous post I discussed about Db interaction with a Django application and how to pass data in a html view and display it. Now we will move onto next step and will learn how to use HTML forms to store data in database. Django Forms The form I am going to deal is.. yeah, the project form so that I can submit project details. I will create a new folder under tracker/templates and will call it project. The reason to do is that I want to view file separate w.r.t modules. In the file I am going…
-
Develop your first web application in Django 1.10 – Part 3
In part 2 you learnt how to use templates and views in Django. In this part I am going to discuss how to integrate database with Django app for pulling and storing data. Before we get into it, there are few things that need to be done before we start playing with data and database. Setting up database In order to make our application able to interact with a database, we need to setup the connection of it. Django can connect many RDBMS based db engines. Since Django rely on an ORM, you don’t need to worry about underlying DBMs being used for your app as you can always switch to…
-
Develop your first web application in Django 1.10 – Part 2
First of all I am sorry for taking so much time to make a new post due to home shifting and travelling. In previous post you learnt how you can integrate HTML in Django application. Now we will go a step further and see how you can create a layout and how to extend it with inner HTML pages. Creating Site Layout Earlier I had just dumped the HTML of home page in master.html and then used extends to call it in inner home page. Now it’s time to make the layout file available for all other pages. Almost every website these days follow a certain theme; it consists of a header, footer,…
-
Develop your first web application in Django 1.10 – Part 1
In part 0 I discussed initial installation and configuration. Now it’s time to get into the code. The things I am going to do in this post are: Understanding the concept of Project and Apps in Django world. Creation of App. Using templates to create home page. Projects vs Apps Django offers a very useful modular approach of creating web applications. Unlike other frameworks like PHP Laravel or Rails, Django let you create multiple apps under a project. This idea might look alien to those coming from the background of other frameworks where a project == app and you need to rely on routes etc to divide functionality. Let me take…
-
Develop your first web application in Django 1.10 – Part 0
Django is a very popular and powerful web framework to make small to large scale web application in Python language. In this series I am going to make a simple issue tracking or bug tracking system in Django 1.10. OhBugz The application I am going to make is named as OhBugz. It is a simple issue tracking application for a single user which helps to track project related issues. It is not going to make JIRA guys sleepless but good enough to learn how to make a web application in Django. Some of the initial screens are: Installation Since Django is a Python framework so it’s quite obvious…
-
Write your first web crawler in Python Scrapy
The scraping series will not get completed without discussing Scrapy. In this post I am going to write a web crawler that will scrape data from OLX’s Electronics & Appliances’ items. Before I get into the code, how about having a brief intro of Scrapy itself? What is Scrapy? From Wikipedia: Scrapy (/ˈskreɪpi/ skray-pee)[1] is a free and open source web crawling framework, written in Python. Originally designed for web scraping, it can also be used to extract data using APIs or as a general purpose web crawler.[2] It is currently maintained by Scrapinghub Ltd., a web scraping development and services company. A web crawling framework which has done all…