分类: python
Python3.X连接Mysql数据库
一、 什么是 PyMySQL?
PyMySQL 是在 Python3.x 版本中用于连接 MySQL 服务器的一个库,Python2中则使用mysqldb。
PyMySQL 遵循 Python 数据库 API v2.……
django 连接mysql数据库
一、需要mysqlclient
Shell
pip install mysqlclient
1
pip install mysqlclient
……
python数据类型--字符串(一)
一、字符串之capitalize
Python
text = "abcd"
v = text.capitalize()
print(v)
输出:
<font color="#ff0000">"D:\python\o……
Python数据类型--整型
介绍:
在Python2.x中,整型使用符号整数类型(int)和长整数类型(long)来表示,是正或负整数,不带小数点。
 ……
Python 运算符
1、算数运算:
2、比较运算:
3、赋值运算:
4、逻辑运算:
5、成员运算:
二〇一八年四月十四日 10:35:52
Django 将多余数据表移除
原配置:
Python
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',……
Django 创建数据表不加APP前缀
Python
[root@site main]# vi models.py
from django.db import models
# Create your models here.
class admin(models.Model):
……
解决Nginx下Django无法加载CSS问题
问题:
在使用Nginx发布Django程序时,无法加载CSS及JavaScript
解决方法:
编辑/etc/nginx/conf.d/default.conf,添加以下内容
Shell
……
编写uwsgi服务
一、编写脚本
脚本如下(根据自己情况进行修改):
Shell
#!/bin/bash
# Comments to support chkconfig on Linux
# chkconfig: ……
MariaDB for Python
一 、安装MySQL-python
Shell
yum -y install MySQL-python
1
yum -y install MySQL-python
……