How to get unique users across multiple Django sites powered by the “sites” framework?

前端 未结 3 667
庸人自扰
庸人自扰 2020-12-04 14:57

I am building a Django site framework which will power several independent sites, all using the same apps but with their own templates. I plan to accomplish this by using mu

3条回答
  •  醉话见心
    2020-12-04 15:14

    You have to know, that many people complain for Django default authorization system and privileges - it has simply rules for objects, for instances of the objects - what it means, that without writing any code it woudn't be possible.

    However, there are some authorization hooks which can helps you to achieve this goal, for example:

    Take a look there: http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/models.py and for class Permission.

    You can add your own permission and define rules for them (there is a ForeignKey for User and for ContentType).

    However2, without monkeypatching/change some methods it could be difficult.

提交回复
热议问题