I try to register model with the admin site from view.py, so model's admin interface would appear after I go to matching url. But when I go to matching url only model's name without reference appears, models instances doesn't display. It's necessary to register model from views.
models.py
from django.db import models
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
views.py
from django.contrib import admin
from django.shortcuts import redirect
from polls.models import Poll
def index(request):
admin.site.register(Poll)
return redirect('/admin')