⚠ The htmx script tag in the header should not have the defer attribute, as the htmx extension requires it to be loaded beforehand and depends on it. The defer attribute means the script is executed only after the HTML document has been fully parsed. In the base.html file get rid of the "defer" in , so just
@Dutch-linux
4 ай бұрын
I am trying to create a click game like mobwars or like mafia wars used to be.. how do i make a clan chat where members of a clan only chat with the clan and they auto join when logged in ??
@ajudmeister
4 ай бұрын
Check out the Group Chat tutorial: kzitem.info/news/bejne/zpym4Hqbppeod4Y.
@Armin-q6p
6 ай бұрын
Excellent stuff, it really helps me a lot, thx
@zb9458
6 ай бұрын
Wow great stuff! HTMX really shines here. Amazing stuff Andreas!
@ajudmeister
6 ай бұрын
Yea htmx makes it very simple and straightforward. Thank you
@frameff9073
6 ай бұрын
good thank you
@frankwang0721
4 ай бұрын
dude, there's nothing I can't say but you are AMAZING!
@ajudmeister
4 ай бұрын
Thanks 😊
@kailasvs73
2 ай бұрын
TypeError: Group name must be a valid unicode string with length < 100 containing only ASCII alphanumerics, hyphens, underscores, or periods, not demo my group name is demo still showing this error what may be the reason
@ajudmeister
2 ай бұрын
@@kailasvs73 Maybe you are not adding it as a string with quotes: “demo” ?
@kailasvs73
2 ай бұрын
@@ajudmeister its solved actually iam passing chatroom id instead of chatroom name thanks for revert
@ummah_16
4 ай бұрын
I love it
@jdg24g
14 күн бұрын
Mine stayed in that I have to reload the page for it to send the message. I don't know where I might have gone wrong
@jdg24g
14 күн бұрын
I'm stuck at minute 15:10
@ajudmeister
14 күн бұрын
Somehow your htmx call doesn’t work. It’s saved in the database, that’s why when you reload you see it, it just doesn’t send the message straight back. Maybe a typo somewhere? You can also send me the code then I can have a look
@SmartLingua-f3s
6 ай бұрын
Amazing stack, thanks for your dedication! I wonder if Hyperscript can be used instead of JS sprinkle...
@ajudmeister
6 ай бұрын
For some things hyperscript is fantastic like resetting the input field, for other things, especially when there is more logic involved, it is harder to use. Also hyperscript is still young, so there are not many resources available.
@ashinrajm9209
4 ай бұрын
if am using react as frontend which extension do i need to use?? i have seen lot of packages in npm for it.
@ajudmeister
4 ай бұрын
Hi, you can use WebSocket API directly in React to communicate with Django Channels, or the react-websocket package.
@ashinrajm9209
4 ай бұрын
Thanks for this😁 do you have any community or other platform to interact with you??
@ajudmeister
4 ай бұрын
@@ashinrajm9209 I am not connected to any community or platform
@kaizer3937
4 ай бұрын
will there be similar videos about django-channels-restframework?
@ajudmeister
4 ай бұрын
Yes, coming in future
@IqbalArain-io3du
6 ай бұрын
thanks Andres 😽
@GotJi-it1es
4 ай бұрын
thank you for your great video. But while I was following along with you until minute 10, I encountered a problem where I couldn't connect to the websocket. How should I fix this?
@ajudmeister
4 ай бұрын
So you don’t get the handshake? Is htmx installed? Is the routing set up correctly? The problem could also be from a spelling mistake somewhere
@GotJi-it1es
4 ай бұрын
@@ajudmeister Thank you for your response. I have encountered a problem. I put 'defer' with htmx.js .... 🥲🥲
@Qubit-sj6qo
4 ай бұрын
@@ajudmeister Hii, first of all this is such an informative series, I have learnt till now. Everything was working properly untill I tried to set the websocket connection. It didnt work for some reason even after following each step. Its not completing the handshake, htmx is installled, routing is good. I have checked so many times, couldnt find any spelling mistake anyways. Can I contact you by mail or somewhere as I have been stuck here since 3 days :
@ajudmeister
4 ай бұрын
@@Qubit-sj6qo yes sure, send me the code pieces you have to ajudmeister@gmail.com then I can have a look .
@twiceasviewtiful
4 ай бұрын
@@ajudmeister I get now why some people encountered a problem. It stems from django starter assets repo. Url for htmx in base.html contains different url and defer.
@alone3759
5 ай бұрын
my http server not working when iam using daphne server if i use daphne server seprate terminal it doesnot relode the code changes
@ajudmeister
5 ай бұрын
does your website not work at all with Daphne? There might be some configurations issues then. But if you just don't see the code changes you have made, you need to restart the server. Daphne doesn't support automatic code reloading like Django's development server does.
@kaizer3937
4 ай бұрын
For some reason, after sending a message, it is duplicated under the previous ones, although one message is created in the database
@ajudmeister
4 ай бұрын
Hmm, does this happen before implementing the channel layer?
@kaizer3937
4 ай бұрын
@@ajudmeister I already fixed it, thanks, I made a mistake in the templates
@overarchingenigma
4 ай бұрын
@@kaizer3937what kind of mistake? I have the same issue
@vaig655477
Ай бұрын
@@overarchingenigma For me it was in consumers.py in receive method. I deleted self.send and other stuff that was already in message_handler
@mahmoudramadan6581
6 ай бұрын
Great ✅✅✅
@screenplay4u
5 ай бұрын
Can you please just tell me how to connect websocket with django
@ajudmeister
5 ай бұрын
Install asgi server, add server to installed apps, change to asgi application, add the websocket connection in your asgi.py file. See instructions in the video
@madhangopal5878
5 ай бұрын
Your video was good. But I have few doubts. 1) when I am using WiFi may be some time loss connection on that time. ws protocol was not able to communicate through server from client end. In this case what is your opinion.
@madhangopal5878
5 ай бұрын
How to handle this situation
@ajudmeister
5 ай бұрын
You can implement logic in your HTMX views to handle reconnection attempts. This could involve detecting when the connection is lost and automatically attempting to reconnect to the WebSocket server using JavaScript. You can use the onerror event handler of the WebSocket object to detect connection errors and trigger reconnection attempts.
@hoschi60
21 күн бұрын
Danke!
@ajudmeister
20 күн бұрын
Danke 😊
@IqbalArain-io3du
6 ай бұрын
Do you ❤ plan to upload video about multiple user roles example: [ teacher, admin, student, parent ].
@ajudmeister
6 ай бұрын
Do you mean different chatrooms for specific user groups?
@IqbalArain-io3du
6 ай бұрын
I mean handling multiple user types. For example: A django project for a school that deals with different types of users and their roles. [Admin, Teacher, Parent, Student]. Each user type has very specific roles that they can perform. I hope I am able to put this into words. Best Regards ❤
@ajudmeister
6 ай бұрын
I might build a project around it but no plans so far. One way to do this is to create individual tables for different roles so they can have unique properties. Then you can apply selected permissions and authentication to them. Django also allows you to group people together in Groups based on their roles and with specific permissions. It really depends on the project what the best approach would be.
@SpeedCodes-oc7ed
6 ай бұрын
thats amazing :D
@ajudmeister
6 ай бұрын
Thank you!
@SpeedCodes-oc7ed
6 ай бұрын
@@ajudmeister Mr Jud what do you prefer alpine ajax or htmx? and why?
@ajudmeister
6 ай бұрын
@@SpeedCodes-oc7ed I haven't tried Alpine AJAX yet, but from what I understand it returns Jason, not html. I still prefer htmx as the syntax is very simple to use and with the html response you get it integrates seamlessly into a Django project. But if you prefer a Jason response then Alpine AJAX is a great option and is super lightweight if you are already using Alpine JS.
Пікірлер: 60