These are chat archives for django/django

23rd
Jun 2018
Curtis Maloney
@funkybob
Jun 23 2018 00:35 UTC
@NekuLp it's generally helpful for questions like that to show the full traceback, instead of summarising the error...
@softinio when does your signal get registered?
Salar Rahmanian
@softinio
Jun 23 2018 03:02 UTC
@funkybob I am using Django-rest-jwt for auth - have overriden its validate class to send user_logged_in.send event when token is generated after user valid so its in the auth module
I then have a receiver that listens for user_logged_in and does some audit logging
puttting the same receiver in my test to write a test for it
the one in actual auth app is working and I can see the audit log being made
the one inside my test never called
I have the receiver handler method as a nested function inside my test function/meothod if it makes sense
Curtis Maloney
@funkybob
Jun 23 2018 04:54 UTC
yes, but you didn't actually answer my question.
Reagan Scofield
@reaganscofield
Jun 23 2018 07:50 UTC
Hi guys is a good idea to use UUID as PK instead of integer auto_increament?
i read somewhere in stackoverflow that saying it run into problems
Suneeth Lenin
@iamsuneeth
Jun 23 2018 08:09 UTC
Hi, need help in creating scheduled tasks in django (without celery) . My requirement is to schedule it only when the server is running and not when server is shutdown state. All the googling pointed to creating cron jobs and custom commands. But that will run even if server is shutdown right?? . I am not sure weather my understanding is right or wrong . Any help will be much appreciated .
:]
@elcolie
Jun 23 2018 08:14 UTC
@iamsuneeth Without celery you can use redis and rqworker
Don't forget to put persistent volume in the Docker
@reaganscofield It is a good idea to NOT expose your volume to outside world by using id. Two Scoope of Django also mention that
But the drawback of customization in that practice is you need to customized all the entire plugins
Since the default of every Django 3rd parties are based on default
Suneeth Lenin
@iamsuneeth
Jun 23 2018 08:39 UTC
@elcolie my requirement is just to run a single job and no requirement for a distributed task scheduling also. I was hopping to use timer from threading module instead of bringing any third party dependency for just a small requitement. But the saddest part is ,I don't know from where to invoke this during django server start and cancel it during shutdown.
Curtis Maloney
@funkybob
Jun 23 2018 09:31 UTC
@iamsuneeth uwsgi has a spooling service that can easily work as a job queue... and thus will only run when the web server is running
:]
@elcolie
Jun 23 2018 10:10 UTC
@iamsuneeth Then you need to invoke the worker by os-layer not Django application layer
Suneeth Lenin
@iamsuneeth
Jun 23 2018 10:58 UTC
@elcolie so how can we stop the job if application is no longer running ?? Now there is no connection btwn both
Reagan Scofield
@reaganscofield
Jun 23 2018 15:54 UTC
Can anyone provide me with best URL pattern which can much UUID, on i tried all I fund in stackoverflow but it doesn't works
Salar Rahmanian
@softinio
Jun 23 2018 17:26 UTC
@funkybob I don’t understand? I thought using the user_logged_in.send in the validate part of auth is what registers it. Did I misunderstand?
Curtis Maloney
@funkybob
Jun 23 2018 22:31 UTC
No, that sends it. Where do you register your receiver