Django Bot
>> Blogs - Evennia in Hacktoberfest 2017
Anonymous
Guys
Anonymous
In unit tests, when I send a get request to an url and it redirects to another
Anonymous
and then assertTemplate
Anonymous
Will it count?
Anonymous
like If I assert for the redirected url template
Django Bot
>> Blogs - A Complete Beginner's Guide to Django - Part 5
Anonymous
Hello guys , I was wondering if someone has idea of how to create a realtime-chat application without JS files only with SQL and Python/Django ?
Ghazwan
Why don't you want to add js files?
Ghazwan
Use librejs if you're Stallman follower
Anonymous
Why don't you want to add js files?
https://www.leaseweb.com/labs/2013/07/10-very-good-reasons-to-stop-using-javascript/ That's why , besides I am not good with JS
Anonymous
Do you have any ideas of how that can be done ?
Anonymous
Thanks
Ghazwan
Ghazwan
But not recommended
Anonymous
But not recommended
can you explain me why please ? , is that has something to do with security/privacy?
Ghazwan
can you explain me why please ? , is that has something to do with security/privacy?
No no, brython or anything else will be implemented to JavaScript in the end, no browser runs any other programming language beside JavaScript
Ghazwan
You won't work alone, in teams they all write js and you are the only one who write python in the client side which is unacceptable
Ghazwan
You must learn JavaScript
Anonymous
That's clear enough , Thanks man
inchidi
no problem with the backend, django can do it. but to make sure its "realtime" you will need jacascript in your browser if its webapp. html and css cant do that alone
Anonymous
actually it doesn't matter if it's realtime , it's okey if it will take few seconds to receive message (after refreshing the page of course) .
Anonymous
I just didn't figure out how to do it exactly
Django Bot
>> Jobs - Python / Django Developer - Python / Django Developer >> Blogs - Understanding Routers in Django-Rest-Framework
karry
What have i done wrong here?
inchidi
I just didn't figure out how to do it exactly
the prerequisites is websocket, and django channel. i think thats gonna be your start line
inchidi
there written indentation error
inchidi
>>>for board in board_list:[enter] >>>[space]print(board)[enter] >>>[enter]
Anonymous
I really appreciate that
karry
Thanks
let me try it out
Anonymous
you have this github repository with a few examples even multichat app
Anonymous
https://github.com/andrewgodwin/channels-examples
Anonymous
Hello Juan B , thanks for replying WebSockets requires JS enabled on the browser , and this example contains JS files
Anonymous
the example just has jquery as dependency, it's right you need to be enabled any option in the browser but that just if you don't have you webpage secured with ssl
Anonymous
you can try to download the example and run it, I didn't need change any option in my browser
Anonymous
and y teammates neither
Anonymous
I got that , thanks I'll try it right now (y)
Abhi
i have a function that will list the files and directories from a given folder.
Abhi
how can i write unitest for it ? what thing should i test ?
Anonymous
check if goes wrong if it's used wrongly
Anonymous
check it's flexibilty
Anonymous
why do ya guys use test.py like a lot ?
Anonymous
i debugg frm user prespective 😂
Lapanit ☃️
i debugg frm user prespective 😂
Thats not debugging, thats testing
Anonymous
Yeah
Django Bot
>> Blogs - Upgrade All Pip & Python Packages & Store an Archive
Django Bot
>> Blogs - Overriding Django Model behaviour with Proxy Model - how to pass extra context data to serializers in django-rest-framework ?
Ghazwan
What's you guys best practice in django ? Template directory for each app or main template dir with apps in it ?
Ghazwan
I hear it's usual to have template dir for each app but it feels kinda messy
Anonymous
It depends
inchidi
What's you guys best practice in django ? Template directory for each app or main template dir with apps in it ?
i prefer one template dir just because i like naming my templates dirs 😄
Django Bot
>> Jobs - Senior Web Backend Developer
inchidi
i prefer one template dir just because i like naming my templates dirs 😄
i mean something like this templates ├── admin_pages │ ├── base.html │ └── ... └── user_pages ├── base.html └── ...
Ghazwan
It depends
On what ?
Ghazwan
i mean something like this templates ├── admin_pages │ ├── base.html │ └── ... └── user_pages ├── base.html └── ...
I do it like that too, I read once a great post on stackoverflow regarding to that, can't find it anymore
Ghazwan
Don't create template dir for each app, that was the title
Django Bot
>> Jobs - Tech Lead
Anonymous
return queryset.filter(user__username__iexact=self.kwargs.get("username"))
Anonymous
old school here, is kwargs.get necessary here ?
Anonymous
it's queryset in listview that return all the articles that are posted by a certain user
Anonymous
yes
Anonymous
actually it depends on what you named the dict arguement
Anonymous
or prefixed with **
Ghazwan
https://medium.com/@raiderrobert/djangos-selected-related-is-basically-magic-20fffaf834fa
Ghazwan
i did not know it is that important.
Anonymous
wow! I never read about that