models.py
python_backend/curriculum/django/blog/models.py
from django.db import models
class Post(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
Articles liés
apps.py
apps.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/apps.py).
Lire l'article →0001_initial.py
0001_initial.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/migrations/0001_initial.py).
Lire l'article →urls.py
urls.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/urls.py).
Lire l'article →views.py
views.py — python source code from the python backend learning materials (python_backend/curriculum/django/blog/views.py).
Lire l'article →manage.py
manage.py — python source code from the python backend learning materials (python_backend/curriculum/django/manage.py).
Lire l'article →asgi.py
asgi.py — python source code from the python backend learning materials (python_backend/curriculum/django/myproject/asgi.py).
Lire l'article →