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