stacklens / dusai-blog

杜赛的博客的评论区。详情见 Issue。
2 stars 0 forks source link

article/116/ #114

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Django-Vue搭建个人博客:文章标题图 - 杜赛的博客

https://www.dusaiphoto.com/article/116/

late-nightpoet commented 2 years ago

请问大大是怎样实现github评论后端的啊?

mike-egg123 commented 2 years ago

注意到一个小细节:文章标题图和文章是一对一的关系,所以在Article模型的avatar字段中,related_namearticle而不是articles

2455385814 commented 2 years ago

图片貌似不能上传了,不知道啥情况
File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1359, in [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields] File "/usr/local/lib/python3.8/dist-packages/django/db/models/sql/compiler.py", line 1310, in pre_save_val return field.pre_save(obj, add=True) File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/files.py", line 302, in pre_save file.save(file.name, file.file, save=False) File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/files.py", line 89, in save self.name = self.storage.save(name, content, max_length=self.field.max_length) File "/usr/local/lib/python3.8/dist-packages/django/core/files/storage.py", line 54, in save return self._save(name, content) File "/usr/local/lib/python3.8/dist-packages/django/core/files/storage.py", line 274, in _save fd = os.open(full_path, self.OS_OPEN_FLAGS, 0o666) UnicodeEncodeError: 'ascii' codec can't encode characters in position 39-40: ordinal not in range(128)

stacklens commented 2 years ago

注意到一个小细节:文章标题图和文章是一对一的关系,所以在Article模型的avatar字段中,related_namearticle而不是articles

kerry456 commented 2 years ago

@mike-egg123 细 精 准 看到这里没有前端 好多功能无法实现 测试逻辑 包括深度rest_farmwork 渗透理解
代码low完一便 混个脸熟 多多少少 学下逻辑思想 后续开发继续杠上

Herbert-CN commented 2 years ago

这个Avatar使用Postman上传一直显示 { "content": [ "No file was submitted." ] }

Allen2898168 commented 1 year ago

好奇怪,我明明安装了,但是启动项目一直 article.Avatar.content: (fields.E210) Cannot use ImageField because Pillow is not installed.