django-practice-book icon indicating copy to clipboard operation
django-practice-book copied to clipboard

《Django企业开发实战》已出版

Results 24 django-practice-book issues
Sort by recently updated
recently updated
newest added

request += conn.recv(1024) # 阻塞等待接收数据,长度为1024 BlockingIOError: [WinError 10035] 无法立即完成一个非阻止性套接字操作。 如何解决?

https://github.com/the5fire/typeidea/blob/book/06-admin/typeidea/config/admin.py config这个app的admin.py中调用了base_admin,但是没有删除定义在config/admin里的两个save_model

blog的3个model中只有category和tag有name,而post没有name,不能简单套用下面的代码class Category ...... return self.name,否则在添加文章或评论时会报错。(虽然书上在代码前有提示不要简单套用:“类似于这样”) 解决方法:class Category的和class Tag 的不需要改,class Post的改成return self.title

setup.py中的代码是 version='0.1' 然后 在fabfile.py中读取setup.py的内容并执行replace origin_content.replace('${version}‘, version) 这里的${version}能够获取到0.1吗?我执行后,没反应呢,请问什么怎么回事? 是我哪里弄错了,还是说origin_content本来就是一个string,按道理是没办法在一个string里用${version}打印版本号?

对于文章编辑表单提交后出现 TypeError: __init__() got multiple values for argument ‘instance' 的解决方法如下: ``` def __init__(self, *args, **kwargs): initial = kwargs.get('initial') or {} instance = kwargs.get('instance') if instance: if instance.is_md: initial['content_md'] = instance.content...

![image](https://user-images.githubusercontent.com/36755605/99499913-91172f80-29b4-11eb-82a4-b829ba981cce.png) 如图中的删除框,点击删除没有任何反应,请问如果通过内联中的删除框,删除某篇文章?

url.py文件中的关键字base_name,在django3.0和python3.8中报错,改成basename即可

这个模块里重复了,有两个!

请教下大神,我讲第九章的代码拉下来,本地做完sqllite3数据更新同步makemigrations和migrate,创建超级用户后,用超级用户登录后台,添加“分类”,添加数据后保存报错,提示 ![image](https://user-images.githubusercontent.com/59657551/88478931-991f0f80-cf7e-11ea-8166-2fecd336e421.png) 具体添加内容为: ![image](https://user-images.githubusercontent.com/59657551/88478916-77be2380-cf7e-11ea-8c96-da4c266d8668.png) django 版本为1.11.29 大神能帮忙看下是什么问题吗

version : Django==1.11.29 原文描述: > 执行完上述方法, 并且Django帮我们执行完view, 拿到最终的 response 后, 如果使用了模板的 response (这里指通过 return render(request, 'index.html', context={}) 方式返回的 response), 就会来到这个方法中. 实际测试后发现: ```python def index(request): students = Student.get_all() form = StudentForm()...