[Django Rest Framework] OperationalError at /api/ no such table: django_session

If you are creating a API using Django Framework than you generally encounter this issue regarding django_session.

Error: OperationalError at /api/ no such table: django_session

If you want to follow along this blog and want to know how this error has occurred than visit the link below to setup your first Django Rest Framework:

Meanwhile this is a minor error caused due to the migration of data tables. If you are running your django application for the first time without running migrations than the api will not find any django_session. Therefore do the following to get rid of this error:

python manage.py makemigrations
python manage.py migrate

After running the migration and applying them, finally run your server with the following command:

python manage.py runserver

Now you will not be facing any error and can see the list of options or URLs that your API has exposed.

To start your web development with Django Framework, do follow our Django Tutorial for the Beginners form the link below: