Jimmies San
a ton of reasons
Heigler Rocha
Why do you need extra servers ?
I mean, because I can't communicate with a sockeio cli with wsgi, right? I need a flask-sockeio running somewhere
Heigler Rocha
yes, some javascript listening and sending events
Anders (izzno / gooood) 🇳🇴
Command Line Interface ...
Anders (izzno / gooood) 🇳🇴
What do you mean?
Anders (izzno / gooood) 🇳🇴
a cli is something you use with a terminal (or emulator as such)
Anders (izzno / gooood) 🇳🇴
Do you mean event's trigger CLI commands ?
Anders (izzno / gooood) 🇳🇴
Did you mean the api ?
Heigler Rocha
Yes, the api
Heigler Rocha
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js" integrity="sha256-yr4fRk/GU1ehYJPAs8P4JlTgu0Hdsp4ZKrx8bDEDC3I=" crossorigin="anonymous"></script> <script type="text/javascript" charset="utf-8"> var socket = io(); socket.on('connect', function() { socket.emit('my event', {data: 'I\'m connected!'}); }); </script>
Anders (izzno / gooood) 🇳🇴
ahh
Heigler Rocha
This code for example, how can I handle it without flask-socke-io?
Anders (izzno / gooood) 🇳🇴
you cant
Heigler Rocha
Need another server, right?
Anders (izzno / gooood) 🇳🇴
it's socketio ;)
Anders (izzno / gooood) 🇳🇴
yep
Anders (izzno / gooood) 🇳🇴
But you said the admin panel is in heavy use right, theres a flask-socket io aside from that. You have DRE running.... What seems to be the problem ? ;)
Heigler Rocha
Is this approach hehe, now its getting messy with more real time features, I've to handle sessions manualy to pass a django user to a flask user per example
Heigler Rocha
Do you think is more productive to go with pusher or something like that instead Django+Flask-socket-io or channels?
Anders (izzno / gooood) 🇳🇴
I dont know. I have no experiance with that I am affraid...
Anders (izzno / gooood) 🇳🇴
I would not rewrite to websockets though... ;)
Anders (izzno / gooood) 🇳🇴
But I would find a way and wait for Django to catch up... (you said something about heavy admin and DRE ussage and Django just confirmed async in 3.0 and socketio kind of goes with the teritory... FE integrations need to get better in Django and their on it as far as i can see. Dont rewrite something that works unless it\s a security issue.
Heigler Rocha
I think its a good advice, like I said in beginning I got stuck with basic things with channels, and there are few tutorials out there 😐
Heigler Rocha
Well, let see what happens, thanks Anders!
Anders (izzno / gooood) 🇳🇴
godmode
I got a Form in a class FormMixin with a DetailView and when i make a print(form) the selector of field post in the form is not selected i tried in get_context... to make objects['form'] = CommentForm(initial={'post': self.object}) but is not working... this is my code...
godmode
https://github.com/Godm0de/uec/blob/master/uec/apps/blog/views.py
godmode
any idea?
Habib
Guys do you have any flutter or mobile app group?
Anonymous
Hi guys, I am adding new language to django but when I added i get error invalid token in plural form: EXPRESSION, I searched on internet , a lot of people asked this question but no answer, anyone can help me?
Aaron
Hey, how do I do something I only want to do once, but that I need a request to do?
Aaron
Putting it in a middleware seems like overkill - the middleware will run on every single request, whether or not it's the first time.
Aaron
And even if it starts with a bool it still seems very coupled
Aaron
Essentially I need to set the site's hostname on something, but I only know the hostname from a request. Site.objects.get_current().domain is getting me an IP and port
Aaron
and I really need the hostname.
Михаил
Do it in the middleware, when you have better solution just make it another way
Anonymous
How i use date and time picker in my template without any external dependency?
Chowdary
Does anyone have django notification tutorials
Anders (izzno / gooood) 🇳🇴
Does anyone have django notification tutorials
What do you mean by notification?
Anders (izzno / gooood) 🇳🇴
In Django you have messages but if you want to send notifications somewhere I would look at https://github.com/caronc/apprise/blob/master/README.md Do it in the views.
godmode
okey, i think i got all the answer for all my problems in life... well not at all, but all about django....
godmode
I need sombody who code django classed-based things... to explain a simply thing
godmode
i learn to code object oriented in Java like three years ago, and i'm spending a lot of time learning how django works with the classed cuz i came from funtions and i use to make one class per html page... This classes are pretty big each one!
godmode
and then i see codes like this one in github...
godmode
https://github.com/kgmaxwell1990/django2-blog-class-based-views/blob/master/posts/views.py
godmode
the main problem for me is.... the guys who codes in classes-based how the hell do you refer each views objects in the template... cuz if i say object could be any DetailView... are all the classes working for all the templates?
godmode
Can somebody explain just two lines of that...
godmode
aaaaaaaaa i seeeee baby
godmode
does django got a kind of generic template names ? cuz django return me blog/post_list.html
Chowdary
What do you mean by notification?
Suppose one user commented on another user's post... Theb we should notify that user.
Chowdary
These kind of notifications... I have tried django notifications library and other ones but there is no perfect example for how to use those
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
For realtime notifications use django channels
Stanislav
Hello. What is best practice a visualization data with Django, SQL (via Django orm) and Django rest?
Heigler Rocha
the main problem for me is.... the guys who codes in classes-based how the hell do you refer each views objects in the template... cuz if i say object could be any DetailView... are all the classes working for all the templates?
There is a default template_name attribute in class definition, for DetailViews is "<your_app>/<your_model>_detail.html" for Create and UpdateView is "<your_app>/<your_model>_form.html"
Heigler Rocha
But you can override them
Stanislav
Bokeh if u wanna still write py code
I read about this today. I think between highcharts of bokeh. But bokeh will be lightly
Ghorz
Holla guys, had Anyone implemented python shell on Web page. I can send terminal commands from django to the pc shell but running a python shell directly in my django template proof to be difficult.
Mirco
!offtopic
Doragonsureiyā
looks like you need an offtopic group, please continue this conversation at @pythonofftopic
Brian
Hey guys
Brian
Quick question. I need to hit my delete method. All my views methods are working well but i can't seem to fing the default delete url provided by the defaultrouter
Anonymous
Hello guy
Anonymous
I want to creat user with some information like phone number and etc with restframework . How can I do that?
Dhave
has anyone tried Django with Angularjs? Any performance issues?
Maksim
What's problem?
Maksim
Use DRF
Orack
https://ibb.co/ZK6c1KR
Orack
https://ibb.co/ZK6c1KR
how do i print these errors in html response ?
Orack
Response{protocol=http/1.1, code=400, message=Bad Request, url=http://192.168.1.104:8000/registration/}
Orack
I'm only getting Error bad request, I want username already exists
Dani
no such table: main.auth_user_old...how can I fix this in django
Dani
i did the makemigrations and migrate but z problem is not solved django version = 2.1 python =3.7.3 sqlite3 version = 3.27.2