Debuggers are great, but sometimes it's simply faster to dump Django ORM data to JSON, skim through it, apply a fix, and move on. I wrote a short note on how to do this programmatically - for example during `TestCase` execution - without relying on `manage.py dumpdata`. #Django #Python #Programming #TDD #DailyPythonista https://lnkd.in/dpuPYHnr
Kacper B.’s Post
More Relevant Posts
-
Exciting news with the release of PyMelos! PyMelos is a Python monorepo tool inspired by Melos, designed to enhance modern Python workflows and provide a great developer experience. It simplifies the management and execution of commands across multiple packages within a single repository. For documentation and to get started, visit: https://lnkd.in/gACrsYnk Feedback is always welcome. #python #opensource #monorepo #devtools
To view or add a comment, sign in
-
One nice improvement in the latest DBOS Python release–you can now call async steps concurrently with native syntax from a workflow, and it all just works. To make that possible, we added code to set a unique ID for each step before it begins async execution, so even though the step executions overlap they’re checkpointed deterministically.
To view or add a comment, sign in
-
-
Build FAST APIs like THIS #programming #python #coding Here is how to create a fully functional web API in under 30 seconds using Python's fastest modern framework. FastAPI utilizes modern Python type hints to validate data and serialize JSON automatically, making it significantly faster to write than older frameworks. Coupled with Uvicorn, an ASGI server, it provides high-performance asynchronous capabilities. This snippet demonstrates the absolute minimum code required to get a server running on localhost.
To view or add a comment, sign in
-
🐍 Python Nuance: Lists vs Tuples 🐍 Though lists and tuples look similar in Python, they serve different purposes: Lists are mutable — perfect when you need to update or change data. Tuples are immutable — ideal for protecting data from accidental changes. 🛠 Pro tip: If your data won’t change, use a tuple. If it needs to be updated, use a list. Small decisions like this help make your code clearer, safer, and easier to maintain. Happy coding! 🚀 #Python #CleanCode #DeveloperTips #Programming #SoftwareEngineering #Coding #Development #Debugging #Web
To view or add a comment, sign in
-
-
🚨 Debugging Diaries: Understanding #IndentationError in #Python 🐍 One of the #most_common yet frustrating errors Python #developers face is the IndentationError. Since Python relies on indentation to #define_code blocks, even a single misplaced space or tab can break your #program. 🔍 What is IndentationError? An IndentationError occurs when Python encounters incorrect or inconsistent indentation in your code structure. It usually happens when: ✔ Mixing tabs and spaces ✔ Missing indentation after #control statements (if, for, while, def, etc.) ✔ Over-indenting or under-indenting #code_blocks 🛠 Best Practices to Avoid It: ✅ Use 4 #spaces per indentation level (PEP 8 standard) ✅ Configure your #editor to convert tabs to spaces ✅ Keep your code clean and consistently formatted ✅ Use linters and #formatters like flake8 or black 💡 Why It Matters: Clean indentation is not just about avoiding errors—it improves code #readability, #maintainability, and team collaboration. #Mastering small details like indentation builds strong #foundations for writing #professional, production-ready Python code. 🚀 #Python #Programming #Debugging #CodingTips #SoftwareDevelopment #PythonErrors #CodeQuality #DeveloperLife #LearnToCode #PEP8 #TechCareers
To view or add a comment, sign in
-
-
Pip was effective, but uv is 10–100 times faster, and I'm making the switch for good. For anyone who writes Python—even occasionally—this tool can save hours of your time. What is uv? It's a Python package manager built in Rust. In essence, it combines the functionalities of pip, venv, pyenv, and pip-tools into one command. Reasons to switch include: - Installs packages in seconds, not minutes - Eliminates the "forgot to activate the venv" issue - Manages Python versions, removing the need for pyenv - Ensures reproducible installs with lockfiles Before (using pip): python -m venv .venv → pip install requests After (using uv): uv add requests ✅ (that's all it takes) You can try it in just 10 seconds: curl -LsSf https://lnkd.in/gQx3Zj25 | sh Check out the full comparison in the infographic below. #Python #DevTools #uv #Programming #Productivity #SoftwareDevelopment
To view or add a comment, sign in
-
-
I've been writing Python for years and I still can't do pnpm update. JavaScript devs have had this forever. One command, every package bumps to latest, file gets rewritten, done. Clean. Python? You're either going package by package on PyPI, setting up a whole workflow just to solve what should be a one liner, or reaching for tools that don't even rewrite your file, they just tell you what's outdated and leave the work to you. And vulnerability scanning? Completely separate tool. Separate install. Separate command. Good luck remembering. So I built the thing I kept wishing existed. It's called angela. You run angela update in your project and it does three things: - Finds the latest stable version of every package you depend on - Rewrites your pyproject.toml or requirements.txt automatically - Checks every package for known CVEs while it's already there One binary. No setup. No config required. Written in Go, which I find funny — the best fix for a Python annoyance I could find was to just not use Python. https://lnkd.in/ez5w6Tb2 #golang #python #programming #tooling #opensource
To view or add a comment, sign in
-
WSGI can be put this way in simple terms, Imagine you are in a restaurant and you place an order to the waiter (web server). The waiter does not cook the food but instead, he passes the order to the chef (Python framework such as Flask or Django). Even though the orders are cooked by the chef, the waiter and chef must be on the same page so that orders are clearly understood and are delivered to the correct table every time. This standard communication method is like WSGI.It defines how the web server should pass the request to the Python application and how the application should send the response back
Most Python developers use frameworks. Few understand what actually connects their code to the web 🌐 WSGI is that invisible contract ⚙️ It defines the exact boundary between your Python application and the outside world — raw HTTP bytes on one side, a callable function in memory on the other 🧠 If you’ve ever used Gunicorn, uWSGI, or Django and never traced the full request path from socket to response, this breakdown makes the mechanics clear and concrete 🔍 Read: https://lnkd.in/dkYD3MYP
To view or add a comment, sign in
-
-
✍️ New post on using Memray to profile the memory usage of a Django project. You can use this tool to find and eliminate memory-costly lines of code. The example in the post finds and removes a costly import, reducing startup time. https://lnkd.in/egP2ADKv #Django #Python
To view or add a comment, sign in
-
Hot take on Netmiko Netmiko isn’t hard File handling is In real automation, 80–90% of the work reading inventory files mapping devices to configs structuring data handling errors & outputs Nemiko itself is just: Python ConnectHandler() send_command() disconnect() If Netmiko feels difficult, the gap is usually Python fundamentals, not networking Once that clicks, automation is peace of cake #NetworkAutomation #Python #Netmiko #LearningInPublic #DevOps
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development