Skip to content

Django Admin

Pierre Wan-Fat edited this page May 8, 2020 · 1 revision

Django comes with Django Admin, a wonderful tool you can use to quickly interact with your database. Its graphical interface can be easily configured with Python code.

To configure the admin site for an app, create or open the file admin.py located at the root of your app and put the following code in it:

from django.contrib import admin

from .models import MyModel

admin.site.register(MyModel)

Then, launch the backend (python manage.py runserver), go to http://localhost:8000/admin, enter the credentials of a staff member… and enjoy your free admin panel. It is sometimes more convenient to use than Django Rest Framework's API.

For more details, please have a look at the tutorial as well as the reference.