![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
django
songbaiyiran
这个作者很懒,什么都没留下…
展开
-
ajax异步请求,生成表格,局部刷新
先来一段简单的html表单:<form onsubmit="return false" id="formAddtr" method="post"> <input type="text" name="id"> <button id="select1" onclick="subForm()">查询</button></form>注意要写上onsubmit=”return false”,原创 2017-10-20 17:16:43 · 20737 阅读 · 5 评论 -
已存在库表创建models(django)/其中报错原因
python manage.py inspectdb > 文件名.py会生成一个和当前库对应的models文件,自动生成模型翻译 2017-10-13 12:08:55 · 436 阅读 · 0 评论 -
Unable to create the django_migrations table 迁移文件时报错
执行python manage.py makemigrations 报错:raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)django.db.migrations.exceptions.MigrationSchemaMissing: Unable to crea原创 2017-10-13 16:07:20 · 7469 阅读 · 0 评论 -
Superuser creation skipped due to not running in a TTY创建超级管理员报错
django创建超级管理员时报错:Superuser creation skipped due to not running in a TTY. You can run `manage.py createsuperuser` in your project to create one manually.解决办法:在当前系统的命令窗口中使用创建的命令python mana原创 2017-10-13 15:17:16 · 3774 阅读 · 1 评论 -
django依赖文件requirements.txt生成/安装
依赖文件生成pip freeze > requirements.txt依赖文件安装pip install -r requirement.txt翻译 2017-10-14 11:36:14 · 7811 阅读 · 0 评论 -
django数据库本地配置/python读取本地配置文件
首先创建一个本地文件config.ini,是.ini格式的配置文件,值不用加引号,读取过去就是字符串格式文件内容:[global]ip = xxxport = xxxtable = xxxuname = xxxpasswd = xxx读取本地配置文件用了个django自带的模块:configparser在settings.py 中设置如下,按照相对路径取原创 2017-10-14 12:04:40 · 5396 阅读 · 0 评论 -
局域网内,其他主机访问本地主机运行的系统 如何配置生效
1.首先修改django系统的settings.py文件:比如本机ip为192.168.0.1ALLOWED_HOSTS = ['ip', 'localhost', '127.0.0.1']所以应写成如下:ALLOWED_HOSTS = ['192.168.0.1', 'localhost', '127.0.0.1']2.本机命令行启动django程序:pyth原创 2017-10-14 11:39:50 · 529 阅读 · 0 评论 -
python与mysql交互/读取本地配置文件/交互报错
python与mysql交互/读取本地配置文件/交互报错[Errno 11004] getaddrinfo faileddjango操作mysql时django.db.utils.OperationalError: (2003, "Can't connect to MySQL server")错误can only concatenate tuple (not "bytes") to tuple原创 2017-10-16 16:52:39 · 1797 阅读 · 0 评论