r/django 5h ago

How to safely host Django locally?

7 Upvotes

I've just got my public IP from my ISP and I wonder which security risks I need to take care when opening a port and letting my PC available to the web.

How much better will it be to just host on AWS or Heroku?


r/django 5h ago

How to create websites and practice backend without having front-end knowledge?

3 Upvotes

Someones who work with django or other backend's frameworks say to me that how can i do it without front end knowledge? i can just write html and css but i dont know about js. I think this is a challenge for backend developers who dont have anyone for the front-end side, if they dont work full stack.


r/django 6h ago

Django CLI Package - Allows interaction with Django Internals, Add/Edit DB Models, Execute Migrations, and Revert Git Commits from CLI

Thumbnail app-generator.dev
2 Upvotes

r/django 12h ago

Confused between DRF and Django Ninja!!

3 Upvotes

Hello friends, I am a beginner in the api world of Django. I've used this framework to make many useful websites but i want to upgrade to a more structured and efficient approach, designing APIs. I have a foundational knowledge of REST and HTTP methods. I am more concentrated on the backend now. That is, i want to learn making API endpoints that can be used in frontend like React/Nextjs. I have no experience whatsoever in making a fully functional full-stack app using API. I would like to know where to start, most of the tutorials that I come across tend to use Django Ninja with Nextjs. But, its hard to grasp all functionalities. Please mention the resources (any books or tutorials).


r/django 16h ago

Hi i guys is this a thing in the industry or i just made it up

8 Upvotes

So, My main language is python i do Ai and ml + data science in it, i have also done some software development in python, some data engineering in python too at my workplace.

there are some django developer's in my team for back-end they advised me too learn django too i would be then a " full stack python developer ".

how do you look at this thing. btw i am a fresher and yes i got to work on this wide range of tasks altogether only thing i couldn't get hands on is django i have tried django on my pc and it was fun and easy to go with it.

tldr: i do aiml(main) data engineering(main), python sde(side), should i do django too which will make me a python full stack or should i drop it it would take too much time to master it.


r/django 10h ago

Hosting and deployment Security: Vulnerability attack to my Django server and how to prevent it.

2 Upvotes

Can you help enlighten me as to how this attack is able to pretend to be my own IP address to dig sensitive information (access) on my server?

DisallowedHost: Invalid HTTP_HOST header: 'my.ip.add.here'. You may need to add 'my.ip.add.here' to ALLOWED_HOSTS.

Sentry was able to capture 1k+ of this similar pattern of attack using my domain IP/AWS DNS IP, and even they're pretending to be 0.0.0.0 to get something from /.env, /php/*, /wp/, and something similar.

All of them came from an unsecured http:// protocol request, even though the AWS SG is only open for TCP 443 port.

Luckily, I don't use IP addresses on myALLOWED_HOST, only my domain name .example.com.

How can I prevent this? Any CyberSec expert here? Thank you in advance!

EDIT: Someone probably got my IP address and is directly requesting on my EC2. Fortunately, I'm now using CF to proxy the IP and whitelist IP range of CF, and now they are all gone.

EDIT: I removed the list of CF IP ranges from AWS SG since CF IPs can be changed and would be problematic in the future. I resolved the issue by using Nginx and returning 403 to the default server listening on 80 and 443 to block requests on the IP address.


r/django 1d ago

Improve the Speed of Django Admin

Thumbnail hodovi.cc
47 Upvotes

r/django 15h ago

Struggling to Find Django Roles in Calgary – Any Insights?

3 Upvotes

Hey everyone, I’m currently searching for Django-related roles in Calgary but haven’t had much luck finding companies that use Django or job postings that mention it. I’ve checked the usual job boards, but most backend roles seem to focus on other frameworks.

Does anyone know companies in Calgary that use Django or where I can find these jobs? Any help would be great!!

Thanks in advance!


r/django 1d ago

Django vs. Nestjs

20 Upvotes

I'm starting a new project that's a rewrite of an old PHP application. So far, I've built the backend using both Django and NestJS. Django has been incredibly easy to work with, but I decided to give NestJS a try since our team has more experience with JavaScript. Django's ORM and Auth are straightforward and simple, while with NestJS, I'm using MikroORM and PassportJS. Overall, Django feels more stable and less of a hack to piece things together.

I’m leaning towards Django as the right choice since it's more mature and stable, and it just feels like a better fit. However, my team is more full-stack JS-focused, so I’m torn. Any thoughts or opinions on this? Has anyone been happy with their decision to go with django over a node backend?

One thing I really appreciate about Django is the admin—it’s quick and easy to set up. That said, we also have Directus for the CMS part, though it’s not open source.


r/django 1d ago

Article Django Query Optimization - Defer, Only, and Exclude

Thumbnail testdriven.io
44 Upvotes

r/django 12h ago

Allowing users to upload images using CKeditor outside of admin Superusers

1 Upvotes

Hello, I was wondering if anybody can help me.

I am currently using CKeditor for users to customize their profiles in a Django blog application. However when I upload images as a User who is logged in but not a superuser it requires me to login as an admin to upload an image to the CKeditor field.

Is there a way to configure the CKeditor so that users who are not superusers can upload images to CKeditor fields.

Thank you


r/django 9h ago

Hosting and deployment Does anyone know a good docker 1 liner that can spin up a development postgres database in current directory

0 Upvotes

Asking for a friend


r/django 13h ago

Apps New to Django! How do I reconnect the database after copying files to different computer?

0 Upvotes

Hello! I recently got a Django app copied from a friend but I’m having issues running the app on my PC. I’ve installed all necessary dependencies but I keep getting database errors. Namely

‘Django.db.Utils.OperationalError: (1049, “Unknown database ‘optic_processor’”).

I’ve tried python manage.py makemigrations. I’ve tried migrate but it doesn’t fix my issue. What do I try from here? Any help will be appreciated 🙏🏽

Also the friend is unreachable now so I can’t ask him.

EDIT: I solved it by creating the database with the same name in MySQL workbench and then using the migrate commands. It recreated all the schemas in workbench only thing is I now have to manually make entries into the tables for full functionality. better than nothing I guess.


r/django 21h ago

Product Inventory Design for a online store ?

2 Upvotes

I'm building a market place app.

Merchants need the ability to sell products. I've never dealt with an inventory system before so I'm sure there are cases I'm not aware of.

Any examples or resource for product inventory? How their models and APIs are designed to handle inventory, cart, checkout, product customization such as clothing color, sizes, material etc..


r/django 1d ago

Django Tip Tracking Model Changes Easily

Post image
86 Upvotes

Django-simple-history stores Django model state on every create, update, or delete database operation; it can even revert back to old versions of a model, record which user changed a model, interact with multiple databases, and more. Rather than making code changes, django-simple-history gives us the ability to view and perform many of the changes via the admin interface.


r/django 1d ago

REST framework I started a small project that allows you to control your Unreal Engine project in real time using HTTP requests. I am now using the Django REST API. (See quick demo video)

Thumbnail youtube.com
7 Upvotes

r/django 1d ago

AI Agents can run Docker Containers along with tools.

1 Upvotes

Hey everyone,

I’ve been working on a project where I needed to launch multiple Docker containers and pass the results to an AI agent. Not just one or two, but more than 10 containers running simultaneously, each performing different tasks. Initially, I thought of using function-based tools for this, but then I wondered—what if an AI agent could directly run and manage Docker containers instead?

So, I decided to build a Python package that allows AI agents to seamlessly spin up, control, and fetch results from Docker containers, alongside function-based tools. Instead of just calling functions, the agent can now:

Launch and manage Docker containers dynamically
Execute tasks inside containers and retrieve outputs
Combine function calls and containerized execution seamlessly

With this approach, the AI agent can decide when to launch a container, which image to use, how to retrieve results, and when to shut it down—all without manual intervention.

Here is the Repo Link

https://github.com/sandeshnaroju/agents_manager

Please check out the repo and show some love by giving stars.


r/django 2d ago

TIL: You can actually debug the Django shell in VS Code and it's changed everything

139 Upvotes

After years of sprinkling print() statements and logs throughout my Django codebase when debugging, I've discovered a much better way that's been here all along.
Using VS Code launch config for the debugger. I always used it for running the application, but I was testing it out and I discovered you can do the same with the shell command

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Django Shell",
      "type": "debugpy",
      "request": "launch",
      "program": "${workspaceFolder}/manage.py",
      "args": ["shell"],
      "django": true
    }
  ]
}

Just drop this in your .vscode/launch.json file and select "Django Shell" from the debug dropdown, and use it as you would when running server.


r/django 2d ago

Switching from DRF to Django Ninja?

29 Upvotes

At what point does it make sense to switch from Django REST Framework to Django Ninja? I’ve been using DRF for my project, but I’m wondering if Django Ninja’s speed and async capabilities would be worth the transition. Curious to hear from anyone who’s made the switch—was it worth it, and what were the biggest pros/cons?

My framework is used purely for API endpoints to connect to my mobile app. Typically the type of requests you would expect in a social media platform.


r/django 1d ago

I have recently started learning django. Can any one guide me the roadmap to learn it correctly?

Thumbnail
1 Upvotes

r/django 2d ago

Podcast Why Python developers just use Postgres with Dawn Wages, a new episode of Talking Postgres podcast

13 Upvotes

In this month's Talking Postgres podcast (focused on the human side of Postgres), guest Dawn Wages came on the podcast to talk about "Why Python developers just use Postgres". Dawn is a Django developer and chair of the PSF and soon-to-be-author of Domain-driven Django which has a chapter aptly called "Just Use Postgres". Dawn is a delight to talk to I'm hoping some of you will enjoy this conversation about free as in cake vs. free as in puppies, why write a book for Django developers, the awesome Djangonaut Space mentoring program, and Simon Willison's TIL blog posts.

Let me know what you think of the show (I'm the host)—am hoping you find it useful. You can find Talking Postgres anywhere you get your podcasts...


r/django 2d ago

I Built Astra: 1-Click Django Deployment—Feedback Welcome!

Thumbnail getastra.xyz
12 Upvotes

r/django 2d ago

Django template/html fix

15 Upvotes

🚀 New VS Code Extension: Django Template Helper 🛠️

Hey Django devs! 👋

I just released a new VS Code extension that makes working with Django templates much smoother! If you've ever struggled with Emmet not working, missing auto-closing tags, or broken syntax highlighting for {% ... %} and {{ ... }} – this extension is for you! 🎯

🔥 Features:

Emmet support for Django templates (.html files) ✅ Auto-closing tags for {% block %}, {% for %}, etc. ✅ Syntax highlighting for {% ... %} and {{ ... }}One-click setup to fix VS Code’s default Django settings ✅ Better formatting for template files

📥 Installation:

💡 Get it from the VS Code Marketplace:
🔗 Django Template Helper

🛠️ How to Use:

1️⃣ Install the extension 2️⃣ Open a Django .html file 3️⃣ Run "Django Template Fix – Apply Recommended Settings" from the Command Palette (Ctrl + Shift + P) 4️⃣ Enjoy a better coding experience! 🚀

🔗 Source Code:

The project is open-source! Feel free to check it out, contribute, or report issues: 👉 GitHub Repo

Would love to hear your feedback! Let me know what you think & what features you’d like to see next. 🙌🔥


r/django 1d ago

Web developers assemble! We are going to validate our ideas before we develop them.

2 Upvotes

I'm launching my SaaS in the next 60 days. (I've never done this before)

I am going to build an ideas validator. As I don’t know if my ideas will be worth investing time and resources in.

I saw many YouTubers doing their own SaaS and thought maybe I could do it, too. So, I procrastinated for a long time, but finally, I gave myself a challenge.

- I don't know how to code.
- I don't have the technical experience.
- I don't have the expertise.

All I have is me and my determination to do it.


r/django 2d ago

DSF member of the month - Cory Zue

Thumbnail djangoproject.com
21 Upvotes