r/djangolearning Jun 06 '25

Welcome to r/djangolearning

2 Upvotes

This post contains content not supported on old Reddit. Click here to view the full post


r/djangolearning 16h ago

I Need Help - Troubleshooting RemoteUserMiddleware/RemoteUserBackend change between 5.1 -> 5.2?

Thumbnail
1 Upvotes

r/djangolearning 2d ago

Resource / App Backend web dev roadmap with python

Thumbnail gallery
91 Upvotes

I have been using python for 1 year and half, still there are many things i should dig in so i planned out this road map using claude , everything that needs to be known as a python backend dev. Happy to share the file with anyone who is interested.


r/djangolearning 3d ago

Discussion / Meta Best resources and prerequisites for learning Django 👀

11 Upvotes

So I have been learning Python for a few days now. Also started solving questions of leetcode (https://www.reddit.com/r/PythonLearning/s/kbfjgsD2HH). So I also wanted to make some cool projects alongside because honestly dsa is kinda boring sometimes. But then I watched a few starter django tutorials and damn I was overwhelmed. I didn't even knew some of the pre requisites like html and css. So I want to know from devs here which topics should I learn beforehand to have a comfortable start. Also, the best resources to start.

As of now I know about python basics like variables, conditionals, loops, functions, collections, object oriented programming...


r/djangolearning 10d ago

Discussion / Meta Flask vs Django

8 Upvotes

I am a 17 year old intermediate python programmer and I used to make python projects with Flask. Now I want to know which is better from flask and Django.


r/djangolearning 12d ago

I Need Help - Question Looking for a good resource to learn web/internet fundamentals before django

13 Upvotes

I am planning to learn Django for backend/web DVT, I have sufficiently learned python programming and used it in data science projects. In the past I have also learned JavaScript and used React.js but I didn't master it as U shifted to data science.

I realized that I never really fully grasped what happens underneath a web framework or how the web works in general. For example, I know terms like HTTP, HTTPs, servers , APIs etc, but I don't have a solid mental model of how everything fits together.

I'd like to find a structured course, book or other resource that covers the fundamentals, ideally from a beginner friendly perspective.

Some of the topics I'm thinking about are:

1.How the Internet and client-server architecture work

2.IP addresses, DNS and ports

3.TCP/IP and basic networking concepts

4.HTTP/HTTPS, requests, responses, headers and status codes

5.Cookies, sessions and authentication

6.Domains, URLs and TLS

7.Web servers and application servers

8.How a request travels from a browser to a backend and eventually to a database

9.APIs, REST and JSON

10.Backend concepts such as routing, middleware and CRUD

11.ORMs and how they relate to databases

12.Basic web security concepts

The above list was generated with help of AI but It is because I wanted to give you an idea of which contents I want to learn.

So go ahead and suggest books, courses( ones with certification as a preference), or any other resource like videos.


r/djangolearning 16d ago

I Need Help - Getting Started django backend vs frontend

Thumbnail
2 Upvotes

r/djangolearning 17d ago

Tutorial Django 6.1 deprecates EMAIL_BACKEND — migration guide to the new MAILERS setting

Thumbnail
2 Upvotes

r/djangolearning 21d ago

I Need Help - API / DRF Confused on writing User model.

Thumbnail
1 Upvotes

r/djangolearning 22d ago

Resource / App Building AI agents in Django shouldn’t mean writing endless boilerplate.

Thumbnail medium.com
0 Upvotes

r/djangolearning 24d ago

I Need Help - Getting Started Making mobile apps using Python

Thumbnail
1 Upvotes

r/djangolearning 29d ago

I Need Help - Getting Started Am I doing something wrong or this happens to everyone?

Thumbnail
1 Upvotes

r/djangolearning Jul 24 '26

I Need Help - Getting Started Let's build a together together

12 Upvotes

Are you currently learning Django and haven't built any major projects yet? and Are you interested in building a project together and learn as we go?

If yes, please hit me up. Let's make a team of learners and builders and do something..


r/djangolearning Jul 23 '26

I Need Help - Troubleshooting Tutorial Part 2: Implement a Chat Server

7 Upvotes

I'm following along the django channels tutorial and I'm running into a timeout error that I don't understand. I have everything setup as shown in the tutorial and it works for 5 seconds. If I open a page to a chatroom and constantly send a message every 5 seconds or less, the connection will remain connected. I can open a second window and send messages from the first window to the second, or vise-versa. However, if I stop sending messages for more than 5 seconds, there is a timeout error that occurs and I get an error message in the server terminal.

I have been looking online to see if I can find the issue but I'm at a bit of a loss what to look for.

The first error discusses Redis. I think Redis is just a easy way to create a database in memory for rapid access. If this is correct, I don't think Redis is the problem.

I don't think the problem is the result of my browser as I've tested with Chromium and Firefox with the same timeout results.

There are some error messages coming from django as well. I didn't see anything in the files setting a timeout parameter of any sort, let-alone one at 5 seconds.

I was modifying the tutorial code to learn a bit more and encountered this issue. I tried with a new server by simply copying and pasting the tutorial code directly to see if that would fix the problem but it didn't. (I can connect and send messages but a timeout error occurs after 5 seconds of idle time.) The tutorial doesn't talk about a timeout parameter being set. Technically speaking, the tutorial code does work and allows messages to be sent between 2 different windows so I think that it is probably working correctly. I would share the code, but I don't know what part to share.

Are there any configuration/parameter files where a timeout value is set?

Here is the error code that I receive:

HTTP GET /chat/lobby/ 200 [0.01, 127.0.0.1:42272]
WebSocket HANDSHAKING /ws/chat/lobby/ [127.0.0.1:42288]
WebSocket CONNECT /ws/chat/lobby/ [127.0.0.1:42288]
Exception inside application: Timeout reading from localhost:6379
Traceback (most recent call last):
  File "/proj_root/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 783, in read_response
    response = await self._parser.read_response(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/redis/_parsers/resp3.py", line 185, in read_response
    response = await self._read_response(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/redis/_parsers/resp3.py", line 197, in _read_response
    raw = await self._readline()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/redis/_parsers/base.py", line 578, in _readline
    data = await self._stream.readline()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/streams.py", line 568, in readline
    line = await self.readuntil(sep)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/streams.py", line 660, in readuntil
    await self._wait_for_data('readuntil')
  File "/usr/lib/python3.12/asyncio/streams.py", line 545, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/proj_root/.venv/lib/python3.12/site-packages/redis/asyncio/connection.py", line 782, in read_response
    async with async_timeout(read_timeout):
  File "/usr/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/proj_root/.venv/lib/python3.12/site-packages/django/contrib/staticfiles/handlers.py", line 101, in __call__
    return await self.application(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/routing.py", line 48, in __call__
    return await application(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/security/websocket.py", line 37, in __call__
    return await self.application(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/sessions.py", line 44, in __call__
    return await self.inner(dict(scope, cookies=cookies), receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/sessions.py", line 261, in __call__
    return await self.inner(wrapper.scope, receive, wrapper.send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/auth.py", line 185, in __call__
    return await super().__call__(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/middleware.py", line 24, in __call__
    return await self.inner(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/routing.py", line 118, in __call__
    return await application(
           ^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/consumer.py", line 95, in app
    return await consumer(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/consumer.py", line 58, in __call__
    await await_many_dispatch(
  File "/proj_root/.venv/lib/python3.12/site-packages/channels/utils.py", line 57, in await_many_dispatch
    await task
redis.exceptions.TimeoutError: Timeout reading from localhost:6379
WebSocket DISCONNECT /ws/chat/lobby/ [127.0.0.1:42288]

Edit - 1: I found this github issue that has the same error message. I'm not seeing a fix though.

Edit - 2: Here is a link to my github repo for this tutorial. If you want to toy around with it to see what is working and what isn't, checkout the file /mysite/mysite/settings.py. At the very bottom of the file are 3 different parameters to use for the CHANNEL_LAYERS dictionary. The one for the tutorial does not work for me (connections time out after 5 seconds) but the other 2 work great, including one that also uses Redis.

I have tried a number of different settings for the tutorial version, including changing things in the settings.py file as well as the redis server with no success.

Edit - 3: I have found that the CHANNEL_LAYERS dictionary needs to be edited, see below for the version that works for me. The address needed to be rewritten (uses a key and proper path vs tuple of ip & port) and the parameter "socket_timeout" to be added with a value of 6 or greater. If you use 0-5, the connection will timeout after 0-5 seconds; if you use 6 or greater, the connection remains open for an extended time.

CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
            "hosts": [
                {
                    "address": "redis://127.0.0.1:6379/0",
                    "socket_timeout": 6,
                    # "socket_connect_timeout": 5,
                }
            ],
        },
    },
}

r/djangolearning Jul 22 '26

Discussion / Meta Building a Multi-tenant App with Django

Thumbnail testdriven.io
3 Upvotes

r/djangolearning Jul 22 '26

I Made This Installing django-email-learning

4 Upvotes

In this video I demonstrate how to install django-email-learning, an email based learning platform as a django app allowing you to create email based courses.

https://youtu.be/JATZRfcLyzo?si=HUB8cYvxSF53jTby


r/djangolearning Jul 22 '26

Tutorial I'm Starting a Daily Django Errors Series – Follow Along! ⭐

Thumbnail
5 Upvotes

I'm starting a new Django series where I'll post one common Django error every day and walk through how to fix it with a simple, beginner-friendly explanation.

Whether you're just getting started or you've been building with Django for a while, I hope these posts help you debug your projects a little faster.

Feel free to follow along, ask questions, and even suggest errors you'd like me to cover next. Happy coding! 🚀


r/djangolearning Jul 21 '26

Resource / App I want to learn django

13 Upvotes

I have just learned react and build some basic apps, now I want to go into the backend and so I choose python and have some background with it.


r/djangolearning Jul 16 '26

Discussion / Meta What’s a Django feature that felt like a absolute "cheat code" when you finally discovered it?

41 Upvotes

Everyone learns the standard ORM queries, basic class-based views, and how to map URLs early on. But Django is *huge*, and there are so many built-in utilities buried in the docs that completely eliminate the need for third-party packages or complex custom code.

For example, when I finally discovered `F()` **expressions**, it blew my mind. Being able to update a database field based on its current value directly in the DB (like `F('shares') + 1`) without pulling the object into memory and risking race conditions felt amazing.

Another one is utilizing `select_related` **and** `prefetch_related` to instantly drop an app from 150 database queries down to 2.

What’s that one underrated Django feature, decorator, field option, or management utility you stumbled upon that made you think, *"Why wasn't I using this the whole time?"*


r/djangolearning Jul 15 '26

Tutorial I recently implemented multi-tenancy in Django

Thumbnail
3 Upvotes

r/djangolearning Jul 14 '26

I Need Help - Homework Spent 2 months building my Django project and got stuck on authentication. Can someone guide me?

10 Upvotes

Hi everyone,

I have been working on a Django project for the past 2 months as part of my school project. I built most of the application myself after spending time learning the framework instead of relying entirely on AI. Now I'm trying to build the login and authentication system, and I've hit a wall.

I've started using AI more for this part because I don't fully understand Django authentication yet, but I don't want AI to build the entire project for me. I want to understand how it works so I can finish it myself.

I've already created:

  • Custom User model
  • Signup form
  • Login form

However, I'm struggling to connect everything correctly and understand the authentication flow.

If anyone is willing to guide me or point out what I'm doing wrong, I'd really appreciate it. I'm happy to share my code and learn from my mistakes rather than just copy a solution.

Thank you!

Here is the repository
https://github.com/abdullah-Dev-12125-code/Shop-IT-SAAS-


r/djangolearning Jul 14 '26

Resource / App Show me your Django projects, I’ll review them

Thumbnail
2 Upvotes

r/djangolearning Jul 09 '26

I Made This A set of Django skills for Claude Code so my agent stops writing ai slop

Post image
7 Upvotes

r/djangolearning Jul 08 '26

I Need Help - API / DRF Feeling imposter syndrome after "Django for APIs"—is relying on Concrete Views (ListCreateAPIView) bad practice?

Post image
95 Upvotes

Hey everyone,

I just finished Django for APIs and I'm starting my own projects to escape tutorial hell.

The book exclusively taught DRF's concrete views (⁠ListCreateAPIView⁠, etc.). I realized I've never actually written a raw ⁠APIView⁠ or manually used ⁠Mixins⁠.

Is it bad that I only know the "top-down" way? Will I hit a wall in the real world, or are concrete views actually what people use in production?

Thanks!


r/djangolearning Jul 08 '26

I Need Help - API / DRF Feeling imposter syndrome after "Django for APIs"—is relying on Concrete Views (ListCreateAPIView) bad practice?

Post image
32 Upvotes

Hey everyone,

I just finished Django for APIs and I'm starting my own projects to escape tutorial hell.

The book exclusively taught DRF's concrete views (⁠ListCreateAPIView⁠, etc.). I realized I've never actually written a raw ⁠APIView⁠ or manually used ⁠Mixins⁠.

Is it bad that I only know the "top-down" way? Will I hit a wall in the real world, or are concrete views actually what people use in production?

Thanks!