如何从Django异步处理数据库写入(可能带有消息队列)?(How to process database writes asynchronously (maybe with a message queue) from Django?)
用户向我的应用程序提交数据后,我想通过消息队列异步地写入数据库。
我如何设置这样一个系统? 是否有可执行此类基于消息队列的数据库写入的可插入Django应用程序?
另外我如何处理异步处理期间发生的错误?
真的很感谢你能给我的任何指针。 谢谢。
After a user submitted data to my app, I'd like to write to the database asynchronously, possibly through a message queue.
How do I set up such a system? Are there any pluggable Django apps that do such message queue-based database writes?
Also how do i handle errors that happens during the async processing?
Would really appreciate any pointers you can give me. Thank you.
原文:https://stackoverflow.com/questions/2793056
最满意答案
发现了问题。 我写了一些错误的代码,试图在彼此内部实例化更多的模板视图。
我知道模板视图的限制纯粹与scrollview(当然还有stencilView类本身)有关,因为它是唯一一个继承这个类的人。
所以你不能在彼此内部实例化8个以上的scrollview,这看起来非常好。
class stencilTest(App): def build(self): super(stencilTest, self).__init__() root = GridLayout(cols=1, spacing=10, size_hint_y=None) r = root for i in range(10): w = ScrollView(size_hint=(1, 1), size=(1000, 800)) r.add_widget(w) r = r.children[0] return root if __name__ == "__main__": stencilTest().run()
如果感兴趣,此代码将重现错误
Found the problem. I wrote some bad code that was trying to instantiate more stencil view inside each other.
I understood that the limit of the stencil view is related purely to scrollview (and the stencilView class itself of course) because it's the only one to inherit this class.
So you can't instantiate more than 8 scrollview inside each other, which seems perfectly fine.
class stencilTest(App): def build(self): super(stencilTest, self).__init__() root = GridLayout(cols=1, spacing=10, size_hint_y=None) r = root for i in range(10): w = ScrollView(size_hint=(1, 1), size=(1000, 800)) r.add_widget(w) r = r.children[0] return root if __name__ == "__main__": stencilTest().run()
This code will reproduce the error if interested
相关问答
更多-
没有这样的功能只能清除深度/模板视图的一部分。 这是我解决问题的方法: 做一个纹理。 将部件的Alpha设置为清除为1,将其他部分设置为0。 打开AlphaTest ,只打开alpha为1的像素。 打开AlphaBlend ,将BlendOP设置为Add ,将SrcBlend factor设置为0,将DestBlend factor设置为1。 将StencilTest和DepthTest设置为Always ,将StencilRef设置为要清除的值。 使用正交投影矩阵。 绘制一个仅覆盖屏幕的矩形(z坐标/(Z ...
-
没有一个前置表达式可以调用所有产品或来自特定类别的产品。 设置大量新的或特色产品并使用它们来填充您的主页会更容易。 需要注意的是,您选择显示的产品数量可能会对加载时间和用户体验产生负面影响,因此如果您选择此路线,我会以增量方式延迟加载产品。 There isn't a front matter expression that will call all products or call products from a specific category. It would be easier to set ...
-
我修好了,感谢猫头鹰向正确的方向点头。 事实上,我实际上是在释放光栅器状态,以便使用深度模板。 对于有同样问题的人,我会在这里留下这个答案。 I fixed it, thanks to catflier's nod in the right direction. Turns out I was actually releasing the rasterizer state too early for the depth stencil to be used. I'll leave this answer h ...
-
如果你看到这个,你可以通过在你正在使用的目录中安装jspm来解决它。如果你需要jspm用于其他项目,这没有用,但是它会让你暂时使用Stencil。 本页第2点 If you are seeing this, you can resolve it by installing jspm just in the directory you are working in. This doesn't help if you need jspm for other projects, but it will get y ...
-
Kivy模板视图限制(Kivy stencil view limits)[2022-04-12]
发现了问题。 我写了一些错误的代码,试图在彼此内部实例化更多的模板视图。 我知道模板视图的限制纯粹与scrollview(当然还有stencilView类本身)有关,因为它是唯一一个继承这个类的人。 所以你不能在彼此内部实例化8个以上的scrollview,这看起来非常好。 class stencilTest(App): def build(self): super(stencilTest, self).__init__() root = GridLayout(co ... -
dynamicComponent模具(dynamicComponent Stencil)[2023-11-20]
我使用条件而不是dynamicComponent。 这不是我认为的。 I used if conditionals instead of dynamicComponent. It wasn't what I thought it was. -
我使用RenderTarget2D而不是模板缓冲区解决了这个问题。 将纯黑色阴影绘制到RT2D,然后将RT2D本身绘制成具有半透明颜色的场景,可以实现并简化实现。 I worked around the issue by using a RenderTarget2D instead of the stencil buffer. Drawing solid black shadows to a RT2D and then drawing the RT2D itself into the scene with ...
-
Dojo不可移动的模板(Dojo unmovable stencil)[2022-06-06]
虽然它似乎并不理想,但我能够通过disabled模板来完成我想要的任务: var stencil = dojoDrawing.addStencil("rect", { x : someXVal, y : someYVal, width : someWidth, height : someHeight }); stencil.disable(); 这会将模板颜色更改为disabled状态,使其无法选择,因此无法移动。 Although it doesn't seem ide ... -
关于你的观点设计。 您的视图的全局设计是可以的,这意味着有一个单独的视图来测试文档的“类型/值”并根据此值发出不同的索引。 你说你有11个观点,它们是如何组织的? 有多少设计文件? 观点/设计文件? 我问这个是因为设计文档中的所有视图都在同一时间更新。 看一看“View Design Best Practice”一章: http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writing-bestpractice.html 你的 ...
-
也许glClipPlane是你想要的? 或者你可以看看Oblique Near Plane Clipping ,试着做一些时髦的投影数学,修改你的近平面是门户的。 Maybe glClipPlane is what you want? Or you could take a look at Oblique Near Plane Clipping, to try to do some funky projection math that modifies your near plane to be that ...