from django import http
from django.contrib.auth import login
from django.urls import reverse
from users.models import User
from django.http import HttpResponseForbidden
from django.shortcuts import render, redirect
import re
# Create your views here.
from django.views import View
from django.db import DatabaseError
from meiduo_mall.meiduo_mall.utils.response_code import RETCODE
class UsernameCountView(View):
def get(self, request, username):
count = User.objects.filter(username=username).count()
return http.JsonResponse({'code': 'RETCODE.OK', 'errmsg': 'OK', 'count': count})
django中显示没有模块命名,模块确实存在
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- python收藏家 2021-11-03 09:53关注
应该是模块路径引用问题 当前路径下搜索不到这个路径 make dictionary as source root
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 找一个网络防御专家,外包的
- ¥100 能不能让两张不同的图片md5值一样,(有尝)
- ¥15 informer代码训练自己的数据集,改参数怎么改
- ¥15 请看一下,学校实验要求,我需要具体代码
- ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
- ¥20 MATLAB绘制两隐函数曲面的交线
- ¥15 求TYPCE母转母转接头24PIN线路板图
- ¥100 国外网络搭建,有偿交流
- ¥15 高价求中通快递查询接口
- ¥15 解决一个加好友限制问题 或者有好的方案