0

I have a weird issue when I try to save a new user through the admin interface. I get a 403 HTTP status code error.

I've changed nothing in the auth application.

Here are my middlewares:

MIDDLEWARE_CLASSES = (
    'johnny.middleware.LocalStoreClearMiddleware',
    'johnny.middleware.QueryCacheMiddleware',
    #'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    #'django.middleware.cache.FetchFromCacheMiddleware',
)

I've no idea where to look, or either have any idea of what could provocate this. Any clue is welcome.

4

1 回答 1

1

Your user probably has not permissions to add new users. It's a normal behaviour to return 403 code in this case. View the doc, please: https://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.decorators.permission_required.

And (in this case) your user can have permission to delete users because it's the decoupled permissions.

您可以查看用户的权限:http: //yoursite.com/admin/auth/user/ {user_id}/(来自超级用户或可以查看其他用户权限的用户)。

更新。问题的作者找到了决定:这种情况是因为 Apache 设置(关闭 mod_security 解决了问题)。不幸的是,我对该模块没有深入的了解,也无法提供更详细的信息。

于 2012-06-07T13:47:27.973 回答