python - Django-administration css file not rendered -


i using django administration basic crud . admin template loads , css files loaded showing no effect @ all.

i tried collect static files below

manage.py collectstaic 

it shows following errors

traceback (most recent call last):   file "c:\python27\lib\site-packages\django\bin\hello\manage.py", line 10, in module>     execute_from_command_line(sys.argv)   file "c:\python27\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line     utility.execute()   file "c:\python27\lib\site-packages\django\core\management\__init__.py", line 392, in execute     self.fetch_command(subcommand).run_from_argv(self.argv)   file "c:\python27\lib\site-packages\django\core\management\__init__.py", line 272, in fetch_command     klass = load_command_class(app_name, subcommand)   file "c:\python27\lib\site-packages\django\core\management\__init__.py", line 76, in load_command_class     return module.command()   file "c:\python27\lib\site-packages\django\contrib\staticfiles\management\com ands\collectstatic.py", line 58, in __init__     self.storage.path('')   file "c:\python27\lib\site-packages\django\contrib\staticfiles\storage.py", l ne 46, in path     raise improperlyconfigured("you're using staticfiles app " django.core.exceptions.improperlyconfigured: you're using staticfiles app w thout having set static_root setting filesystem path. 

how solve ut?

include static_root, eg.

static_root = 'staticfiles'  static_url = '/static/'  staticfiles_dirs = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static') 

and include corresponding url in urls.py file eg.

urlpatterns = patterns('', ) +static(settings.media_url, document_root=settings.media_root) 

remember put

from django.conf import settings django.conf.urls.static import static 

in urls.py

then in terminal type python manage.py collectstatic not collectstaic


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -