1.命令html
pip install virtualenvwrapper-winmysql
mkvirtualenv env_xadminweb
deactivate 退出sql
pip list數據庫
pip install mysql-windjango
出錯處理json
http://blog.csdn.net/u012882134/article/details/51934165ruby
2.pycharm 工具裏面django工具session
tools manange.pyapp
3.
url別名 name=‘goform’
csfrtoken
模板函數
url加上$防止衝突
4.通常書寫規範
第一行爲系統導入第二行爲第三方第三行爲本身的
一對多之類的忘記了,查看銀角大王
5.新建package
拖入apps,引用勾選去掉
marksourceroot還要sys.path.insert(0,os.path.join(BASE_DIR, 'apps'))
重載__unicode__方法
若是是外鍵字段能夠是表__字段名方式來處理外表的具體某個字段
靜態文件
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static')
]
6.URL
from django.views.generic import TemplateView
path('index/', TemplateView.as_view(template_name="index.html", name='index')),
6.頂部菜單
https://blog.csdn.net/lyysr/article/details/48735053
7.內置其餘菜單 顯示定義自定義函數
http://www.javashuo.com/article/p-wxsgzmar-cz.html
8.聯動
http://www.javashuo.com/article/p-xtwbkzts-hy.html
https://www.cnblogs.com/derek1184405959/p/8682250.html
9.權限
https://www.jianshu.com/p/83f6a4827185
https://www.jianshu.com/p/404fd39d5efc
如下三個靠譜一些
https://blog.csdn.net/asp_net_sql/article/details/80265108
https://blog.csdn.net/qq_37049050/article/details/81867390
url級別權限相似tp
https://www.cnblogs.com/sss4/p/7575250.html
獨立的rbac 根據此開發也不是不能夠
https://blog.csdn.net/asp_net_sql/article/details/80265108
============================================
1.建立虛擬環境virtualenvwrapper-win
2.pycharm虛擬環境選擇本身創建的
3.創建兩個package而且設置爲根目錄
4.seting中
sys.path.insert(0, BASE_DIR)
sys.path.insert(0,os.path.join(BASE_DIR, 'apps'))
sys.path.insert(0,os.path.join(BASE_DIR, 'extra_apps'))
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'webset.apps.WebsetConfig', 'xadmin', 'crispy_forms', ]
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'diandian', # 數據庫 'USER': 'root', # 用戶名 'PASSWORD': '123456', # 密碼 'HOST': '127.0.0.1', } }
# 中文 LANGUAGE_CODE = 'zh-hans' TIME_ZONE = 'Asia/Shanghai' USE_I18N = True USE_L10N = True USE_TZ = False
STATIC_URL = '/static/' # 不知道 STATIC_ROOT = os.path.join(BASE_DIR, 'static') # STATICFILES_DIRS = [ # os.path.join(BASE_DIR, 'static') # ]
pip install future 0.17.1
pip install django-crispy-forms 1.7.2
---------------------------------pip uninstall django-formtools
pip install django-formtools 2.1
0.13.0pip install matplotlibpip install django-import-export-----------------------------------pip install django-jsonfieldpip install httplib2