avafab
avafab

Reputation: 1701

django: using custom backend or admin for staff users?

I'm developing a management system in django for small business, I would like to have a system in which user login and access a a series of functions like entering list of products and monitor the expiration date of each product.

I'm not sure if it is better to let the user become a staff_user and give him the possibility to use the system by the classic admin interface or to build a custom backend reserving the admin interface for me only (the admin).

what is the best practice? django admin or custom backend using views with user privilege?

ps. for the moment the user will be only one, but I would like to scale the system so anyone could log_in and use it (without seeing the other users data if possible)

ps2. my problem is that I need some nested inlines with dgango admin I cannot show more than one nested inline in a single view. I would like to have a single view in which the staff user manage all data about the products.

thank you

Upvotes: 0

Views: 497

Answers (3)

Sudipta
Sudipta

Reputation: 4971

My suggestion is: You should try the existing django admin once. Unless you have highly customised requirement, it should work.

I'm guessing you want to build a portal where different users will update/add their own data and shouldn't be able to peek into other's data, something like an inventory management system.

  • Django admin has provisions for model-level permissions, you'll have to tweak it to administer object level permission inside a model.
  • You yourself (the admin) can be superuser, who can see everyone's data and other models which are not open to other guys.

Using groups and permissions, I think it can be achieved and will scale.

Upvotes: 1

I S
I S

Reputation: 437

Answering in common, django-admin is good in case you totally trust your staff members. Yes, you can customize it for almost any functionality needed, but it has some surprises and built-in permission system is a bit weird.

So, in your case custom backend looks much cheaper on long distance.

Anyway, you can give django-admin a try. If you won't find customization and user priveleges too hackish (as I do) - why not.

Upvotes: 0

esauro
esauro

Reputation: 1286

This more a phylosofical question than a technical question. Using generic CBVs is pretty easy to implement a custom backend, also the admin interface is really powerful and customizable.

I guess when you say "but I would like to scale the system so anyone could log_in" you are talking about business employees so I guess I'd use admin interface, but it depends on the number of employees the business has.

Upvotes: 0

Related Questions