Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web System
>
Blog
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
110
Star
1K
Fork
378
且听风吟
/
DjangoBlog
Code
Issues
18
Pull Requests
2
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
一些问题总结
Backlog
#I52NMF
已注销用户
Opened this issue
2022-04-14 10:52
1. 在使用`pip install -Ur requirements txt` 安装依赖时出现 `pip install django results in No matching distribution found for django` 等无法安装时 使用python3.7 以上版本 2. 使用mysql8 ,项目启动访问首页出现  修改/djangoblog/settings.py文件 在146行左右 改成`USE_TZ = False` 3. 注册一个Bug, 在进行单元测试时 ```py def test_register_email(self): response = self.client.post(reverse('account:register'), { 'username': 'test2', 'email': '', 'password1': 'qweaswdsasd', 'password2': 'qweaswdsasd', }) # test2 数据库不存在 self.assertEquals(1, len( BlogUser.objects.filter(username='test2'))) ``` 测试能通过,这里只利用前端的校验,而没有在后端再进行校验。 可以在accounts/forms.py 文件下修改为 ```py def clean_email(self): email = self.cleaned_data['email'] if len(email): raise ValidationError("这个字段是必填项.") if get_user_model().objects.filter(email=email).exists(): raise ValidationError("该邮箱已经存在.") return email ```
1. 在使用`pip install -Ur requirements txt` 安装依赖时出现 `pip install django results in No matching distribution found for django` 等无法安装时 使用python3.7 以上版本 2. 使用mysql8 ,项目启动访问首页出现  修改/djangoblog/settings.py文件 在146行左右 改成`USE_TZ = False` 3. 注册一个Bug, 在进行单元测试时 ```py def test_register_email(self): response = self.client.post(reverse('account:register'), { 'username': 'test2', 'email': '', 'password1': 'qweaswdsasd', 'password2': 'qweaswdsasd', }) # test2 数据库不存在 self.assertEquals(1, len( BlogUser.objects.filter(username='test2'))) ``` 测试能通过,这里只利用前端的校验,而没有在后端再进行校验。 可以在accounts/forms.py 文件下修改为 ```py def clean_email(self): email = self.cleaned_data['email'] if len(email): raise ValidationError("这个字段是必填项.") if get_user_model().objects.filter(email=email).exists(): raise ValidationError("该邮箱已经存在.") return email ```
Comments (
3
)
Sign in
to comment
Status
Backlog
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (12)
Tags (7)
master
dev
i18n
4.0
search
docker
es
disablecomment
owntracks
django2.0
modifycdn
weixin
1.0.0.7
1.0.0.6
1.0.0.5
1.0.0.4
1.0.0.3
1.0.0.2
1.0.0.1
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
Python
1
https://gitee.com/lylinux/DjangoBlog.git
git@gitee.com:lylinux/DjangoBlog.git
lylinux
DjangoBlog
DjangoBlog
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register