These are chat archives for django/django

Dec 2016
Jatto Abdulqahhar
Dec 21 2016 01:20
hello guys.. am new to django and trying to do some project on it as my learning curve. but i am having trouble setting up newsletter subscription and integration with mailchimp etc and also having troubles sending mails to my gmail via the contact form on the contact page! can anyone help out?
Zachary E. Sohovich
Dec 21 2016 01:34
When you say having trouble sending emails, could you elaborate more? Are you getting errors?
Dec 21 2016 11:35
Hello Everyone !! I wanted to get started with django by making an online judge for hosting college programming competitions ... I needed some help on how to get started ... ??
Dec 21 2016 11:36
django-admin startproject
Dec 21 2016 11:52

Hi guys. I've a django rest framework requirement and I'm trying to figure out how to implement it.
Here is the req: implement three roles with different permission levels:
1 - A regular user would only be able to CRUD on their owned records
2 - A user manager would be able to CRUD users
3 - An admin would be able to CRUD all records and users.

Could you provide me any idea? I know django has model permission (create, update, destroy) but I think this will not work for this situation.

vaibhav jain
Dec 21 2016 11:55
@Federico-Comesana You can divide users into three groups and then you can simply check in custom Permission class what to do based on the role assigned to that group. . .
Dec 21 2016 12:01
@vaibhav-jain So I've to prohibit that a user cannot belong to more than one group. This is must be done programatically ? Because a (2) User Manager should be able to change user level permission.
@vaibhav-jain What about creating an attribute on user profile call "user_type" that is a choices field?
and then check permission using this attribute instead of querying if a user belongs to a group.
Dec 21 2016 12:35
Anyone else?
Arun Kumar
Dec 21 2016 14:00
Hi all, Is it possible to use multiple views in single template using function based view?
Mark Heppner
Dec 21 2016 21:46
@armsarun do you mean multiple templates in a single function-based view?
Mario Juárez
Dec 21 2016 23:50
@armsarun or do you mean use multiple views with a single template ? :p