• Book image
Book Image

Django RESTful Web Services

Book Image

Django RESTful Web Services

Overview of this book

Django is a Python web framework that makes the web development process very easy. It reduces the amount of trivial code, which simplifies the creation of web applications and results in faster development. It is very powerful and a great choice for creating RESTful web services. If you are a Python developer and want to efficiently create RESTful web services with Django for your apps, then this is the right book for you. The book starts off by showing you how to install and configure the environment, required software, and tools to create RESTful web services with Django and the Django REST framework. We then move on to working with advanced serialization and migrations to interact with SQLite and non-SQL data sources. We will use the features included in the Django REST framework to improve our simple web service. Further, we will create API views to process diverse HTTP requests on objects, go through relationships and hyperlinked API management, and then discover the necessary steps to include security and permissions related to data models and APIs. We will also apply throttling rules and run tests to check that versioning works as expected. Next we will run automated tests to improve code coverage. By the end of the book, you will be able to build RESTful web services with Django.
Table of Contents (16 chapters)
Free Chapter
Title Page
About the Author

Test your knowledge

Let's see whether you can answer the following questions correctly:

  1. After we activate a virtual environment, all the packages we install with pip are available:
    1. For all the virtual environments available in the computer or device that is running Python
    2. Only for the activated virtual environment
    3. For all the virtual environments created by the current user
  2. HTTPie is a:
    1. Command-line HTTP server written in Python that makes it easy to create a RESTful Web Server

    2. Command-line utility that allows us to run queries against an SQLite database
    3. Command-line HTTP client written in Python that makes it easy to compose and send HTTP requests
  3. Which of the following commands creates a new app named books in Django?
    1. django startapp books
    2. python django.py startapp books
    3. python manage.py startapp books
  4. In Django, a subclass of which of the following classes represents a Django application and its configuration?
    1.  django.apps.AppConfig
    2. django.application.configuration
    3. django.config.App
  5. Which of the following strings must be added to the INSTALLED_APPS string list in the settings.py file to enable Django REST framework?
    1. 'rest_framework'
    2. 'django_rest_framework'
    3. 'Django_REST_framework'


The rights answers are included in the Appendix, Solutions.


Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Your notes and bookmarks