How to kill a disconnected websocket?

2019-10-23 Thread Shin Yeung
Hi, I'm trying to write a Message Subscription, so I did these: 1. choose Channels and it''s WebsocketConsumer as my websocket-server 2. write a while loop, querying my message center every second 3. running the loop after websocket connected and I find that: 1. I can't

Re: Updates in production not showing up

2019-10-23 Thread James Gutu
If uwsgi is not installed, try gunicorn. Like this article here On Wed, Oct 23, 2019 at 3:02 PM Tommy Delage wrote: > Thank you for the quick response > > it was easy to restart

Re: Auto assigning 2 types of user roles on sign up

2019-10-23 Thread Nazish Akhtar
Initially you will have to create Role object and then assign it to user. and you add new roles whenever you want by editing Role model On Wednesday, 23 October 2019 21:44:10 UTC+5:30, Stephanie Semerville wrote: > > When you say: "create an instance and save it to db later", is that > dynamic?

Re: Auto assigning 2 types of user roles on sign up

2019-10-23 Thread Stephanie Semerville
Understood but what is the snippet o code that specifies the role that i would like to assign to invited user? On Wednesday, October 23, 2019 at 12:43:44 PM UTC-4, Jani Tiainen wrote: > > Hi. > > Personally I would do it as follows: > > On invitation create invited user account at least with

Re: Admin site error reporting

2019-10-23 Thread Derek
Well, assuming you have followed all the advice given in that link I posted and have eliminated all those sources of error, then it seems like you will need to add more error trapping to pin down where the error occurs. If the log files are not been written to (which itself seems problematic &

Re: Auto assigning 2 types of user roles on sign up

2019-10-23 Thread Jani Tiainen
Hi. Personally I would do it as follows: On invitation create invited user account at least with email and with member role. Make account disabled. You might also add invitation key which you can put in email and check as well. When invited user starts sign up procedure you can just fill in the

Re: Auto assigning 2 types of user roles on sign up

2019-10-23 Thread Stephanie Semerville
When you say: "create an instance and save it to db later", is that dynamic? On Tuesday, October 22, 2019 at 11:26:19 PM UTC-4, WD Wang wrote: > > hi, > > A user could have many roles, it's all depends on your design. My > understanding is: > 1. When user directly sign up, he will be assigned

Re: how to set up a calculated field in Django?

2019-10-23 Thread Tyler Lynch
If you're using the newest postgres 12, you could also use their new generated column feature ( https://www.postgresql.org/docs/current/ddl-generated-columns.html). You can implement that in Django by editing the SQL in the migration setting up your table. Though I do look forward to this

Re: Auto assigning 2 types of user roles on sign up

2019-10-23 Thread Nazish Akhtar
Hey. I am working project where I need it. Five different roles, but users can have Multiple roles. Here is link to my git repo https://github.com/noobExtendsBot/django-custom-user form out side it in not documented enough (actually haven't commit on github) but you have a look inside models

Re: Expire Password Reset Link

2019-10-23 Thread 'Maher, Brian' via Django users
You could do this quite easily by just querying the table storing reset keys for objects belonging to the user and expiring them (setting the date to the past, or setting an expire bit). However, IMO it is far better to just generate another one, and have them expire automatically after either

Re: Add filter to admin add page?

2019-10-23 Thread Nelson Varela
Or even better... whu not use django's own auto complete feature in the admin: https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.autocomplete_fields Op dinsdag 22 oktober 2019 00:07:40 UTC+2 schreef Wil Moskal: > > I have a model registered to the admin

Re: Expire Password Reset Link

2019-10-23 Thread Nelson Varela
Why give out more than one link? Why not use get_or_create to make link or use existing link for that user? Op woensdag 23 oktober 2019 15:06:17 UTC+2 schreef prabhakaran karthikeyan: > > If an user requests a password reset link, clicking on it will make the > link expirable. Suppose, user

Re: Updates in production not showing up

2019-10-23 Thread Tommy Delage
Thank you for the quick response it was easy to restart the ngnix server, but uwsgi is showing me a list like this ¸ The program 'uwsgi' can be found in the following packages: * uwsgi-core * uwsgi-plugin-alarm-curl * uwsgi-plugin-alarm-xmpp * uwsgi-plugin-curl-cron *

App authentication using python social core and creation of webhook

2019-10-23 Thread Saswat Ray
https://m.facebook.com/groups/411741268877125?view=permalink=2659955947388968 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Expire Password Reset Link

2019-10-23 Thread prabhakaran karthikeyan
If an user requests a password reset link, clicking on it will make the link expirable. Suppose, user requests more than one link mistakenly, just need to expire the first link . The user should get reset form only from recent link. Any help is appreciated. Thank You. -- You received this

Re: Querying works on shell but not on the Django program code

2019-10-23 Thread Shashikant Sharma
On Tue, 22 Oct 2019, 21:02 Olivier Dugast, wrote: > > > Le mercredi 10 juillet 2019 13:26:53 UTC+2, Solomon Mbak a écrit : >> >> I'm a complete novice to python and Django. >> >> I have tried several solutions I found on stack overflow, but I still get >> the same issue. I've tried querying from

Getting asyncio.exceptions.CancelledError when connecting a WebSocket

2019-10-23 Thread mellowcellofellow
I'm attempting to use a GraphQL subscriptions over WebSocket implementation called DjangoChannelsGraphqlWs [1] but in setting it up I'm getting asyncio.exceptions.CancelledError on connection. I get a similar error in tests with the asyncio pytest mark. I've already opened a ticket [2] with the

Re: Admin site error reporting

2019-10-23 Thread Dieter Gyselinck
Thanx for the response. The normal logging works, I see errors in the error log file if they occur outside the Django Admin. However, the error with the change form in the admin does not occur in the logfiles. Same behaviour as with the error mailing. Op woensdag 23 oktober 2019 10:57:05

Re: Django after migration UndefinedColumn error in production

2019-10-23 Thread red
Hi, Yes, it connects to the same database. I only have one accessible database in the production environment and the administration interface works fine for the other models I have, it crashes only when I try to access that specific model or when trying to access the website. Red. On 23/10/2019

Re: Add filter to admin add page?

2019-10-23 Thread Derek
For your filter problem, you probably need to use: https://github.com/farhan0581/django-admin-autocomplete-filter On Tuesday, 22 October 2019 00:07:40 UTC+2, Wil Moskal wrote: > > I have a model registered to the admin page, AuthUserFilePermissions, > which consists of 2 foreign keys, a key to

Re: Admin site error reporting

2019-10-23 Thread Derek
Does the normal logging work i.e. are you seeing those errors reported in the log files? And do you have trapping/handling for the email-sending code as well? Also have a look at: https://stackoverflow.com/questions/15128135/setting-debug-false-causes-500-erro for a brief discussion around