一些异常统计

  1. raise ImproperlyConfigured(
    django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
    Did you install mysqlclient?

https://www.cnblogs.com/peng-lan/p/9605045.html

  1. django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
    WIN10安装MYSQL教程
    https://blog.csdn.net/yahuikiki/article/details/90738837
    create database dailyfresh default charset utf8 collate utf8_general_ci;

  2. ModuleNotFoundError: No module named ‘goods.urls’
    该app下是否有urls.py

  3. The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting.
    https://blog.csdn.net/liu_yanna/article/details/49906771

  4. "GET /user/static/images/logo02.png HTTP/1.1" 404 2564 只能从当前app下的static找css文件,不能在根目录下的static里面找
    前端文件没有设置好 href=’css/reset.css‘ 这种方式不对的,要写成
    {% load static %} 和 href="{% static ‘css/reset.css’ %}

  5. TemplateSyntaxError: ‘staticfiles’ is not a registered tag library. Must be one of:
    {% load staticfiles %} 这种方式1.8之前用好像是,之后不用了,用{% load static %}

7. ‘user’ is not a registered namespace
path(‘user/’, include(‘user.urls’, namespace=‘user’)),
8. django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported.
Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead

python3 Django 环境下,如果你遇到在根目录下urls.py中的include方法的第二个参数namespace添加之后就出错的问题。请在[app_name]目录下的urls.py中的urlpatterns前面加上app_name=’[app_name]’, [app_name]代表你的应用的名称。
例如:app_name =’[blog]’

  1. auto_now_add与auto_now

  2. HINT: Add or change a related_name argument to the definition for 'User.user
    AUTH_USER_MODEL = ‘users.UserProfile’
    users:你的app
    UserProfile:model
    https://www.cnblogs.com/bbbbbd/p/7725030.html

  3. django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency user.0001_initial on database ‘default’.

  4. smtplib.SMTPSenderRefused: (501, b’Mail from address must be same as authorization user.’, ‘45583655@qq.com’)
    send_mail()中的变量f若不是settings中的EMAIL_FROM则会报错:

  5. TypeError: init() missing 1 required positional argument: ‘on_delete’

  6. str returned non-string (type GoodsType)
    https://blog.csdn.net/qq_41854273/article/details/837516

  7. RuntimeError: Model class apps.goods.models.GoodsType doesn’t declare an explicit app_label and isn’t in an application in INSTALLED_APPS.

from .models import * 改为
from goods.models import *

  1. “GET /goods/images/upload/banner05.jpg HTTP/1.1” 404 2734
    原来是
    改为
  2. ./configure: error: the HTTP rewrite module requires the PCRE library.
    You can either disable the module by using --without-http_rewrite_module
    option, or install the PCRE library into the system, or build the PCRE library
    statically from the source with nginx by using --with-pcre= option.

solve: sudo apt-get install libpcre3 libpcre3-dev

  1. src/core/ngx_murmurhash.c:37:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
    h ^= data[2] << 16;
    ^~~~~~~~~~~~~~
    src/core/ngx_murmurhash.c:38:5: note: here
    case 2:
    ^~~~
    src/core/ngx_murmurhash.c:39:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
    h ^= data[1] << 8;
    ^~~~~~~~~~~~~
    src/core/ngx_murmurhash.c:40:5: note: here
    case 1:
    ^~~~
    cc1: all warnings being treated as errors
    objs/Makefile:440: recipe for target ‘objs/src/core/ngx_murmurhash.o’ failed
    make[1]: *** [objs/src/core/ngx_murmurhash.o] Error 1
    make[1]: Leaving directory ‘/home/ksz/python/fastdfs/install/nginx-1.8.1’
    Makefile:8: recipe for target ‘build’ failed
    make: *** [build] Error 2

solve : make CFLAGS=’-Wno-implicit-fallthrough’
https://www.cnblogs.com/xianqingsong/p/10756451.html

  1. astdfs-nginx-module-master/src/common.c:159:30: error: ‘FDFS_MOD_CONF_FILENAME’ undeclared (first use in this function); did you mean ‘FDFS_MOD_COMMON_H’?
    if ((result=iniLoadFromFile(FDFS_MOD_CONF_FILENAME, &iniContext)) != 0)
    ^~~~~~~~~~~~~~~~~~~~~~
    FDFS_MOD_COMMON_H
    fastdfs-nginx-module-master/src/common.c:159:30: note: each undeclared identifier is reported only once for each function it appears in
    fastdfs-nginx-module-master/src/common.c: In function ‘fdfs_send_file_buffer’:
    fastdfs-nginx-module-master/src/common.c:725:23: error: ‘FDFS_OUTPUT_CHUNK_SIZE’ undeclared (first use in this function); did you mean ‘FDFS_STAT_FUNC_STAT’?
    char file_trunk_buff[FDFS_OUTPUT_CHUNK_SIZE];
    ^~~~~~~~~~~~~~~~~~~~~~
    FDFS_STAT_FUNC_STAT
    objs/Makefile:1098: recipe for target ‘objs/addon/src/ngx_http_fastdfs_module.o’ failed
    make[1]: *** [objs/addon/src/ngx_http_fastdfs_module.o] Error 1
    make[1]: Leaving directory ‘/home/ksz/python/fastdfs/install/nginx-1.8.1’
    Makefile:8: recipe for target ‘build’ failed
    make: *** [build] Error 2

  2. nginx

https://blog.csdn.net/qq_41580631/article/details/90512804
https://blog.csdn.net/houyanhua1/article/details/85266262
https://blog.csdn.net/weixin_41917873/article/details/88652639

  1. ‘Specifying a namespace in include() without providing an app_name ’
    https://blog.csdn.net/Martin_Yan/article/details/84982056
    在这里插入图片描述
    app_name =’[blog]’

  2. learning_logs ’is not a registered namespace,如何解决?
    https://blog.csdn.net/mukvintt/article/details/80320027

  3. DjangoUeditor ModuleNotFoundError: No module named ‘widgets’

DjangoUeditor ModuleNotFoundError: No module named ‘widgets’

github搜DjangoUeditor3,克隆到本地,复制文件夹里面的DjangoUeditor文件夹,放到虚拟环境下的lib/site-packages/下

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值