urls.py

from django.contribimport admin

admin.autodiscover()

urlpatterns = [

    url(r'^admin/', include(admin.site.urls)),

]


创建密码

python manage.py syncdb

填入用户名,密码


然后去vi blog/admin,py


from django.contrib import admin

from blog.models import Host

# Register your models here.

admin.site.register(Host)


然后访问页面

http://121.43.110.89:8080/admin


wKiom1YfEH-RWmETAADpBgtSW00390.jpg




用add来添加数据