qileilove

          blog已經轉移至github,大家請訪問 http://qaseven.github.io/

          Python + Django配置后臺管理系統

           1. 建立project
            django-admin.py startproject newproject
            完成上個步驟后,可發現在newproject文件夾下生成了:一個名為newproject的文件夾,一個manage.py文件。
            newproject文件夾上又包含了4個文件:
            __init__.py
            setting.py
            urls.py
            wsgi.py
            至此project建立完畢!
            2. 修改文件
          #vim urls.py
          from django.conf.urls.defaults import patterns, include, url
          # Uncomment the next two lines to enable the admin:
          from django.contrib import admin
          admin.autodiscover()
          urlpatterns = patterns('',
          # Examples:
          # url(r'^$', 'csvt01.views.home', name='home'),
          # url(r'^csvt01/', include('csvt01.foo.urls')),
          # 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)),
          )
            去掉標紅位置的#
            #vim setting
            INSTALLED_APPS中去掉‘django.contrib.admin’這行的注釋
            另外配置數據庫
            3.創建數據庫表
            #python manage.py syncdb
            按提示輸入賬號密碼即可
            4.開啟測試服務
            #python manage.py runserver

          posted on 2014-10-30 11:33 順其自然EVO 閱讀(1160) 評論(0)  編輯  收藏 所屬分類: 測試學習專欄

          <2014年10月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          導航

          統計

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 乐都县| 台江县| 梁河县| 康乐县| 临夏市| 蕉岭县| 梨树县| 区。| 岚皋县| 成都市| 洪泽县| 谷城县| 台北市| 盘锦市| 湘西| 新民市| 诏安县| 湛江市| 老河口市| 府谷县| 独山县| 墨竹工卡县| 自治县| 湟中县| 道孚县| 大关县| 鄢陵县| 宿迁市| 屏边| 汝阳县| 抚远县| 定日县| 东港市| 湘潭县| 关岭| 石门县| 潜江市| 那曲县| 剑川县| 靖西县| 都兰县|