filmov
tv
Django Tutorial: Django Admin Interface Introduction

Показать описание
In this Django tutorial, we will explore the Django Admin interface. One of the coolest features in the Django framework is the admin site. The admin interface allows for authorized users to manage content in the Django project.
The interface is only designed to be used by the administrators of a website. This feature should not be used by the users of a website. If you want to allow your users the ability to change content then I suggest building a backend for the users that is more secure from the admin interface which allows for sensitive information to be accessed. We will build a user interface separate from the admin interface in our tutorial series.
How To Create A Superuser In Django
Before we can actually access the admin section we need to create a superuser. A superuser is a user who has all the permission allowed in Django so you would not want to create one for an average user of your site. The superuser is controlled by the Django's authentication system. The authentication system handles user accounts, groups, and permissions on your website. We will explore authentication system more in the future.
To create a superuser open your terminal and enter the following command. You will be prompted to answer a few questions that will allow you to login into the admin interface.
Username (leave blank to use 'tommy'): tommy
Password:
Password (again):
Superuser created successfully.
Access Django Admin Interface
To access the Django admin interface we need to run the development server. To run the development server run the following command in your terminal.
Performing system checks...
System check identified no issues (0 silenced).
July 15, 2016 - 19:10:25
Quit the server with CONTROL-C.
Conclusion
In this tutorial we created a superuser in our Django project and then we used those credentials to access the admin interface. If you have any questions about how to create a superuser or the admin interface leave a comment below.
The interface is only designed to be used by the administrators of a website. This feature should not be used by the users of a website. If you want to allow your users the ability to change content then I suggest building a backend for the users that is more secure from the admin interface which allows for sensitive information to be accessed. We will build a user interface separate from the admin interface in our tutorial series.
How To Create A Superuser In Django
Before we can actually access the admin section we need to create a superuser. A superuser is a user who has all the permission allowed in Django so you would not want to create one for an average user of your site. The superuser is controlled by the Django's authentication system. The authentication system handles user accounts, groups, and permissions on your website. We will explore authentication system more in the future.
To create a superuser open your terminal and enter the following command. You will be prompted to answer a few questions that will allow you to login into the admin interface.
Username (leave blank to use 'tommy'): tommy
Password:
Password (again):
Superuser created successfully.
Access Django Admin Interface
To access the Django admin interface we need to run the development server. To run the development server run the following command in your terminal.
Performing system checks...
System check identified no issues (0 silenced).
July 15, 2016 - 19:10:25
Quit the server with CONTROL-C.
Conclusion
In this tutorial we created a superuser in our Django project and then we used those credentials to access the admin interface. If you have any questions about how to create a superuser or the admin interface leave a comment below.