随笔分类 - Django
摘要:一、下载(pyinstaller) pip install pyinstaller 二、生成spec文件 pyi-makespec -D manage.py 三、swagger依赖 1、配置静态文件 # settings.py STATIC_URL = '/static/' STATICFILES_
阅读全文
摘要:一、复制conda环境 1、下载conda-pack(base环境) pip install conda-pack 2、查看conda环境 conda env list 3、切换打包conda环境 conda activate env_name 4、打包conda环境 conda pack -n e
阅读全文
摘要:1、创建环境 conda create -n 环境名 python=版本 2、切换环境 conda activate 环境名 3、导入 pip install -r requirements.txt 4、生成 pip freeze > requirements.txt
阅读全文
摘要:实用 # 配置文件 .DS_Store .idea/ # 编译文件 __pycache__/ *.py[cod] *$py.class # Django 项目中的日志文件和本地配置文件 *.log local_settings.py db.sqlite3 db.sqlite3-journal # 虚
阅读全文
摘要:settings文件 STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), # 添加此项 ]
阅读全文
摘要:在Django 项目的__init__.py文件中 import pymysql # 添加版本信息 pymysql.install_as_MySQLdb() pymysql.version_info=(1, 4, 3, 'final', 0) pymysql.install_as_MySQLdb()
阅读全文
摘要:import pandas as pd from sqlalchemy import create_engine # username="root" password="@WSX3edc" host="127.0.0.1" port=3306 database="test" engine = cre
阅读全文
摘要:https://blog.csdn.net/wglink/article/details/127998343 一、增 # 增 def insert_data(name, category,price,quantity): with connection.cursor() as cursor: sql
阅读全文
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.9.1.
摘要:pymysql.version_info = (1, 4, 13, "final", 0)
阅读全文
摘要:
阅读全文
摘要:一、环境 Package Version python 3.6 amqp 1.4.9 anyjson 0.3.3 baidu-aip 2.2.18.0 billiard 3.3.0.23 celery 3.1.26.post2 certifi 2020.6.20 chardet 3.0.4 Djan
阅读全文
摘要:0、创建 media 文件夹 1、配置文件 MEDIA_URL = '/media/' #资源保存目录 media MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 2、路由 from django.contrib import admin from djan
阅读全文
摘要:https://www.icode9.com/content-4-223704.html
阅读全文
摘要:python manage.py makemigrations <appname> python manage.py migrate <appname>
阅读全文
摘要:def get_client_ip(request): x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip = x_forwarded_for.split(',')[0] # 所以这里是真
阅读全文
摘要:TIME_ZONE = 'Asia/Shanghai' USE_TZ = False 在setting.py文件
阅读全文
摘要:https://www.cnblogs.com/ 这个链接足矣
阅读全文
摘要:github网址 https://github.com/kraiz/django-crontab 按照步骤,完全可行(已测试)
阅读全文
摘要:接收数据 person_lst = [{"name": "wt", "age": 18}, {"name": "er", "age": 20}] 或 person_lst = (("wt", 18), ("er", 20))
阅读全文
摘要:https://www.cnblogs.com/413xiaol/p/6504856.html
阅读全文