Hansong Li
Hansong Li

Reputation: 437

django: is there a way to 'import' functionality from admin site?

I am trying to build my own site but really envy some features provided by admin, like model change history, user group authentication, login and stuff. I am assuming there should be a easy way to port all that from admin since they are already there.

1. For example, does django keeps record of change history of a specific instance of a model like what we have in admin, so that I could just call it?

2. Does Django have built in user and group authentication system that, like, I just put tags on forms to specify what user group can edit it?

Upvotes: 0

Views: 36

Answers (1)

vishes_shell
vishes_shell

Reputation: 23504

Sure you can get all the functionality that Django admin has.

  1. That's how actions history is displayed in template: link. This what action_list is, that is rendered in template: link. And finally, LogEntry model is fully described in django.contrib.admin.models.
  2. As the first point is described, you can find the information about authentication, as @user2976657 pointed you can find it in the docs, or run through source code

Upvotes: 1

Related Questions