![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
django报错问题
夜恋星
奋斗就是每天过的都很难,但是会一天比一天容易
展开
-
‘QueryDict‘ object is not callable
querydict是不可被调用的把abc= request.data('abc')改成 abc =request.data['abc']原创 2021-08-13 14:19:51 · 647 阅读 · 0 评论 -
解决AssertionError at /xxx/xxx xxx missing “Meta“ attribute
解决AssertionError at /xxx/ Class xxx missing "Meta" attribute序列化器没有加或者写错以下字段: class Meta: model = User fields = ["id", "name"]原创 2021-08-02 16:31:21 · 704 阅读 · 0 评论 -
解决:AssertionError: (“Creating a ModelSerializer without either the ‘fields’ attribute or the
解决:("Creating a ModelSerializer without either the 'fields' attribute or the 'exclude' attribute has been deprecated since 3.3.0, and is now disallowed. Add an explicit fields = '__all__' to the CateSer serializer.",)序列化器没有加或者写错以下字段fields = '__all原创 2021-08-02 16:27:11 · 901 阅读 · 0 评论 -
解决django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are no
Django出现django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.问题看一下你原创 2021-08-02 14:11:19 · 555 阅读 · 2 评论 -
解决:AssertionError at /xxx/Class xxx missing “Meta.model“
看一下你的代码结构,这两个地方有没有书写错误原创 2021-07-29 17:20:29 · 377 阅读 · 0 评论 -
解决RuntimeError: You called this URL via POST, but the URL doesn‘t end in a slash and you have APPEND
访问路由是要加上斜杠" / "urlpatterns = [ path('admin/', admin.site.urls), # path('', views.index.as_view()), path('upload/', views.upload,name='upload'), # path('download_template/', views.download_template,name='download'), # path('', views.i原创 2021-07-29 09:15:36 · 391 阅读 · 0 评论 -
django:mysql Error Code : 1060 Duplicate column name ‘user_id‘问题
mysql Error Code : 1060 Duplicate column name 'user_id’问题解决方式一﹑先看一下django的虚拟环境与命令栏是否匹配如果不匹配切换到虚拟环境或者已安装的解释器下执行解决方式二﹑将migrations文件夹下除了__init__.py以外全部删掉然后执行python manage.py makemigrationspython manage.py migrate如果都不行的话可能是django版本问题,或者试试将报错数据库drop原创 2020-12-15 19:32:51 · 1106 阅读 · 0 评论