Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.

Setting up the admin interface


Now that a database is attached to the project, we can activate the administration interface of Django in it. The process is really simple at this point; you just need to uncomment a couple of lines of code in the project settings file and the main URL manager.

First, activate the Django application django.contrib.admin in the Installed_Apps section of the settings file:

Second, go to the urls.py file and uncomment the section that imports the admin class and that enables the admin's discovery of the models inside the project. Besides this, it is also necessary that we uncomment the last line of the URL pattern that manages the /admin/ path:

Now the Django administration application is activated in the project. If the operation is successful, you will be presented with the admin login page. After launching the application, navigate to the /admin/ page:

Insert the credentials created during the database setup to access the administration section:

Now we have a fully...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Tools for Visual Studio
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon