zoukankan      html  css  js  c++  java
  • django之创建第9个项目-管理后台admin

    django之创建第9个项目-管理后台admin配置



    1、配置setting文件
    INSTALLED_APPS = (
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        # Uncomment the next line to enable the admin:
        'django.contrib.admin',#取消掉注释
        # Uncomment the next line to enable admin documentation:
        # 'django.contrib.admindocs',
        'blog',
    )


    2、配置C:djangowebhelloworldhelloworldurls文件
    # -*- coding: UTF-8 -*-
    from django.conf.urls import patterns, include, url

    # Uncomment the next two lines to enable the admin:
    from django.contrib import admin
    admin.autodiscover()
    urlpatterns = patterns('blog.views',
        # Uncomment the admin/doc line below to enable admin documentation:
        url(r'^admin/doc/', include('django.contrib.admindocs.urls')),#取消掉注释

        # Uncomment the next line to enable the admin:
        url(r'^admin/', include(admin.site.urls)),#取消掉注释
        #url(r'^$', 'blog.views.index'),
        url(r'^blog/', include("blog.urls")),#浏览器一旦访问blog就定位到blog.urls文件下的url地址
    )

    3、创建超级用户管理员
    c:djangowebhelloworld>manage.py createsuperuser
    Username (leave blank to use 'administrator'): xiaodeng#创建用户名
    Email address:#不用创建则直接回车
    Password:#输入密码,这里输入密码之后是看不到的,我默认输出了6个1
    Password (again):
    Superuser created successfully.

    c:djangowebhelloworld>


    4、启动服务器,c:djangowebhelloworld>manage.py runserver
    5、打开网页,http://127.0.0.1:8000/admin/
    6、登录

    百度云盘:django之创建第9个项目-管理后台admin

  • 相关阅读:
    asp.net 通过Global.asax 定时执行web应用中的的程序
    asp.net 小东西,备忘
    Running Ajax.NET Professional (AjaxPro) under ASP .NET MVC(转)
    Silverlight仿Flash换肤一种简单实现方法
    [转]silverlight中的socket编程注意事项
    四月雨带来五月花
    我的六月
    我的夜
    我的七月
    我们站在毕业的面前 这里是不是成熟的分界线
  • 原文地址:https://www.cnblogs.com/dengyg200891/p/5355913.html
Copyright © 2011-2022 走看看