修改mysql客户端为mysqlclient,增加issue模版,fix #227

master
liangliangyy 7 years ago
parent c014f06799
commit 3397757525

@ -0,0 +1,18 @@
<!--
如果你不认真勾选下面的内容,我可能会直接关闭你的 Issue。
提问之前,建议先阅读 https://github.com/ruby-china/How-To-Ask-Questions-The-Smart-Way
-->
**我确定我已经查看了** (标注`[ ]`为`[x]`)
- [ ] [DjangoBlog的readme](https://github.com/liangliangyy/DjangoBlog/blob/master/README.md)
- [ ] [配置说明](https://github.com/liangliangyy/DjangoBlog/blob/master/bin/config.md)
- [ ] [其他 Issues](https://github.com/liangliangyy/DjangoBlog/issues)
----
**我要申请** (标注`[ ]`为`[x]`)
- [ ] BUG 反馈
- [ ] 添加新的特性或者功能
- [ ] 请求技术支持

@ -12,6 +12,7 @@ branches:
- master
# command to install dependencies
install:
- apt-get install python3-dev default-libmysqlclient-dev
- pip install -r travis_test/requirements.txt
- pip install python-coveralls
- pip install coverage codecov

@ -1,2 +0,0 @@
import pymysql
pymysql.install_as_MySQLdb()

@ -17,6 +17,8 @@
- 网站异常邮件提醒,若有未捕捉到的异常会自动发送提醒邮件。
- 集成了微信公众号功能现在可以使用微信公众号来管理你的vps了。
## 安装
mysql客户端从`pymysql`修改成了`mysqlclient`,具体请参考 [pypi](https://pypi.org/project/mysqlclient/) 查看安装前的准备。
使用pip安装
`pip install -Ur requirements.txt`

@ -30,21 +30,15 @@ class BaseModel(models.Model):
last_mod_time = models.DateTimeField('修改时间', default=now)
def save(self, *args, **kwargs):
if not isinstance(self, Article) and 'slug' in self.__dict__:
if getattr(self, 'slug') == 'no-slug' or not self.id:
slug = getattr(self, 'title') if 'title' in self.__dict__ else getattr(self, 'name')
setattr(self, 'slug', slugify(slug))
is_update_views = isinstance(self, Article) and 'update_fields' in kwargs and kwargs['update_fields'] == [
'views']
if is_update_views:
Article.objects.filter(pk=self.pk).update(views=self.views)
else:
if 'slug' in self.__dict__:
slug = getattr(self, 'title') if 'title' in self.__dict__ else getattr(self, 'name')
setattr(self, 'slug', slugify(slug))
super().save(*args, **kwargs)
# is_update_views = 'update_fields' in kwargs and len(kwargs['update_fields']) == 1 and kwargs['update_fields'][
# 0] == 'views'
# from DjangoBlog.blog_signals import article_save_signal
# article_save_signal.send(sender=self.__class__, is_update_views=is_update_views, id=self.id)
def get_full_url(self):
site = get_current_site().domain

@ -3,53 +3,55 @@ asn1crypto==0.24.0
astroid==2.2.5
bottle==0.12.16
certifi==2019.3.9
cffi==1.12.2
cffi==1.12.3
chardet==3.0.4
coverage==4.5.3
cryptography==2.6.1
Django==2.1.7
Django==2.2.1
django-appconf==1.0.3
django-autoslug==1.9.4
django-compressor==2.2
django-debug-toolbar==1.11
django-haystack==2.8.1
django-ipware==2.1.0
django-mdeditor==0.1.13
django-mdeditor==0.1.14
django-uuslug==1.1.8
elasticsearch==7.0.0
elasticsearch-dsl==7.0.0
idna==2.8
ipaddress==1.0.22
isort==4.3.15
isort==4.3.20
jieba==0.39
jsonpickle==1.1
lazy-object-proxy==1.3.1
lazy-object-proxy==1.4.1
markdown2==2.3.7
mccabe==0.6.1
mistune==0.8.4
mysqlclient==1.4.2.post1
olefile==0.46
packaging==19.0
Pillow==5.4.1
Pillow==6.0.0
pycparser==2.19
Pygments==2.3.1
Pygments==2.4.0
pylint==2.3.1
PyMySQL==0.9.3
pyparsing==2.3.1
pyparsing==2.4.0
python-dateutil==2.8.0
python-logstash==0.4.6
python-memcached==1.59
python-slugify==3.0.0
pytz==2018.9
python-slugify==3.0.2
pytz==2019.1
raven==6.10.0
requests==2.21.0
rcssmin==1.0.6
requests==2.22.0
rjsmin==1.1.0
six==1.12.0
sqlparse==0.3.0
text-unidecode==1.2
typed-ast==1.3.1
Unidecode==1.0.23
urllib3==1.24.2
urllib3==1.25.2
webencodings==0.5.1
WeRoBot==1.8.0
WeRoBot==1.9.0
Whoosh==2.7.4
wrapt==1.11.1
xmltodict==0.12.0

@ -1,2 +0,0 @@
import pymysql
pymysql.install_as_MySQLdb()

@ -3,52 +3,54 @@ asn1crypto==0.24.0
astroid==2.2.5
bottle==0.12.16
certifi==2019.3.9
cffi==1.12.2
cffi==1.12.3
chardet==3.0.4
coverage==4.5.3
cryptography==2.6.1
Django==2.1.7
Django==2.2.1
django-appconf==1.0.3
django-autoslug==1.9.4
django-compressor==2.2
django-debug-toolbar==1.11
django-haystack==2.8.1
django-ipware==2.1.0
django-mdeditor==0.1.13
django-mdeditor==0.1.14
django-uuslug==1.1.8
elasticsearch==7.0.0
elasticsearch-dsl==7.0.0
idna==2.8
ipaddress==1.0.22
isort==4.3.15
isort==4.3.20
jieba==0.39
jsonpickle==1.1
lazy-object-proxy==1.3.1
lazy-object-proxy==1.4.1
markdown2==2.3.7
mccabe==0.6.1
mistune==0.8.4
mysqlclient==1.4.2.post1
olefile==0.46
packaging==19.0
Pillow==5.4.1
Pillow==6.0.0
pycparser==2.19
Pygments==2.3.1
Pygments==2.4.0
pylint==2.3.1
PyMySQL==0.9.3
pyparsing==2.3.1
pyparsing==2.4.0
python-dateutil==2.8.0
python-logstash==0.4.6
python-slugify==3.0.0
pytz==2018.9
python-slugify==3.0.2
pytz==2019.1
raven==6.10.0
requests==2.21.0
rcssmin==1.0.6
requests==2.22.0
rjsmin==1.1.0
six==1.12.0
sqlparse==0.3.0
text-unidecode==1.2
typed-ast==1.3.1
Unidecode==1.0.23
urllib3==1.24.2
urllib3==1.25.2
webencodings==0.5.1
WeRoBot==1.8.0
WeRoBot==1.9.0
Whoosh==2.7.4
wrapt==1.11.1
xmltodict==0.12.0

Loading…
Cancel
Save