Re: FormSet.is_valid() raises ValidationError

2019-11-04 Thread Benoit Blanchon
Hi!

Thank you very much for this answer, but that's not what I'm talking about.
I know that you must include the management form in the template, that's
not the problem.

I worry about a malicious user (i.e., a hacker) that would purposely temper
the management form in order to raise an exception on the server.
For example, he could write a loop can call "curl -X POST" repeatedly,
which would flood the admins with "Internal Server Error" emails.

This is possible because BaseFormSet.is_valid() raises an exception when it
should return False as a regular form.

Best Regards,
Benoit


On Fri, Nov 1, 2019 at 12:49 PM Nijo Joseph  wrote:

> Hi,
>   In case of 
>
> 
> {{ formset }}
> 
>
> no probs. but in case of
>
> *{{ formset.management_form }}*
> 
> {% for form in formset %}
> {{ form }}
> {% endfor %}
> 
>
>
> *{{ formset.management_form }} is required and of course *  {% 
> csrf_token %}. Ref 
> https://docs.djangoproject.com/en/2.2/topics/forms/formsets/
>
>
> On Tuesday, October 29, 2019 at 5:41:16 PM UTC+5:30, Benoit Blanchon wrote:
>>
>> Hi,
>>
>> From what I understand, Form.is_valid() must return False when the form
>> is invalid or incomplete.
>>
>> BaseFormSet, however, raises a ValidationError with the message
>> "ManagementForm data is missing or has been tampered with,"  when the
>> management form has been tampered.
>>
>> I think this is incorrect: BaseFormSet.is_valid() should catch this
>> exception and return False; otherwise, it allows a malicious user to cause
>> an error 500 by tampering the management form.
>>
>> Best regards,
>> Benoit Blanchon
>> (Django version: 2.2.6)
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/iR25bNRQA7w/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c78a89fd-b44b-4863-aee7-33646bf5114e%40googlegroups.com
> 
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOafuFxuXfESN21QYmknMxfyfvV3kJO4rd3a2%2B-h6n6tT7JQ4Q%40mail.gmail.com.


Django bugfix releases: 2.2.7, 2.1.14, and 1.11.26

2019-11-04 Thread Mariusz Felisiak

Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2019/nov/04/django-bugfix-releases-227-2114-11126/

--
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f520475c-176a-273f-aeb3-5c43cd137fe8%40gmail.com.


Django-Channels with 2 applications

2019-11-04 Thread Daniel Carvalho


Hello!


I'm trying to make an example to test if it is possible to have 2 
independent django apps connected to the same channel from django-channels. 
So far, I was able to make an example running on one machine and 2 other 
machines being able to access the first via a client. But the goal is to be 
able to connect separate applications in a single channel to communicate. 
Is that possible?


*Note*: I'm also using redis, if that helps.


Thank you!

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/88f3d63e-273d-4bbf-9ebe-f7ca348c7c18%40googlegroups.com.


Djangorest framework tutorial

2019-11-04 Thread Laura Pérez
Hi!
I have the task to develop a rest api in python, Can anybody advice me on a
nice tutorial to use djangorest framework ?

Best!

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%40mail.gmail.com.


Re: Djangorest framework tutorial

2019-11-04 Thread Paras Jain
 Hi,
just follow this video u will easily know how to make api very easily
link - https://www.youtube.com/watch?v=263xt_4mBNc
Thnks

On Mon, Nov 4, 2019 at 6:17 PM Laura Pérez  wrote:

> Hi!
> I have the task to develop a rest api in python, Can anybody advice me on
> a nice tutorial to use djangorest framework ?
>
> Best!
>
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%40mail.gmail.com
> 
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMtmBS_11roQXUzFHb%3Dvus1MnaqqjQV8CmZS5jLrXZDZKvnNAw%40mail.gmail.com.


Re: Django-Channels with 2 applications

2019-11-04 Thread Integr@te System
Hi Idea man,

You can acknowlegdes and try it:

https://channels.readthedocs.io/en/latest/


On Mon, Nov 4, 2019, 19:11 Daniel Carvalho  wrote:

> Hello!
>
>
> I'm trying to make an example to test if it is possible to have 2
> independent django apps connected to the same channel from django-channels.
> So far, I was able to make an example running on one machine and 2 other
> machines being able to access the first via a client. But the goal is to be
> able to connect separate applications in a single channel to communicate.
> Is that possible?
>
>
> *Note*: I'm also using redis, if that helps.
>
>
> Thank you!
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/88f3d63e-273d-4bbf-9ebe-f7ca348c7c18%40googlegroups.com
> 
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP5HUWqYCa3Fw2tt-m2y4rDDeAc3QZg3pHZq1d7JLwV%2B9-pFPQ%40mail.gmail.com.


Re: Django-Channels with 2 applications

2019-11-04 Thread Daniel Carvalho
I've seen the docs already. In fact, 3 people from my team have seen it and 
tried to do what I'm trying to accomplish.
We're at a point where we are either missing something or the Channels is 
not capable of what we need.

Thank you in advance for any help!


segunda-feira, 4 de Novembro de 2019 às 13:47:55 UTC, Integr@te System 
escreveu:
>
> Hi Idea man,
>
> You can acknowlegdes and try it:
>
> https://channels.readthedocs.io/en/latest/
>
>
> On Mon, Nov 4, 2019, 19:11 Daniel Carvalho  > wrote:
>
>> Hello!
>>
>>
>> I'm trying to make an example to test if it is possible to have 2 
>> independent django apps connected to the same channel from django-channels. 
>> So far, I was able to make an example running on one machine and 2 other 
>> machines being able to access the first via a client. But the goal is to be 
>> able to connect separate applications in a single channel to communicate. 
>> Is that possible?
>>
>>
>> *Note*: I'm also using redis, if that helps.
>>
>>
>> Thank you!
>>
>> -- 
>> 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 django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/88f3d63e-273d-4bbf-9ebe-f7ca348c7c18%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8f24a4d8-3050-43c5-8d01-ad11d9e94c73%40googlegroups.com.


Re: Djangorest framework tutorial

2019-11-04 Thread Laura Pérez
Thanks!

Em seg, 4 de nov de 2019 às 09:59, Paras Jain 
escreveu:

> Hi,
> just follow this video u will easily know how to make api very easily
> link - https://www.youtube.com/watch?v=263xt_4mBNc
> Thnks
>
> On Mon, Nov 4, 2019 at 6:17 PM Laura Pérez  wrote:
>
>> Hi!
>> I have the task to develop a rest api in python, Can anybody advice me on
>> a nice tutorial to use djangorest framework ?
>>
>> Best!
>>
>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%40mail.gmail.com
>> 
>> .
>>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMtmBS_11roQXUzFHb%3Dvus1MnaqqjQV8CmZS5jLrXZDZKvnNAw%40mail.gmail.com
> 
> .
>
-- 
--
Laura Pérez Vera
(+53) 53440970 - lpver...@gmail.com

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF_dEnock0uZ%2B9Vrg6Kyf%2B7z1NVzTQpBA55R4k27CdJ2OHGWtg%40mail.gmail.com.


DJANGO, MySQL, NGINX stack for a production hosting server in Digital Ocean droplet

2019-11-04 Thread Ram
Hi,
Please let me know if anyone has setup this stack in your hosting server
with Digital Ocean? I appreciate if you can share the appropriate working
steps.
thanks,
~Ram

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BOi5F1ehRtgLYSE3N9oeup0z6TavPo%3DPn2nvpV80hT7erfjjQ%40mail.gmail.com.


Re: DJANGO, MySQL, NGINX stack for a production hosting server in Digital Ocean droplet

2019-11-04 Thread carlos
this tuto is the same only replace postgresql to mysql
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

in the doc django read
https://docs.djangoproject.com/en/2.2/ref/databases/#mysql-notes


On Mon, Nov 4, 2019 at 4:27 PM Ram  wrote:

> Hi,
> Please let me know if anyone has setup this stack in your hosting server
> with Digital Ocean? I appreciate if you can share the appropriate working
> steps.
> thanks,
> ~Ram
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BOi5F1ehRtgLYSE3N9oeup0z6TavPo%3DPn2nvpV80hT7erfjjQ%40mail.gmail.com
> 
> .
>


-- 
att.
Carlos Rocha

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM-7rO22QwmFiGuyTxa7NLSS4v%2BEvp8B0iN4yqk86XFdqA-K1A%40mail.gmail.com.


Re: Djangorest framework tutorial

2019-11-04 Thread Motaz Hejaze
If you need any help please let me know

My skype

m3tz-hjze

On Mon, 4 Nov 2019, 4:44 pm Laura Pérez,  wrote:

> Thanks!
>
> Em seg, 4 de nov de 2019 às 09:59, Paras Jain 
> escreveu:
>
>> Hi,
>> just follow this video u will easily know how to make api very easily
>> link - https://www.youtube.com/watch?v=263xt_4mBNc
>> Thnks
>>
>> On Mon, Nov 4, 2019 at 6:17 PM Laura Pérez  wrote:
>>
>>> Hi!
>>> I have the task to develop a rest api in python, Can anybody advice me
>>> on a nice tutorial to use djangorest framework ?
>>>
>>> Best!
>>>
>>>
>>> --
>>> 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 django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMtmBS_11roQXUzFHb%3Dvus1MnaqqjQV8CmZS5jLrXZDZKvnNAw%40mail.gmail.com
>> 
>> .
>>
> --
> --
> Laura Pérez Vera
> (+53) 53440970 - lpver...@gmail.com
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF_dEnock0uZ%2B9Vrg6Kyf%2B7z1NVzTQpBA55R4k27CdJ2OHGWtg%40mail.gmail.com
> 
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHV4E-cSxYkj0rMWau%3DzMJDBBoxzX7H8M7J5dmRKoHEYxPwiiQ%40mail.gmail.com.


Re: Djangorest framework tutorial

2019-11-04 Thread kevin trinidad
Django Signals: The QuerySet value for an exact lookup must be limited to
one result using slicing

i have this code in my models.py (post_save)

class StudentsEnrolledSubject(models.Model):
Students_Enrollment_Records =
models.ForeignKey(StudentsEnrollmentRecord, related_name='+',

on_delete=models.CASCADE, null=True)
Subject_Section_Teacher = models.ForeignKey(SubjectSectionTeacher,
related_name='+', on_delete=models.CASCADE,
null=True,blank=True)

@receiver(post_save, sender=StudentsEnrollmentRecord)
def create(sender, instance, created, *args, **kwargs):
teachers =
SubjectSectionTeacher.objects.filter(Sections=instance.Section,Education_Levels=instance.Education_Levels,Courses=instance.Courses)
for each in teachers:
if created and teachers.exists():
StudentsEnrolledSubject.objects.update_or_create(
pk=each.id,
Students_Enrollment_Records=instance,
Subject_Section_Teacher=teachers.all()

)

class StudentsEnrollmentRecord(models.Model):
Student_Users = models.ForeignKey(StudentProfile,
related_name='students', on_delete=models.CASCADE, null=True)

class SubjectSectionTeacher(models.Model):
Education_Levels = models.ForeignKey(EducationLevel,
related_name='+', on_delete=models.CASCADE, blank=True)
Courses = models.ForeignKey(Course, related_name='+',
on_delete=models.CASCADE, null=True, blank=True)
Sections = models.ForeignKey(Section, related_name='+',
on_delete=models.CASCADE, null=True)
Subjects = models.ForeignKey(Subject, related_name='+',
on_delete=models.CASCADE, null=True)
Employee_Users = models.ForeignKey(EmployeeUser, related_name='+',
on_delete=models.CASCADE, null=True)

when I used the **Subject_Section_Teacher=teachers.first()** i received no
error but that is not what i want result, then i decide to change it to
this **Subject_Section_Teacher=teachers.all()**


On Tue, Nov 5, 2019 at 1:21 PM Motaz Hejaze  wrote:

> If you need any help please let me know
>
> My skype
>
> m3tz-hjze
>
> On Mon, 4 Nov 2019, 4:44 pm Laura Pérez,  wrote:
>
>> Thanks!
>>
>> Em seg, 4 de nov de 2019 às 09:59, Paras Jain 
>> escreveu:
>>
>>> Hi,
>>> just follow this video u will easily know how to make api very easily
>>> link - https://www.youtube.com/watch?v=263xt_4mBNc
>>> Thnks
>>>
>>> On Mon, Nov 4, 2019 at 6:17 PM Laura Pérez  wrote:
>>>
 Hi!
 I have the task to develop a rest api in python, Can anybody advice me
 on a nice tutorial to use djangorest framework ?

 Best!


 --
 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 django-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%40mail.gmail.com
 
 .

>>> --
>>> 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 django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMtmBS_11roQXUzFHb%3Dvus1MnaqqjQV8CmZS5jLrXZDZKvnNAw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> --
>> Laura Pérez Vera
>> (+53) 53440970 - lpver...@gmail.com
>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAF_dEnock0uZ%2B9Vrg6Kyf%2B7z1NVzTQpBA55R4k27CdJ2OHGWtg%40mail.gmail.com
>> 
>> .
>>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHV4E-cSxYkj0rMWau%3DzMJDBBoxzX7H8M7J5dmRKoHEYxPwiiQ%40mail.gmail.com
> 

[no subject]

2019-11-04 Thread Paras Jain
please somebody tell me what steps should i follow please need help


Create a Django Web App called “Profile Storer” where a company can sign up
using Email.

Once signed up, he can add more people to his team. Every team member can
be either “Normal” type or “Manager” type. When you add a team member, that
particular person gets an email with password, which he/she can use to
login.

When a Manager type user logs in, he sees a list of all users of that
company, he can go and edit any of the profile.

When a Normal user logs in, he sees only his own profile that he can edit.


Questions in Profile:

Name, Phone, Gender, Hobbies, Profile Picture.

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMtmBS-mWtcx1Z0QFdvDc9F-ApoqHdP_9CkpaQzZUULow%3DHrFg%40mail.gmail.com.


Re: ListView is not showing me the latest created item made by CreateView !

2019-11-04 Thread Parth Joshi
Can you share some code snippet to have better clarity?


On Sunday, 3 November 2019 20:33:45 UTC+5:30, Franz Ulenaers wrote:
>
> ListView is not showing me the latest created item made by CreateView even 
> after a refresh of my browser !
> It is only solved when i restart the django server with 'python manage.py 
> runserver' .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3398ed7-7745-4874-981b-311aedc18dca%40googlegroups.com.