Should there be separate django app for every user type in a django project?

162 views
Skip to first unread message

test user

unread,
Oct 13, 2019, 7:34:10 PM10/13/19
to Django users
Hi,

I have got multiple user types(around 4 to 5) in my Django project. Should i make separate Django app for each user type? Each user type will have different interface after they log into the website.

Aldian Fazrihady

unread,
Oct 13, 2019, 7:47:29 PM10/13/19
to django...@googlegroups.com
Hi, 
a new Django app should be based on a new business feature/aspect, not user type. 
If different behavior needed for different type of user, you can check the permission or group of the user: https://docs.djangoproject.com/en/2.2/topics/auth/default/

On Mon, Oct 14, 2019 at 6:33 AM test user <redma...@gmail.com> wrote:
Hi,

I have got multiple user types(around 4 to 5) in my Django project. Should i make separate Django app for each user type? Each user type will have different interface after they log into the website.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f7dc3b18-ab79-42ea-9ba2-7d3b2b8187fb%40googlegroups.com.


--
Regards,

Joalbert Palacios

unread,
Oct 13, 2019, 11:11:46 PM10/13/19
to django...@googlegroups.com
I think you don't need several apps for each user type. You have different ways to approach it, one could be used with permisology policy for each model and each user type in the Django app, other one could be managing the policies by yourself. 

I suggest to search in Google a entry in the blog simpleisbetterthancomplex.com ir read documentation in django for further details.

I hope this helps.

 

On Sun, Oct 13, 2019, 8:33 PM test user <redma...@gmail.com> wrote:
Hi,

I have got multiple user types(around 4 to 5) in my Django project. Should i make separate Django app for each user type? Each user type will have different interface after they log into the website.

--

test user

unread,
Oct 14, 2019, 1:10:20 PM10/14/19
to Django users
Yes, i have checked this article many times. It tells you how to implement user model to handle multiple user types not on how the apps should be laid out in that case.

My question was if you have 5 types of users in your website and each user has different interfaces and tasks to perform. Should code layout be with one Django app or split up into 5 apps along with the common app which handles the common functionality?


On Monday, October 14, 2019 at 8:11:46 AM UTC+5, Joalbert Palacios wrote:
I think you don't need several apps for each user type. You have different ways to approach it, one could be used with permisology policy for each model and each user type in the Django app, other one could be managing the policies by yourself. 

I suggest to search in Google a entry in the blog simpleisbetterthancomplex.com ir read documentation in django for further details.

I hope this helps.

On Sun, Oct 13, 2019, 8:33 PM test user <redma...@gmail.com> wrote:
Hi,

I have got multiple user types(around 4 to 5) in my Django project. Should i make separate Django app for each user type? Each user type will have different interface after they log into the website.

--
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.

Andréas Kühne

unread,
Oct 15, 2019, 8:50:21 AM10/15/19
to django...@googlegroups.com
Hi,

That is for you to decide - that's a project specific decision.

However I wouldn't do that - I would filter the html templates and only display the items that should be displayed to each user type. Then I would add checks to the views so that the user is the correct type to display the view.

So I would group functionality for each application - so that one application handles users for example, another books, another authors for example.

Regards,

Andréas


To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/76a5c431-c69e-49f5-beca-8ae883bf0997%40googlegroups.com.

vineet daniel

unread,
Oct 16, 2019, 12:41:15 AM10/16/19
to django...@googlegroups.com
There aren't any mandatory rules but standards to make code maintainable, following standards you shouldn't do it but depends upon how much work you need to do for each user type and how much closely they are linked to each other. if there is no or minimal link and a lot of switching will be needed then its better to keep them separate. Putting if-else or switch-case everywhere will stop making sense once your project ages and you've written a lot of lines of code. IF its a small project then go with standard. I have these suggestions to make but please feel free to do whatever you want and you are comfortable in doing just keep it mind that it should be easy to maintain for other developers as well.

Regards
Vineet Daniel
Cell          : +918527565696
Websites : 
Blog   |   Linkedin  |  Twitter



Reply all
Reply to author
Forward
0 new messages