From a62d77195df534a147e73c7978b2b1748d76ed22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=87=95=E9=B9=8F?= Date: Sat, 8 May 2021 16:33:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8A=A0=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 7 ------- README.md | 9 +++++++++ py_vislib/settings/local.py | 2 +- requirements.txt | 3 ++- vislib/models.py | 4 ++-- vislib/views/source.py | 2 +- 6 files changed, 15 insertions(+), 12 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e762d65..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "python.linting.pylintEnabled": true, - "python.linting.pylintArgs": [ - "--disable=C0103", - "--disable=C0111" - ] -} diff --git a/README.md b/README.md index 1fffce0..d7d9cb6 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,12 @@ Back end of [vue-data-board](https://github.com/dongsuo/vue-data-board). ## [Document](https://docs.v11nlab.com) + + +pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ + +- mysql安装失败手动下载https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient + +python manage.py migrate --settings=py_vislib.settings.local + +python manage.py runserver --settings=py_vislib.settings.local \ No newline at end of file diff --git a/py_vislib/settings/local.py b/py_vislib/settings/local.py index 8d05a68..1896a97 100644 --- a/py_vislib/settings/local.py +++ b/py_vislib/settings/local.py @@ -8,7 +8,7 @@ DATABASES = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'vislib', 'USER': 'root', - 'PASSWORD': '123456xxf', + 'PASSWORD': 'yasaka', 'HOST': 'localhost', 'PORT': '3306', } diff --git a/requirements.txt b/requirements.txt index fca8246..40065c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Django==3.0.4 pycryptodome==3.9.8 django-cors-headers==3.2.1 -mysqlclient==1.3.13 +mysqlclient==1.4.6 +#dm==1.3 diff --git a/vislib/models.py b/vislib/models.py index efba69f..579e69a 100644 --- a/vislib/models.py +++ b/vislib/models.py @@ -22,8 +22,8 @@ class SourceDataBase(models.Model): class SourceDataTable(models.Model): database = models.ForeignKey(SourceDataBase, on_delete=models.CASCADE) - table = models.CharField(max_length=32) - table_alias = models.CharField(max_length=32) + table = models.CharField(max_length=256) + table_alias = models.CharField(max_length=256) status = models.IntegerField(default=1) creator = models.ForeignKey(User, on_delete=models.CASCADE) id = models.CharField(max_length=64, primary_key=True) diff --git a/vislib/views/source.py b/vislib/views/source.py index 6d29550..8eb0ecb 100644 --- a/vislib/views/source.py +++ b/vislib/views/source.py @@ -151,7 +151,7 @@ def sourceTableSave(request): id=uuid.uuid4(), database=source, table=table['table'], - table_alias=table['table_alias'], + # table_alias=table['table_alias'], creator=request.user, status=table['status'], updated_at=default_datetime()