Re: Decorator function argument woes

2018-05-07 Thread Peter of the Norse
Yes, but that’s because all of the arguments are optional. That way you can do: @login_required def my_view(request): … @login_required(login_url=“/login/“) def other_view(request): … - Peter of the Norse > On Apr 30, 2018, at 12:24 AM, Mike Dewhirst wrote: >

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-07 Thread Jani Tiainen
Also next time please post exceptions as a text. Images are really hard to read specially on mobile device. ma 7. toukokuuta 2018 klo 20.34 Avitab Ayan Sarmah kirjoitti: > i got the error thank you. It was a simple error i forgot to put "<" > before vote > > On Monday,

Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-07 Thread Oliver Zhou
Thanks for the reply! I accidentally posted this twice. Still seems like it should raise some sort of warning or exception when you're trying to edit both an integer key and a string key at the same time, instead of just allowing for seemingly non-deterministic data loss. On Sunday, May 6,

Re: looking for the right way to work with JSONField - behavior inconsistent between strings and integers

2018-05-07 Thread Oliver Zhou
Thanks for the clarification -> although it seems like it should actually raise a warning or exception to prevent non-deterministic data errors when people aren't aware. Oliver On Tuesday, April 24, 2018 at 8:20:53 PM UTC-7, Simon Charette wrote: > > Hello Olivier, > > Since JSON objects can

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-07 Thread Avitab Ayan Sarmah
i got the error thank you. It was a simple error i forgot to put "<" before vote On Monday, May 7, 2018 at 10:55:51 PM UTC+5:30, Avitab Ayan Sarmah wrote: > > polls/urls.py: > > from django.urls import path > > from . import views > > app_name = 'polls' > urlpatterns = [ > # ex: /polls/ >

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-07 Thread Avitab Ayan Sarmah
polls/urls.py: from django.urls import path from . import views app_name = 'polls' urlpatterns = [ # ex: /polls/ path('', views.index, name='index'), # ex: /polls/5/ path('/', views.detail, name='detail'), #ex: /polls/5/results/ path('/results/', views.results, name='results'), #ex:

Re: while going through the django tutorial i commited a error and because of which i cannot execute the python manage.py runserver. The errors are attached below

2018-05-07 Thread Dylan Reinhold
Share your polls/url.py it's saying it cant find the url named "vote" in your polls. Dylan On Mon, May 7, 2018 at 10:14 AM, Avitab Ayan Sarmah wrote: > Detail.html: > > {{ question.question_text }} > > {% if error_message %}{{ error_message }}{% endif > %} > > > {%

Re: Adding to all templates context via Middleware

2018-05-07 Thread Daniel Roseman
I still don't understand what is being repeated or why. You need to specify that in your settings, and you can add whatever context processors you like. You don't need to specify it twice, so nothing is being repeated. -- You received this message because you are subscribed to the Google

Re: Custom model field data type

2018-05-07 Thread JAGADESH M
if you read this page you will get an idea. get the link below https://stackoverflow.com/questions/20754793/django-module-object-has-no-attribute-bigintegerfield On Mon, May 7, 2018 at 3:31 PM, 'Berry' via Django users < django-users@googlegroups.com> wrote: > I created a custom

Group by object's field and return list of object or object's id for each group

2018-05-07 Thread Aamu Padi
class Ticket(models.Model): ... booked_at = models.DateTimeField(default=timezone.now) bought = models.BooleanField(default=False) I would like to group tickets by booked day to get list of ticket or ticket's id for each day. Something like this: [ { 'day':

Custom model field data type

2018-05-07 Thread 'Berry' via Django users
I created a custom PositiveBigIntegerField data type in models.py, which is a sub class of the BigIntegerField. I registered the model where the PositiveBigIntegerField is used in the admin site. When I try to add een item using the admin site, the 'add' button raises an error, telling me

Integrating Okta SAML2 with existing django web application

2018-05-07 Thread BIJAL MANIAR
Hi, I want to integrate an existing django web application with Okta identity provider. I could find a couple of packages: https://github.com/fangli/django-saml2-auth https://github.com/MindPointGroup/django-saml2-pro-auth Have started to use django-saml2-auth. Can we also configure advanced

Re:

2018-05-07 Thread Julio Biason
Hey Aayush, Can you past the full error? It's kinda hard to see what's wrong with just that description. Aside from that, you can: - Make sure you have your virtualenv up. - Check the library is really installed (you can run `pip freeze` to see which libraries you have installed in the

Re: Username same as user id

2018-05-07 Thread 'Anthony Flury' via Django users
Yes - but that is very different from what you are asking - Facebook have a two stage form - first set the details - and then set the user name. Their user name isn't optional - it is always mandatory - it is just set at stage two. You can assign any value to any variable you wish - this

Re: Username same as user id

2018-05-07 Thread 'Anthony Flury' via Django users
Of course there is : on the view which responds to your registration form (likely to be where you call authenticate) - you simply test if the username field has been set when the registration is posted - and if not set it to be whatever you want. Or - in your custom backend you can do the

Re: Adding to all templates context via Middleware

2018-05-07 Thread Bernd Wechner
Daniel, The backend code contains: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, "templates"),], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [

Re: Username same as user id

2018-05-07 Thread lakshitha kumara
Hello Jeni Thank you for your reply. yes i dealing with my own custom authentication backend and now i desided to use username as random number Instead of user id if username not set. Thanks you On Sunday, May 6, 2018 at 8:13:55 PM UTC+5:30, lakshitha kumara wrote: > > Hello guys > > Is

Re: Username same as user id

2018-05-07 Thread Jani Tiainen
Hi, Have you considered using custom user with custom authentication backend to handle authentication? On Mon, May 7, 2018 at 3:56 AM, lakshitha kumara wrote: > hi anthony > > Look at the facebook registration form. there are no username field first > time user