Install Django REST Framework on Ubuntu

django dashboard

Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: The Web browsable API is a huge usability win for your developers. Authentication policies including packages for OAuth1a and OAuth2. Serialization that supports both ORM and non-ORM data sources. Customizable all the way … Read more

Solved: DisallowedHost – Invalid HTTP_HOST header

This error is related to “Installing Django and Django-REST Framework on ubuntu” , if you have Django application / server running on local ubuntu host as, Then this server is started with binding to your local loopback IP address and default port as, Now, when you decide to use your IP address instead of local … Read more

Developing first REST API using Django Rest Framework ( DRF )

This post is in continuation with our previous post “Installing Django and Django-REST Framework on Ubuntu for developing REST API’s” which setup the development environment required to start developing rest API. The final step in setting up your virtual environment is to activate it: Now, we need to install “django” and “django rest framework” using … Read more

How to set / change the timezone in Django ?

If you have followed to create your first django project “Starting webserver using your first simple Django project” , the default timezone “TIME_ZONE” argument is set to “UTC” as we can see in “my_django_project/” Now, if you want to change the Time zone check the corresponding “TZ Database name” string from and modify “TIME_ZONE”, … Read more

How to solve Django Bad Request 400 error ?

When you tries to do http post with a JSON data / payload to your Django REST Framework ( DRF ) based server, sometimes you may get the “Bad Request” error with http code 400 as below, When we checked what is the meaning of this error from Django documentation, it is defined as, “The … Read more

How to define different urlpatterns in for Django

As we have seen in our previous post “Developing REST API using functions in DRF application views” we defined two URL’s, => example : The first URL, “” is mapped with view in with urlpattern and in as function “users” as, The second URL, , where 2 is the … Read more

What is routers in Django REST Framework ?

As we have seen in our previous post “Developing REST API using functions in DRF application views” , we were able to do http POST with the data and GET the same data to view in JSON format. Also, we tried to understand, how urlpatterns from are used to distingush different URL’s and also … Read more

How to add Model to Django admin dashboard


By default when you login to admin dashboard, you will only see “Authentication and Authorisation ” options which allows you to create Groups and Users.. like below Now, as we have written in “Writing first model for your Django App” if we want to make sure the Model “Question” from polls app, i.e. polls/ … Read more