Переглянути джерело

导入数据库包
设置数据库配置信息

DYaiu 4 роки тому
батько
коміт
2c5c1a6e87
3 змінених файлів з 51 додано та 3 видалено
  1. 4 0
      Pipfile
  2. 40 1
      Pipfile.lock
  3. 7 2
      my_project/settings.py

+ 4 - 0
Pipfile

@@ -7,6 +7,10 @@ verify_ssl = true
 
 [packages]
 django = "==2.1.7"
+django-restframework = "*"
+djangorestframework-bulk = "*"
+mysql = "*"
+mysqlclient = "*"
 
 [requires]
 python_version = "3.7"

+ 40 - 1
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "5fce134eabede7fa5d5fe80c1058fa75b50b8e6674638a2b2ed60c7d8c2a9353"
+            "sha256": "e7d27b3d33ffface70a35ee093aef7bdb077d9e05f444e694d22d8ed4d233f7c"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -24,6 +24,45 @@
             "index": "pypi",
             "version": "==2.1.7"
         },
+        "django-restframework": {
+            "hashes": [
+                "sha256:2bec9265463693ada558ad9a58c31f6f3de005a932fbfeaadf983c5c9f3b7058"
+            ],
+            "index": "pypi",
+            "version": "==0.0.1"
+        },
+        "djangorestframework": {
+            "hashes": [
+                "sha256:05809fc66e1c997fd9a32ea5730d9f4ba28b109b9da71fccfa5ff241201fd0a4",
+                "sha256:e782087823c47a26826ee5b6fa0c542968219263fb3976ec3c31edab23a4001f"
+            ],
+            "markers": "python_version >= '3.5'",
+            "version": "==3.11.0"
+        },
+        "djangorestframework-bulk": {
+            "hashes": [
+                "sha256:39230d8379acebd86d313df6c9150cafecb636eae1d097c30a26389ab9fee5b1"
+            ],
+            "index": "pypi",
+            "version": "==0.2.1"
+        },
+        "mysql": {
+            "hashes": [
+                "sha256:55e66b5e7b3823b1da5fb2a063e95a628fb850b2a0b76bdcd884faac5d2daa7d"
+            ],
+            "index": "pypi",
+            "version": "==0.0.2"
+        },
+        "mysqlclient": {
+            "hashes": [
+                "sha256:3f39855a4ad22805361e782cc4d1010ac74796225fa2d1c03cc16673ccdc983a",
+                "sha256:a6b5648f648b16335e3b1aaec93dc3fcc81a9a661180e306936437cc522c810b",
+                "sha256:edd42ccaa444b00702d5374b2f5f7585c9d0ce201917f15339f1c3cf91c1b1ed",
+                "sha256:fb2f75aea14722390d2d8ddf384ad99da708c707a96656210a7be8af20a2c5e5"
+            ],
+            "index": "pypi",
+            "version": "==2.0.1"
+        },
         "pytz": {
             "hashes": [
                 "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed",

+ 7 - 2
my_project/settings.py

@@ -35,6 +35,7 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'rest_framework'
 ]
 
 MIDDLEWARE = [
@@ -73,8 +74,12 @@ WSGI_APPLICATION = 'my_project.wsgi.application'
 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+        'ENGINE': 'django.db.backends.mysql',
+        'NAME': "linjj_django_demo",
+        "USER": "root",
+        "PASSWORD": "abc.123",
+        "HOST": "srv.test.linkerplus.com",
+        "PORT": "3310"
     }
 }