私はDjangoを初めて使用し、管理領域のcssはレンダリングされません。最初に、管理モジュールがロードされたアプリを作成しました。それが私が行ったことです。
デバッグモードをfalseに変更してsetting.pyを構成し、データベースクレデンシャルを追加しました。それから:
manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
-
manage.py collectstatic
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/base.css'
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/changelists.css'
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/dashboard.css'
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/forms.css'
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/ie.css'
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/login.css'
Copying '/Library/Python/2.7/site-packages/django/contrib/admin/static/admin/css/rtl.css'
(...)
サーバーを起動すると何が得られるか
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[09/Feb/2013 13:57:53] "GET /admin/ HTTP/1.1" 200 3270
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
File "/Library/Python/2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
File "/Library/Python/2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
response = self.get_response(request)
response = self.get_response(request)
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 153, in get_response
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 153, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
return callback(request, **param_dict)
ホームページに「サーバーエラーが発生しました。管理者に連絡してください。」と表示されます。site.com/admin/にアクセスできますが、cssはありません。プロジェクトフォルダは次のようになります。
--project
----manage.py
----admin
-------css
-------img
-------js
----project
-------setting.py
-------urls.py
-------wsgi.py
-------__init__.py