[PYTHON] Development of WEB application using Django [Add data from management screen]

Try using the management screen

Now that the application can be used on the management screen, let's actually add data. From adding Post to data entry screen データの追加.png Here, the Title, Published, Image, and Body of the Post class defined in models.py are displayed. Enter in each and add data. This time, two data are added for testing. 追加したデータ.png Two data have been saved. Next, since the name of the additional data is "Post object", let's display the Title.

models.py


class Post(models.Model):
    title = models.CharField(max_length=100)
    published = models.DateTimeField()
    image = models.ImageField(upload_to='media/')
    body = models.TextField()

    def __str__(self):
        return self.title #Display Title on the management screen.

Add the program to the Post class in models.py. Titleを表示.png The Title is now displayed safely.

Recommended Posts

Development of WEB application using Django [Add data from management screen]
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]
WEB application development using django-Development 1-
DJango memo: From the beginning (using the management screen) my addictive point
WEB application development using django-Development environment construction-
[Python] Web application from 0! Hands-on (4) -Data molding-
Application development using SQLite with Django (PTVS)
How to build an application from the cloud using the Django web framework
Try using django-import-export to add csv data to django
(Python) Try to develop a web application using Django
Web application using Bottle (1)
Create a shogi game record management application using Django 5 ~ Pass DB data to Template ~
View the contents of the queue using the RabbitMQ Management Web API
DJango Memo: From the beginning (more edits to the management screen)
Web application development with Flask
Web application creation with Django
About data management of anvil-app-server
A story about everything from data collection to AI development and Web application release in Python (3. AI development)
Studying web scraping for the purpose of extracting data from Filmarks # 2
[Django] Correct the plural form of the model name on the management screen
Django development using virtualenv Procedures from virtual environment construction to new project / new application creation and initial settings
Creating a web application using Flask ②
Web application development memo in python
Build a web application with Django
Creating a web application using Flask ①
Recommendation of data analysis using MessagePack
Creating a web application using Flask ③
Get data from Twitter using Tweepy
Creating a web application using Flask ④
Application development using Azure Machine Learning
Try using the Python web framework Django (1)-From installation to server startup
Try to get the road surface condition using big data of road surface management
Development and deployment of REST API in Python using Falcon Web Framework
Easy-to-understand explanation of Python Web application (Django) even for beginners (2) [Project creation]
DJango memo: From the beginning (editing the management screen) There is a mystery
Easy-to-understand explanation of Python Web application (Django) even for beginners (1) [Environment construction]