Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread 'Amitesh Sahay' via Django users
package. from django.views.decorators.csrf import csrf_exemptstackoverflow.com | From: django-users@googlegroups.com on behalf of coolguy Sent: July 29, 2020 10:05 PM To: Django users Subject: Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with no

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread Isha Thakur
M To: Django users Subject: Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected By default, Django checks for the CSRF token in all POST requests. Remember to include the csrf_token tag in all forms that are submitted via POST. Please

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread Christian Seberino
coolguy Remember to include the csrf_token tag in all forms that are submitted via > POST. > Yes! It must be INSIDE the form element *not* outside! I'm so grateful for your help. All the Best, Chris -- You received this message because you are subscribed to the Google Groups "Django

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-30 Thread Christian Seberino
Amitesh Indeed your suggestion below fixed everything. I can't thank you enough! cs On Wednesday, July 29, 2020 at 8:59:52 PM UTC-5, Amitesh Sahay wrote: > > Generally, {% csrf_token %} is written just below the opening tag. > I mean, not sure if this has anything to do with your issue.

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread Christian Seberino
Amitesh Oh my thank you so much. I actually did move the csrf token outside the form element. That may be it. I will check that soon. On Wed, Jul 29, 2020, 8:59 PM 'Amitesh Sahay' via Django users < django-users@googlegroups.com> wrote: > Generally, {% csrf_token %} is written just below the

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread coolguy
By default, Django checks for the CSRF token in all POST requests. Remember to include the csrf_token tag in all forms that are submitted via POST. Place csrf_token within form tag... e.g. {% csrf_token%} tag On Wednesday, July 29, 2020 at 9:57:41 PM UTC-4, Christian Seberino wrote: > >

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread coolguy
By default, Django checks for the CSRF token in all POST requests. Remember to include the csrf_token tag in all forms that are submitted via POST. Please place csrf_token in tag. You have placed it outside of form tag. On Wednesday, July 29, 2020 at 9:57:41 PM UTC-4, Christian Seberino

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread 'Amitesh Sahay' via Django users
Generally, {% csrf_token %} is written just below the opening tag. I mean, not sure if this has anything to do with your issue. Others may confirm as well Regards, Amitesh On Thursday, 30 July, 2020, 07:26:21 am IST, Christian Seberino wrote: Here is my template... {% extends

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread Christian Seberino
Here is my template... {% extends "html_base" %} {% block body_elements %} UPDATE STATUSES {% for e in both %}

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread coolguy
No. What i said the link you sent gives the validation error since fields are blank. Its not working the same way as you. Can you send the code for your html template. On Wednesday, July 29, 2020 at 6:53:29 PM UTC-4, Christian Seberino wrote: > > > > On Wednesday, July 29, 2020 at 5:29:53 PM

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread coolguy
No. What i said the link you sent gives the validation error since fields are blank. Its nothing working the same way as you. Can you send the code for your html template. On Wednesday, July 29, 2020 at 6:53:29 PM UTC-4, Christian Seberino wrote: > > > > On Wednesday, July 29, 2020 at 5:29:53

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread Christian Seberino
On Wednesday, July 29, 2020 at 5:29:53 PM UTC-5, coolguy wrote: > > Tired your link for the form. If this is the form you are concerned about > then the message that pops up is for validation i.e. form.is_valid(). > Did you see the CSRF error I got?. Here is a pic https://imgur.com/a/LIRBadQ

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread coolguy
Tired your link for the form. If this is the form you are concerned about then the message that pops up is for validation i.e. form.is_valid(). On Wednesday, July 29, 2020 at 4:55:33 PM UTC-4, Christian Seberino wrote: > > I have a Django app with multiple forms on various pages. They all work

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread Taofeek Jimoh Iyanda
Check this website, it may be helpful https://www.techiediaries.com/django-react-forms-csrf-axios/ On Wednesday, July 29, 2020 at 9:55:33 PM UTC+1, Christian Seberino wrote: > > I have a Django app with multiple forms on various pages. They all work > except for one with just an optional

Re: Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread Christian Seberino
Here is the problematic url... > https://grandmas4hire.com/admin_status/ > Just press submit button w/o doing anything else and you'll see -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Can't get rid of "CSRF verification failed. Request aborted.: when submit form with nothing selected

2020-07-29 Thread Christian Seberino
I have a Django app with multiple forms on various pages. They all work except for one with just an optional checkbox... I checked and they all have templates with {% csrf_token %}. The only thing special but the problematic form is that I have a checkbox input that is optional. That

Re: submit form as superuser vs regular user

2017-09-21 Thread Melvyn Sopacua
It doesn't reach form_valid because the form is not valid. It reaches `form_invalid`. You can inspect things there for debugging. But the error is probably with your authentication backed, since request.user is not filled in. The obvious being that your superuser exists in `auth_user` and other

Re: submit form as superuser vs regular user

2017-09-19 Thread Avraham Serour
not sure if related, but the docs suggest to inherit from AbstractUser, not User https://docs.djangoproject.com/en/1.11/topics/auth/customizing/ On Mon, Sep 18, 2017 at 12:58 PM, Danae Vogiatzi wrote: > In my django app I have a Myuser(User) class. It inherits the User

submit form as superuser vs regular user

2017-09-18 Thread Danae Vogiatzi
In my django app I have a Myuser(User) class. It inherits the User class. When a new user is created the Myuser table is poplulated. myusers.py class Myuser(User): address = models.CharField(max_length=40) pobox = models.CharField(max_length=40) models.py class

Re: I use requests to submit form,how to bate Django's csrfmiddlewaretoken

2017-06-15 Thread Александр Христюхин (roboslone)
anyway, you're no supposed to post data like that. Do you do that in >> tests? >> >>> On 15 Jun 2017, at 16:20, liyutong...@gmail.com <> wrote: >>> >>> I uis this code to submit form >>> ```python >>> import requests >>>

Re: I use requests to submit form,how to bate Django's csrfmiddlewaretoken

2017-06-15 Thread 李余通
token value is passed in Django's response headers. >> And anyway, you're no supposed to post data like that. Do you do that in >> tests? >> >> On 15 Jun 2017, at 16:20, liyutong...@gmail.com wrote: >> >> I uis this code to submit form >> ```python >>

Re: I use requests to submit form,how to bate Django's csrfmiddlewaretoken

2017-06-15 Thread Александр Христюхин (roboslone)
Христюхин写道: > CSRF token value is passed in Django's response headers. > And anyway, you're no supposed to post data like that. Do you do that in > tests? > >> On 15 Jun 2017, at 16:20, liyutong...@gmail.com wrote: >> >> I uis this code to submit form >> ```py

Re: I use requests to submit form,how to bate Django's csrfmiddlewaretoken

2017-06-15 Thread 李余通
utong...@gmail.com wrote: > > I uis this code to submit form > ```python > import requests > > url = 'http://127.0.0.1:8000/contact/' > d = {'subject':'你好','email':'','message':'thank u'} > r = requests.post(url,data = d) > print(r.text) > ``` > > but i

Re: I use requests to submit form,how to bate Django's csrfmiddlewaretoken

2017-06-15 Thread Александр Христюхин (roboslone)
CSRF token value is passed in Django's response headers. And anyway, you're no supposed to post data like that. Do you do that in tests? > On 15 Jun 2017, at 16:20, liyutong19961...@gmail.com wrote: > > I uis this code to submit form > ```python > import requests > > ur

I use requests to submit form,how to bate Django's csrfmiddlewaretoken

2017-06-15 Thread liyutong19961231
I uis this code to submit form ```python import requests url = 'http://127.0.0.1:8000/contact/' d = {'subject':'你好','email':'','message':'thank u'} r = requests.post(url,data = d) print(r.text) ``` but i don't has csrfmiddlewaretoken's values I try to use requests.get to get

Django JQuery AJAX submit form POST request refreshes the page

2015-07-07 Thread Ankit Agrawal
to the POST handler URL /users/login/ with the expected JSON string response(i.e. JsonResponse) - {"error": ["Entered mobile number is not registered"]} Please check this stackoverflow link <http://stackoverflow.com/questions/31262427/django-jquery-ajax-submit-form-post-req

Re: submit form to the db table with ForeignKey value

2010-05-22 Thread Goran
> Are you talking about: > # in your template >           {{ reg }} > > Does works for you? > > ~Rolando > Yes! It works! Thank you very much Rolando -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: submit form to the db table with ForeignKey value

2010-05-21 Thread Rolando Espinoza La Fuente
                  > > view after submit form > > def newreg(request): >    regog = request.POST['region_no'] > >    no1 = NewReg(region=Region(regog) )     #here i need integer which > is ID of selected option from database Are you talking about: # in your template

submit form to the db table with ForeignKey value

2010-05-21 Thread Goran
Hi, I'm novice with django and I use simple form with select option method. Options come from db and it works fine. When user submit form i have selected option as string and can not save it to db because this table is models.ForeighKey(AnotherTable) and I need ID of selected option to pass

Re: submit form

2009-07-13 Thread Eugene Mirotin
The other option is to have the hidden "action" field and fill it with different values on buttons click events. The other option is to change the form action dynamically with JS so you can have separate POST handler views for different actions (like On Jul 12, 3:22 pm, alecs

Re: submit form

2009-07-12 Thread alecs
Thanks, Dennis :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: submit form

2009-07-12 Thread Dennis Kaarsemaker
url, etc). > Below this table I have three(or maybe more) buttons to perform > different actions with selected (using checkbox) files : delete them, > send by email and so on. So can you recommend me how to be with > buttons? Use jquery and submit form and add to post something lik

submit form

2009-07-11 Thread alecs
with selected (using checkbox) files : delete them, send by email and so on. So can you recommend me how to be with buttons? Use jquery and submit form and add to post something like button name? Are there any better ways? Thanks :) --~--~-~--~~~---~--~~ You received