Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Create a large empty file for testing
`dd if=/dev/zero of=big.file count=500 bs=1024` to create a 500KB empty binary file -
Delete Task UX - Building SaaS with Python and Django #144
In this episode, I worked on an issue to improve the user experience when deleting a task. The previous version forgot the user’s position in a task delete, and we updated the view so that the user would be returned to the same portion of a task list in the course. -
Delete Task UX - Building SaaS #144
In this episode, I worked on an issue to improve the user experience when deleting a task. The previous version forgot the user’s position in a task delete, and we updated the view so that the user would be returned to the same portion of a task list in the course. -
Sign AWS CloudFront Objects with Python
How do you enable faster downl... -
But what are *args & **kwargs?
[[ youtube id="GdSJAZDsCZA" ]... -
How to integrate Python with Airtable
[[ youtube id="ZiAulC50Qgo" ]... -
But what are Django signals?
Watch this one on [YouTube](ht... -
Django vs Node.js
In this post, I'll address a c... -
Deploy Django to DigitalOcean App Platform
In [Prepare Django 3 for Digi... -
Prepare Django for Digital Ocean App Platform
This post is a reference guide... -
Version Control Basics & Git for Try Django 3.2
Putting code into production i... -
Remote Redis Servers for Development
### Using Virtual Machines for... -
Getting Started with DigitalOcean CLI `doctl` & Django
In [Try Django 3.2](https://ww... -
CI/CD Github Workflow for Django & DigitalOcean App Platform
Whenever you aim to release co... -
AI Model Download Pipeline
In [Build a Spam Classifier](h... -
Build a Spam Classifier with Keras
With deep learning and AI, han... -
Push Secure Directories with Encryption Pipelines
In the [Ai as an API](https://... -
Django Static Files in Production on DigitalOcean Spaces
In this post, we'll use Digita... -
Django on Docker
As you may know, Django is a w... -
Django & Github Actions
Github actions is an amazing w... -
A Python JWT Client for Django Rest Framework simplejwt
In this blog post, we'll look ... -
Download the MovieLens Dataset with Python
In our [Django & Machine Learn... -
You Can Build Portable Binaries of Python Applications
Contrary to popular belief, it’s possible to ship portable executables of Python applications without sending its users to Python packaging hell. -
Using Hypothesis and Schemathesis to Test FastAPI
This article looks at how property-based testing via Hypothesis and Schemathesis can be used to test FastAPI. -
Programmatically render a NextJS page without a server in Node
If you use getServerSideProps() in Next you can render a page by visiting it. E.g. GET http://localhost:3000/mypages/page1 Or if you use getStaticProps() with getStaticPaths(), you can use npm run build to generate the HTML file (e.g. .next/server/pages directory). But what if you don't want to start a server. What if you have a particular page/URL in mind that you want to generate but without starting a server and sending an HTTP GET request to it? This blog post shows a way to do this with a plain Node script. Here's a solution to programmatically render a page: #!/usr/bin/env node import http from "http"; import next from "next"; async function main(uris) { const nextApp = next({}); const nextHandleRequest = nextApp.getRequestHandler(); await nextApp.prepare(); const htmls = Object.fromEntries( await Promise.all( uris.map((uri) => { try { // If it's a fully qualified URL, make it its pathname uri = new URL(uri).pathname; } catch {} return renderPage(nextHandleRequest, uri); }) ) ); console.log(htmls); } async function renderPage(handler, url) { const req = new http.IncomingMessage(null); const res = new http.ServerResponse(req); req.method = "GET"; req.url = url; req.path = url; req.cookies = {}; req.headers = {}; await handler(req, res); if (res.statusCode !== 200) { throw new Error(`${res.statusCode} on …