Django管理员:没有看到任何应用程式(权限问题?) [英] Django Admin: not seeing any app (permission problem?)

查看:121
本文介绍了Django管理员:没有看到任何应用程式(权限问题?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,Django运行一些自定义应用程序。我没有使用Django ORM,只是视图和模板,但现在我需要存储一些信息,所以我在一个应用程序中创建了一些模型并启用了管理员。



问题是当我登录管理员时,它只是说你没有编辑任何东西的权限,甚至没有Auth应用程序显示在页面。我正在使用与syncdb一起创建的用户作为超级用户。



在同一个服务器中,我有另一个正在使用Admin的网站。



使用Django 1.1.0与Apache / 2.2.10 mod_python / 3.3.1 Python / 2.5.2,与psql(PostgreSQL)8.1.11全部在Gentoo Linux 2.6.23



任何想法可以找到解决方案?



非常感谢。



更新:它可以从开发服务器工作。我敢打赌这与某些文件系统许可有关,但我找不到它。



UPDATE2:vhost配置文件:

 <位置/> 
SetHandler python程序
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE gpx.settings
PythonDebug On
PythonPath['/ var / django'] + sys.path
< / Location>

更新3:更多信息




  • / var / django / gpx / init .py存在且为空

  • 我从/ var / django / gpx目录

  • 该网站是GPX,其中一个应用程序是可以忍受的,并且生活在/ var / django / gpx / contable

  • 用户apache是webdev组和所有这些目录和文件属于该组,并具有rw权限



更新4:确认设置文件是一样的对于apache和runserver(重命名并且都破坏)



更新5:/var/django/gpx/contable/init.py exists



这是urls.py的相关部分:

  urlpatterns =模式('',
(r'^ admin /',include(admin.site.urls)),

urlpatterns + = patterns('gpx',
r'^ $','menues.views.index'),
(r'^ adm / $','menues.views.admIndex'),


解决方案

p>希望这可以帮助某人,但是我们遇到了同样的问题,因为有人为settings.py添加了不同的身份验证后端,并且没有保留默认的ModelBackend。将设置更改为:

  AUTHENTICATION_BACKENDS =(
'auth.authentication.EmailBackend',
'django .contrib.auth.backends.ModelBackend',

为我们修复。 / p>

I have a site with Django running some custom apps. I was not using the Django ORM, just the view and templates but now I need to store some info so I created some models in one app and enabled the Admin.

The problem is when I log in the Admin it just says "You don't have permission to edit anything", not even the Auth app shows in the page. I'm using the same user created with syncdb as a superuser.

In the same server I have another site that is using the Admin just fine.

Using Django 1.1.0 with Apache/2.2.10 mod_python/3.3.1 Python/2.5.2, with psql (PostgreSQL) 8.1.11 all in Gentoo Linux 2.6.23

Any ideas where I can find a solution?

Thanks a lot.

UPDATE: It works from the development server. I bet this has something to do with some filesystem permission but I just can't find it.

UPDATE2: vhost configuration file:

<Location />
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE gpx.settings
  PythonDebug On
  PythonPath "['/var/django'] + sys.path"
</Location>

UPDATE 3: more info

  • /var/django/gpx/init.py exists and is empty
  • I run python manage.py from /var/django/gpx directory
  • The site is GPX, one of the apps is contable and lives in /var/django/gpx/contable
  • the user apache is webdev group and all these directories and files belong to that group and have rw permission

UPDATE 4: confirmed that the settings file is the same for apache and runserver (renamed it and both broke)

UPDATE 5: /var/django/gpx/contable/init.py exists

This is the relevan part of urls.py:

urlpatterns = patterns('',
                       (r'^admin/', include(admin.site.urls)),
                      )
urlpatterns += patterns('gpx',
   (r'^$',                         'menues.views.index'),
   (r'^adm/$',                     'menues.views.admIndex'),

解决方案

Hopefully this helps someone, but we had this same problem because someone added a different authentication backend to settings.py and did not keep the default ModelBackend. Changing the setting to:

AUTHENTICATION_BACKENDS = (
    'auth.authentication.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

fixed it for us.

这篇关于Django管理员:没有看到任何应用程式(权限问题?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆