[PYTHON] WEB application development using Django [Admin screen creation]

Continued from model definition Check the Admin screen

Check the Django admin screen. Until now, I had opened http://127.0.0.1:8000/posts/, but I changed the posts part to admin and [http If you open http://127.0.0.1:8000/admin/, you can see the screen below. In this state, you cannot log in yet, so create an account next. admin.png

Create Admin account

At the command prompt, do the following:

$ python3.6 manage.py createsuperuser

username(leave blank to use 'kazunari'): (Enter your favorite user name)
mail address: ************@gmail.com
Password: 
Password (again): 
Superuser created successfully.

Enter your user name, email address, and password, and then enter your password again to complete the creation.

Login to Admin page

If you log in using the account you registered earlier on the Admin screen, the following management screen will be displayed. login.png

Display the application on the management screen

Display the created application (Posts) on the management screen. Add to admin.py in posts> template.

admin.py


from django.contrib import admin
from .models import Post #Added line

admin.site.register(Post) #Added line

Import the Post class from models.py. Then, write the program to be added to the Admin screen.

By doing so, you will be able to access the posts function from the management screen and add, edit, or delete data. アプリケーション表示.png

Recommended Posts

WEB application development using Django [Admin screen creation]
WEB application development using Django [Django startup]
WEB application development using Django [Application addition]
WEB application development using Django [Model definition]
WEB application development using Django [Initial settings]
WEB application development using Django [Request processing]
WEB application development using Django [Template addition]
Development of WEB application using Django [Add data from management screen]
WEB application development using django-Development 1-
Web application creation with Django
WEB application development using django-Development environment construction-
Application development using SQLite with Django (PTVS)
Until Django application creation by terminal (development environment)
Web application using Bottle (1)
(Python) Try to develop a web application using Django
Web application development with Flask
Django admin screen list_filter customization
Web App Development Practice: Create a Shift Creation Page with Django! (Experiment on admin page)
Django admin screen reverse lookup memo
Creating a web application using Flask ②
Web application development memo in python
Build a web application with Django
Creating a web application using Flask ①
Django admin screen customization first step
Creating a web application using Flask ③
Creating a web application using Flask ④
Application development using Azure Machine Learning
Web App Development Practice: Create a Shift Creation Page with Django! (Shift creation page)
Django development using virtualenv Procedures from virtual environment construction to new project / new application creation and initial settings
Web App Development Practice: Create a Shift Creation Page with Django! (Introduction)
Easy-to-understand explanation of Python Web application (Django) even for beginners (2) [Project creation]
"Trash classification by image!" App creation diary day3 ~ Web application with Django ~
Web application development in Go language_Hands-on day 1
About Cloud run + Firebase development [Web application development]
How to build an application from the cloud using the Django web framework
I made a WEB application with Django
Easy-to-understand explanation of Python Web application (Django) even for beginners (3) [Application creation / DB setting]
Try creating a web application with Vue.js and Django (Mac)-(1) Environment construction, application creation
Web App Development Practice: Create a Shift Creation Page with Django! (Write a base template)
Web App Development Practice: Create a Shift Creation Page with Django! (Authentication system processing)
[Day 4] Application creation
django table creation
First Django development
Build a Django development environment using pyenv-virtualenv on Mac
Django tutorial (blog application creation) ② --model creation, management site preparation
Web application made with Python3.4 + Django (Part.1 Environment construction)
Tech-Circle Let's start application development using machine learning (self-study)
Prepare Django development environment using homebrew on MacOSX Mavericks (10.9)
Web App Development Practice: Create a Shift Creation Page with Django! (Design of database model)