in the app specific files:
models.py
--------
from django.db import models
class Notes(models.Model):
title = models.CharField(max_length=200)
text = models.TextField()
created = models.DateTimeField(auto_now_add=True)
python manage.py makemigrations
python manage.py migrate
admin.py
----
from django.contrib import admin
from . import models
class NotesAdmin(admin.ModelAdmin):
list_display = ('title',)
admin.site.register(model.Notes,NotesAdmin)
No comments:
Post a Comment