- 博客(92)
- 收藏
- 关注
原创 ubuntu nginx配置完https报nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/n
这个是安装nginx的时候没有开启ssl功能 解决如下
2023-04-17 15:31:57
491
原创 ubuntu nginx使用 let‘s encrypt给域名配置https
提示输入enter时需要按enter才能继续,按ctrl+则c终止继续。
2023-04-17 13:47:20
413
原创 ubuntu mysql java.sql.SQLException: null, message from server: “Host ‘‘ is not allowed to connect异常
ubuntu mysql 远程连接 SQLexception
2023-02-06 14:02:02
419
转载 mysql5.7初始化密码报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before
windows安装mysql
2022-06-08 14:39:03
4971
1
原创 django restframework使用filter_backends
1.方法1from django_filters.rest_framework import DjangoFilterBackendfrom rest_framework.filters import OrderingFilterfrom rest_framework.response import Responsefrom bffile_data import modelsfrom bffile_data.serializers import File_versionSerializersfr
2022-05-24 16:12:04
957
原创 django+simpleJWT实现自定义登录注册以及中间件
1.安装首次使用需要安装django-rest-framework及jwt相关包pip install djangorestframeworkpip install djangorestframework-simplejwt2.settings文件增加配置INSTALLED_APPS = [ 'rest_framework', 'rest_framework_simplejwt']REST_FRAMEWORK = { 'DEFAULT_FILTER_BACKENDS'
2022-05-24 16:03:59
2841
9
原创 django +restframework
1.首先下载pip install djangopip install djangorestframework2.在settings中配置INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django
2022-05-24 15:47:20
313
原创 ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (bj18.booktest_characterinfo, CONSTRAINT booktest_characterinfo_hbook_id_67c63e4a_fk_booktest_bookinfo_id FOREIGN KEY (hbook_id) REFERENCES booktest_bookinfo (id))发生此问题时,
2022-05-07 10:47:25
1539
原创 djago 的JsonResponse
JsonResponse - 主要用于前后端交互发送数据 - 使用json模块来返回json格式的数据 def test_json(request): import json user_dict = {'user': '王', 'password': 123456} # ensure_ascii=True会将中文转换为编码 {"user": "\u738b", "password": 123456}
2022-05-02 18:03:57
584
原创 django外键正向,反向查询
class Person_info(models.Model): person_id = models.AutoField(primary_key=True) person_name = models.CharField(verbose_name='姓名',max_length=32, unique=True) password = models.CharField(verbose_name='密码',max_length=32,unique=True) class Met
2022-04-30 17:50:03
1476
原创 Django数据查询中对字段进行排序
第一种方法:使用order_by进行排序Articlelist = Article.objects.filter(**kwargs).order_by(‘nid’)Articlelist = Article.objects.filter(**kwargs).order_by(’-nid’) #倒序Articlelist = Article.objects.order_by(’-nid’)可以使用两个字段进行排序:用在第一个字段相等,用第二个来排序的情形Articlelist = Article.
2022-04-30 17:34:34
1890
原创 ubuntu20 apt-get update error:ModuleNotFoundError: No module named ‘apt_pkg‘
发送这个的过程是本身ubuntu20自带的是python3.8然后我下载了另一个python3.9把python3.9的优先级提高了Traceback (most recent call last):File "/usr/lib/command-not-found", line 28, in <module>from CommandNotFound import CommandNotFoundFile "/usr/lib/python3/dist-packages/CommandN
2022-04-29 21:49:52
1195
原创 Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
有时候我们开启或重启Nginx时会报如下错误:**Nginx [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)**原因是端口号80被其它程序或文件占用了,那么就干掉这个程序吧sudo fuser -k 80/tcpfuser -k 80/tcp然后开启或重启Nginx即可。...
2022-04-29 21:42:28
17473
原创 nginx: [error] open() “/var/run/nginx.pid“ failed (2: No such file or directory)
最近修改Nginx服务器,配置文件进行重启时报如下错误解决办法第一种方式:创建默认目录 /var/run/nginx/ ;第二种方式:修改 nginx.conf 文件,指定 pid文件 所在目录:(1)进入 cd /etc/nginx/ 目录,编辑配置文件nginx.conf ;查看进程ps -aux | grep nginx若没起来启动:cd /usr/sbin ./nginx...
2022-04-29 21:39:53
2688
原创 ubuntu20 no internal routing support, rebuild with pcre support
启动uwsgi出现no internal routing support, rebuild with pcre support使用如下命令,记录下,方便后人需要注意的是pip install uwsgi 要加上–no-cache-dir,pip 可以强制下载重新编译安装的库,不然pip会直接从缓存中拿出了上次编译后的 uwsgi 文件,并没有重新编译一份。ubuntu环境下pip uninstall uwsgisudo apt-get install libpcre3 libpcre3-dev
2022-04-29 21:34:07
1281
原创 ubuntu20 安装uwsgi报ERROR: Command errored out with exit status 1:
1.sudo apt-get install libpython3.9-dev 再次下载即可sudo pip3 install -i https://pypi.douban.com/simple/ uwsgi
2022-04-29 16:11:59
647
原创 No changes detected报错解决方案
一、问题描述执行python3 manage.py makemigrations提示:No changes detected二、解决方案第一种解决方案:需要在makemigrations后面加应用名称,即python3 manage.py makemigrations App,App是我的应用名称第二种解决方案:执行python3 manage.py makemigrations --empty App...
2022-04-29 15:52:43
6488
原创 ubuntu 20使用python3.9并使用3.9的pip
1.下载python3.9sudo apt-get install python3.92.切换sudo su输入下面指令update-alternatives --list pythonupdate-alternatives: error: no alternatives for python出现以上所示的错误信息,则表示 Python 的替代版本尚未被update-alternatives 命令识别。想解决这个问题,我们需要更新一下替代列表,将python3.8 和 python3.
2022-04-29 14:36:13
3678
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人