Re: Handle changing users (e.g. a logout) in a scope/WebSockets

2018-02-18 Thread Andrew Godwin
Correct, it's fixed at connection time, much like a Django request object. If you want to vary what user it is, I suggest you just reconnect the websocket when the user logs in or out to make sure you don't have stale data - you should be building for reconnection anyway as network environments

Do I need a special widget for multi-choice fields

2018-02-18 Thread Mike Dewhirst
The use case is on-line training software for a trainer entering a bunch of statements as possible answers to a single question. The student user needs to see this as a bunch of corresponding radio-buttons or select drop-down for a single answer selection. I've looked at the docs:

Handle changing users (e.g. a logout) in a scope/WebSockets

2018-02-18 Thread Daniel Gilge
Packages: Channels 2.0, Django 2.0 Hi, When I understand it correctly a scope’s user object isn’t updated when a user changes (e.g. logs in or out in another window) for the whole lifetime of the scope. (Please correct me if I am wrong.) Now this can be a serious issue as you can imagine.

Re: When to use get_user_model()

2018-02-18 Thread Xavier Paniello
Hi tangoward15, Django will use auth.User as the user model in the system, unless you change AUTH_USER_MODEL = RegUser in settings.py Be carefull, to change the user model has some particularities you can read in docs (warning section):

Re: Basic note/trello app - how to link model object IDs

2018-02-18 Thread Lylio
Hi everyone, I've unfortunately hit another brick wall with my Django app. I have my list of card objects, and when one of them is clicked, I'd like a new page to open that contains the details for the card that was clicked. I found out how to create a URL using {{ card.id }}: {% for card in

Re: [1.11] Django loads sub-string url

2018-02-18 Thread Henrik Baran
Hi Daniel, thanks a lot, that solved it for me! On 18.02.2018 19:25, Daniel Roseman wrote: > On Sunday, 18 February 2018 16:19:31 UTC, Henrik Baran wrote: > > Hi, > > I face a very weird phenomenon. I have following two urls > established: > > url(r'types/$', views.types,

Re: [1.11] Django loads sub-string url

2018-02-18 Thread Daniel Roseman
On Sunday, 18 February 2018 16:19:31 UTC, Henrik Baran wrote: > > Hi, > > I face a very weird phenomenon. I have following two urls established: > > url(r'types/$', views.types, name='types'), > url(r'box_types/$', views.box_types, name='box types') > > > If I load "/types/" the view "types" is

Re: Stripe problem: InvalidRequestError: This customer has no attached payment source

2018-02-18 Thread Etienne Robillard
I'd suggest you look into the api_requestor.py source code to actually trace this problem. HTH, Etienne Le 2018-02-18 à 10:30, Tom Tanner a écrit : I've been following the Quickstart guides from Stripe. https://stripe.com/docs/quickstart https://stripe.com/docs/subscriptions/quickstart

[1.11] Django loads sub-string url

2018-02-18 Thread Henrik Baran
Hi, I face a very weird phenomenon. I have following two urls established: url(r'types/$', views.types, name='types'), url(r'box_types/$', views.box_types, name='box types') If I load "/types/" the view "types" is shown, all ok. In case I load "/box_types" unexpectedly also "types" is shown.

Re: Django 1.9 Apps aren't loaded yet

2018-02-18 Thread Kaleemullah Rao
> > I am getting this error while i create a newapp and integrate in the >>> setting and urls file in sample project >> >> C:\Users\RaoKaleemullah\Desktop\django-tutorial\sample>python manage.py >>> runserve >> >> r >> >> Traceback (most recent call last): >> >> File "manage.py", line 10, in

Stripe problem: InvalidRequestError: This customer has no attached payment source

2018-02-18 Thread Tom Tanner
I've been following the Quickstart guides from Stripe. https://stripe.com/docs/quickstart https://stripe.com/docs/subscriptions/quickstart This is what my form looks like: {% csrf_token %} {% for field in registration_form %} {{ field }} {% if

Re: When to use get_user_model()

2018-02-18 Thread tango ward
@Mukul Agrawal, thanks, i'll read this. @Xavier, the model in forms.py, does it mean it will use the RegUser class from the models.py? Sorry, I am confuse. On Sun, Feb 18, 2018 at 9:41 PM, Mukul Agrawal wrote: > The answer on this link can also help you in why and when

Re: When to use get_user_model()

2018-02-18 Thread Mukul Agrawal
The answer on this link can also help you in why and when to use get_user_model(). https://stackoverflow.com/questions/24629705/django-using-get-user-model-vs-settings-auth-user-model On Feb 18, 2018 4:11 AM, "tango ward" wrote: Hi, I am playing around with user

Re: When to use get_user_model()

2018-02-18 Thread Xavier Paniello
Hi tangoward15, The User model by default is auth.User, but you can define a custom one and reference it at settings: https://docs.djangoproject.com/en/2.0/ref/settings/#auth-user-model So, get_user_model() will return the model defined at AUTH_USER_MODEL setting. Salut! El dissabte, 17

Re: Strange problem with Django

2018-02-18 Thread Andy
How did you try to run the command? It sounds that you told you computer to open the file instead. You have to run that in the command shell of your OS. (Terminal on OSX or Powershell in Windows) Am Samstag, 17. Februar 2018 18:48:58 UTC+1 schrieb Tet Yeap: > > Hi, > > I was trying to learn