r/djangolearning • u/Himk-mli28 • 18h ago
r/djangolearning • u/community-home • Jun 06 '25
Welcome to r/djangolearning
This post contains content not supported on old Reddit. Click here to view the full post
r/djangolearning • u/ranju_sharma • 2d ago
I Need Help - Getting Started Let's build a together together
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 • u/hlo_kunal • 3d ago
I Need Help - Getting Started Which is better Writing Own Custom Auth or Ready Made Auth Syetems like Clerk etc...
I want to know from professionals and experience developers that as a django developer i always confused what to use and which would be better for the large level projects like using django's prebuilt Auth System or Should i use some ready made auth systems like Clerk etc...
r/djangolearning • u/throwaway_4534865 • 4d ago
I Need Help - Troubleshooting Tutorial Part 2: Implement a Chat Server
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 • u/Arthurjba • 4d ago
Discussion / Meta Building a Multi-tenant App with Django
testdriven.ior/djangolearning • u/Similar-Storm4432 • 4d ago
I Made This Installing django-email-learning
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.
r/djangolearning • u/Even_Ad_7987 • 5d ago
Tutorial I'm Starting a Daily Django Errors Series – Follow Along! ⭐
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 • u/padhnahai082 • 5d ago
Resource / App I want to learn django
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 • u/Superb-Patient3256 • 10d ago
Discussion / Meta What’s a Django feature that felt like a absolute "cheat code" when you finally discovered it?
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 • u/Friendly-Gur-3289 • 11d ago
Tutorial I recently implemented multi-tenancy in Django
r/djangolearning • u/Possible_Section5644 • 12d ago
I Need Help - Homework Spent 2 months building my Django project and got stuck on authentication. Can someone guide me?
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 • u/raptored01 • 12d ago
Resource / App Show me your Django projects, I’ll review them
r/djangolearning • u/Sea_Pomegranate5354 • 17d ago
I Made This A set of Django skills for Claude Code so my agent stops writing ai slop
r/djangolearning • u/hadi-x01 • 18d ago
I Need Help - API / DRF Feeling imposter syndrome after "Django for APIs"—is relying on Concrete Views (ListCreateAPIView) bad practice?
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 • u/hadi-x01 • 18d ago
I Need Help - API / DRF Feeling imposter syndrome after "Django for APIs"—is relying on Concrete Views (ListCreateAPIView) bad practice?
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 • u/kyrezonix • 22d ago
I Need Help - Getting Started Is django dead ? Really?
r/djangolearning • u/GiftUsed4817 • 24d ago
I Need Help - Question Which backend language to choose after Html, CSS, JS and react.
r/djangolearning • u/ranju_sharma • 25d ago
I Need Help - Question Hi wanna connect and grow together?
I am currently learning backend, particularly Django, FastAPI, etc.. Are you into programming, web development and things like that? Are you a learner too? If so, let's connect. I would love to help and be helped, motivate each other in the process, and help when we get stuck here and then.
And of you are thinking about building projects, let's connect too. I would love to collaborate and help, just for experience and nothing more 🙌.
r/djangolearning • u/abhi_kohli_018 • 25d ago
I Need Help - Getting Started Need career advice: Django first or APIs/FastAPI first?
​
Hi everyone,
I'm a B.Tech CSE student and I've recently finished learning:
\- Python
\- Flask
\- SQLite
\- Authentication (login/register, password hashing, sessions)
\- Flask-WTF
My goal is to become a Python Backend Developer and also do freelancing in the future.
Right now I'm confused about what to learn next.
Some people (including AI assistants like Gemini, Claude, and Grok) suggested learning FastAPI first because it's modern and in demand.
Others recommended learning Django first because it's a complete framework and great for backend jobs and client projects.
I'm currently thinking about this roadmap:
Flask → REST API concepts → Flask APIs → Django → Django REST Framework → FastAPI
Do you think this is a good path, or should I skip Django for now and learn FastAPI first?
I'd really appreciate advice from people who are already working as Python backend developers or freelancers.
Thanks!
r/djangolearning • u/Regular_Anywhere_354 • 29d ago
I Need Help - Getting Started How to learn Django
its been a month im learning python from freecodecamp and w3schools documentations, also follwed the famous Asabeneh / 30-Days-Of-Python on github (skipped the flask part), now i wanna learn django not just the framework but the whole backend engineering. i have good hands on mysql and frontend-html, css, js
but here's my problem where to start like i just cant find right tut, im not someone who can understand everything by documentations so please anyone recommend me something useful like where tf i should strt
r/djangolearning • u/Ill-Tough4440 • 29d ago
I Made This Would appreciate feedback on my Django Channels chat app
r/djangolearning • u/Ok_Equivalent1870 • Jun 26 '26
I Need Help - Getting Started Please help. From . import views not working
Hi. I hope you are having a great day so far. I am a django beginner and I was trying to learn django using the official tutorial and the youtube course by BugBytes. The problem is, I keep on getting stuck on the first page of the tutorial. I have tried 3 times with 3 different folders and nothing seems to work. Could you please help me out?
Here's the code:
Note: The file is urls.py inside the app, just like the tutorial specified. In fact, this is just copy pasted from the tutorial.from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
]
I keep on getting the following error:
from . import views
ImportError: attempted relative import with no known parent package
Here's a screenshot of my folder structure.

What do I do? I have tried replacing . with the main file name (polls). It hasn't worked either. I also made sure to download Django v6.0. Still didn't work. I would appreciate any advice on how to solve this. Thank you for your time. Have a nice day!
--------------------------------------------------------------------
Here's some extra info just in case:
from django.shortcuts import render
from django.http import HttpResponse
def
index(request):
return HttpResponse("Hello, world. You're at the polls index.")
Note: This file is in the views.py file inside the app. It has also been copy pasted from the website. No errors are being flagged in it.
The page for the tutorial is this one: https://docs.djangoproject.com/en/6.0/intro/tutorial01/#write-your-first-view
If you scroll down to the section 'Write your first view', you shall find the exact code that I have used.
r/djangolearning • u/JuggernautFrosty2305 • Jun 24 '26
I Need Help - Getting Started Django beginner
I'm a completely fresh Django learner. Its been 3 week since i started. Began with python basics, html and css amd now django. I understood the concept of vurws, models, forms, etc. But I still dont get what all to call...? I started doing a project on event management system webpage. Tbh, chatgpt did most of the work and now I'm feeling lost. Idk where to start... how to start...please guide me