Im really confused about what is all i need to consider for creating a django aplication with almost similar functionality to it's own admin. The index page should deploy the list of models the user has access to modify or create...almost the same as when you put admin.site.register(MyModel) but with permission restriction. Im not sure how should i ckeck permissions, and show 1 ,2 or many "ModelAdmis" on my main page. btw admin users are redirected to the admin index page, non-admins go to my page
-
Please post what you've already tried on your own to solve this problem. SO is a place to get help on where you're stuck not have other people code for you. – Charlie Apr 01 '15 at 19:00
-
i havn't tried anything yet; there are so many things to consider; the admin source code is a bit complex for me, im looking forward to deploy the allowed "ModelAdmins" to a specific user. There should be some sort of django object to implement the index page interface look for Models similar to the admin's one...im talking about [Model ][create][change] for evety model the user has permission to administrate(create, modify o both) – Sebastian Cattaneo Apr 01 '15 at 23:58
-
Have you tried looking at [this](http://stackoverflow.com/questions/6310983/django-admin-specific-user-admin-content) or this [this](http://reinout.vanrees.org/weblog/2011/09/30/django-admin-filtering.html)? If either of those don't make sense I can try to explain. – Charlie Apr 02 '15 at 16:57
2 Answers
Before you consider creating a django admin from scratch, you should read the answers to this question Django Admin app or roll my own?
I couldn't find any resource on how to create a django admin from scratch, but here's what you should do if this is your first time overriding a framework's functionality (in my humble opinion):
- Understand and make sure you are comfortable with the django admin app
start from the docs https://docs.djangoproject.com/en/1.7/#the-admin - Head over to the django admin app source code so you can start reading the internals of the functionality you want to implement/override in your new admin app.
source code can be found here https://github.com/django/django/tree/master/django/contrib/admin
(this may involve reading other apps source code too)
After those two steps you should have an idea on how the admin app is implemented and it's dependencies, then you can start creating your custom admin app.
an example on how this may go can be found in this qestion:
How to override Django admin's views?
If you are building something new, try to separate the UI from the backend. You can build your UI using react, angular or whatever and interact with django using the API. To build the API you can use the Django Rest Framework.
Don't use the Django Admin as a public interface. Use that only for the admins!
If you start to use the Django Admin as interface for your public site, you'll fight with the package to tailor and secure the views to avoid destructive actions. What happen if you forget a readonly field? What if the user deleted something ON_CASCADE?
Building the UI you are totally free and you can customise easily everything without fighting the django admin package (it's awesome package but is not provided for public use)

- 2,880
- 22
- 29