blog working
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
|
||||
from .models import Blog
|
||||
|
||||
admin.site.register(Blog)
|
||||
|
24
blog/migrations/0001_initial.py
Normal file
24
blog/migrations/0001_initial.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Generated by Django 3.0.3 on 2020-03-08 20:11
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Blog',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('pubdate', models.DateTimeField()),
|
||||
('body', models.TextField(max_length=1000)),
|
||||
('image', models.ImageField(upload_to='images/')),
|
||||
],
|
||||
),
|
||||
]
|
@ -1,3 +1,11 @@
|
||||
from django.db import models
|
||||
import datetime
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Blog(models.Model):
|
||||
title = models.CharField(max_length=200)
|
||||
pubdate = models.DateTimeField()
|
||||
body = models.TextField(max_length=1000)
|
||||
image = models.ImageField(upload_to='images/')
|
||||
|
Reference in New Issue
Block a user