TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Nango, a Django extension providing SPA-like features

20 点作者 nicois超过 3 年前

3 条评论

nicois超过 3 年前
Over recent weeks there have been a few HN posts relating to Django and how it interacts with &quot;modern&quot; ecosystems. Over Christmas I began working on a Django extension which would help leverage some features usually seen only in javascript-heavy websites, without the pain of writing custom code, in investing in browser-heavy automated tests.<p>The &quot;killer&quot; features I am hoping to bring to the Django community is the ability to have strong data consistency assurances between requests when editing data, as well as realtime server-driven validation of form inputs, alongside optional realtime &quot;autosaving&quot; of fields as changes are made. You can see how this looks here: <a href="https:&#x2F;&#x2F;user-images.githubusercontent.com&#x2F;236562&#x2F;153730557-a22b473a-1680-465d-a898-1a7fa72e919f.mp4" rel="nofollow">https:&#x2F;&#x2F;user-images.githubusercontent.com&#x2F;236562&#x2F;153730557-a...</a><p>I have also attempted to minimise how much an existing codebase needs to be altered to use or test this. No database schema changes are required, and mostly it&#x27;s just a matter of changing import statements from &quot;django...&quot; to &quot;nango...&quot;<p>This is very much a proof-of-concept at the moment and certainly not fit for production, and I welcome all suggestions and critiques. A quickstart script is included in the repo which should minimise the pain in running the code locally.
boxed超过 3 年前
Preventing accidental overwriting has been on my todo list for many years. But since it&#x27;s so very rare in practice I haven&#x27;t gotten around to it.<p>Django forms having this problem is, in my opinion, WAY down the list of problems. I originally wrote the forms library in iommi to be able to programmatically create forms in a sane way but it has since evolved to fix many more of the weaknesses of django. Some highlights:<p>- good rendering of forms to html!<p>- that can be customized without resorting to writing gigantic amounts of brittle template code<p>- render form errors<p>- strip space from inputs by default<p>- always writes the encoding attr so file uploads work by default instead of silently failing by default<p>- you don&#x27;t need to manually pass request.FILES (another silent failure not just beginners get bitten by)<p>- don&#x27;t allow misses like duplicate names that causes silent data loss<p>Plus the iommi features of nesting and having multiple forms&#x2F;tables&#x2F;menus&#x2F;etc on one page with clean composition.
评论 #30320552 未加载
sergiomattei超过 3 年前
I’m curious about how this scales. All my previous experiences with Django Channels, even since 1.0 to 2.0, have faced serious reliability issues and tricky bugs even in small apps.
评论 #30318925 未加载