diff --git a/README.md b/README.md index 161697a..31026fe 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # 海豹 ![版本](https://img.shields.io/badge/release-0.3-blue.svg) ![语言](https://img.shields.io/badge/language-python3.6-blue.svg) -![语言](https://img.shields.io/badge/env-django2.1.7-red.svg) +![语言](https://img.shields.io/badge/env-django2.2-red.svg) ![bootstrap4](https://img.shields.io/badge/model-bootstrap4-mauve.svg) ![RESTful](https://img.shields.io/badge/api-RESTful-blue.svg) ![GraphQL](https://img.shields.io/badge/api-GraphQL-blue.svg) @@ -29,6 +29,11 @@ ## DEMO + +> http://129.28.156.219:8001 + +> 账户 admin 密码 1qaz.2wsx + ![列表](document/demo/1.jpg) ![添加](document/demo/2.jpg) ![API](document/demo/3.jpg) @@ -95,7 +100,7 @@ mutation deleteUser { ## 部署 ```bash -yum install python-devel mysql-devel -y +yum install python-devel mysql-devel python36-devel.x86_64 -y git clone https://github.com/hequan2017/seal cd seal @@ -108,7 +113,7 @@ python36 manage.py migrate python36 manage.py createsuperuser -python36 manage.py runserver 0.0.0.0:80 +python36 manage.py runserver 0.0.0.0:8001 ``` diff --git a/requirements.txt b/requirements.txt index 83d8995..fccd57e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -35,7 +35,7 @@ Jinja2>=2.10.1 jsonfield==2.0.2 kombu==4.4.0 MarkupSafe==1.1.1 -pymysql +mysqlclient==1.4.2.post1 openapi-codec==1.3.2 parso==0.2.1 pathtools==0.1.2 diff --git a/seal/__init__.py b/seal/__init__.py index f739536..3415f4a 100644 --- a/seal/__init__.py +++ b/seal/__init__.py @@ -1,9 +1,7 @@ from .celery import app as celery_app -import pymysql -pymysql.install_as_MySQLdb() - +import MySQLdb __all__ = ['celery_app'] diff --git a/seal/settings.py b/seal/settings.py index fa5c1e4..d498fa5 100644 --- a/seal/settings.py +++ b/seal/settings.py @@ -93,12 +93,12 @@ AUTHENTICATION_BACKENDS = ('system.views.CustomBackend',) ## 重新登录验证 # https://docs.djangoproject.com/en/2.1/ref/settings/#databases -if socket.gethostname().endswith('test'): +if socket.gethostname().endswith('demo'): DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', - 'HOST': '192.168.100.50', - 'PORT': '4000', + 'HOST': '127.0.0.1', + 'PORT': '3306', 'NAME': 'seal', 'USER': 'root', 'PASSWORD': '123456',