• Create your first REST API in Django Rest Framework
    A step by step guide creating APIs in Django Rest Framework

    In this post, I am going to talk about Django Rest Framework or DRF. DRF is used to create RESTful APIs in Django which later could be consumed by various apps; mobile, web, desktop, etc. We will be discussing how to install DRF on your machine and then will be writing our APIs for a system. Before we discuss DRF, let’s talk a bit about REST itself. What is Rest From Wikipedia Representational state transfer (REST) is a software architectural style that defines a set of constraints to be used for creating Web services. Web services that conform to the REST architectural style, called RESTful Web services, provide interoperability between…

  • 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 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…