xadmin :
导入xadmin
pip install xadmin
路由设置:
import xadmin urlpatterns = [
url(r'^xadmin/', xadmin.site.urls),
]
表注册:
import xadmin
from models import UserMessage class UserMessageF(object):
pass xadmin.site.register(UserMessage,UserMessageF)
admin:
路由设置:
from django.conf.urls import url
from django.contrib import admin urlpatterns = [
url(r'^admin/', admin.site.urls),
]
表注册:
from django.contrib import admin # Register your models here.
from models import UserMessage class UserMessageAdmin(admin.ModelAdmin):
pass admin.site.register(UserMessage,UserMessageAdmin)