getting django apps packaged as python eggs to work with django admin docs
i've taken over a django (1.1) project which has a number of django apps installed as eggs (in /usr/lib/python2.6/site-packages/). This works fine everywhere except for the django admin docs. Trying to view the docs for tags or filters here gets me:
File "/usr/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admindocs/views.py" in load_all_installed_temp开发者_JAVA百科late_libraries
313. libraries = [os.path.splitext(p)[0] for p in os.listdir(e) if p.endswith('.py') and p[0].isalpha()]
Exception Type: OSError at /admin/doc/tags/
Exception Value: (20, 'Not a directory')
where
e = '/usr/lib/python2.6/site-packages/django_tinymce-1.5-py2.6.egg/tinymce/templatetags'
so basically the django admin docs can't auto load the eggs because they are zip archives, not directories.
having done some searching i think my options are:
- unpack the eggs in place
- adapt http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#using-eggs-with-mod-python (i'm using mod_wsgi)
- hacking the django admindocs code to deal properly with eggs
none of these are probably really difficult but none are exactly appealing on a production server. has anyone else dealt with this? what would you recommend?
Have you actually specified a directory writable by user that Apache is running your code, for the egg cache directory.
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Access_Rights_Of_Apache_User
精彩评论