BCS Create Django Admin


To create and administration site for you models you must first establish a super user by issuing the following command in the project directory.
[codesyntax lang=”bash”]

python3 manage.py createsuperuser

[/codesyntax]
The results of issuing the command is as follows.

Superuser created successfully is the desired result.
Modify the admin.py in your application directory to reflect the following.
[codesyntax lang=”python”]

from django.contrib import admin
from .models import Post
# Register your models here.
admin.site.register(Post)

[/codesyntax]
Start the server and bring up the administration web site.
[codesyntax lang=”bash”]

python3 manage.py runserver

[/codesyntax]
In the browser issue the following command.
[codesyntax lang=”text”]

http://localhost:8000/admin

[/codesyntax]
When prompted to login use the credentials created when you established the superuser.
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.

Leave a Reply

Your email address will not be published. Required fields are marked *