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
用add来添加数据
时间: 2024-11-09 03:47:17