Complete Python Developer In 2020: Zero To Mastery Herunterladen [ SAFE | STRATEGY ]

A useful blog needs more than just text. It needs titles, dates, and rich content. Let's define the database structure in blog/models.py .

python manage.py runserver

Logic, loops, and data structures.

INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', # Our custom app 'blog', ] A useful blog needs more than just text

A downloadable reference guide covering Python types, loops, functions, and advanced modules . # Our custom app 'blog'

class Post(models.Model): title = models.CharField(max_length=200) content = models.TextField() published_date = models.DateTimeField(auto_now_add=True) author = models.ForeignKey(User, on_delete=models.CASCADE) A useful blog needs more than just text

# blog/models.py from django.db import models from django.contrib.auth.models import User

Leave a Reply