Django python - Module not found -
i newbie might have done stupid. running python 3.3 , django 1.6.2.
when run local server via command line, error receive "p/1.1 404 1712" , error on browser "module not found" , exception location direct me urls.py line 22;
document_root=settings.static_root)
this part of urls.py:
from django.conf.urls import patterns, include, url django.conf import settings django.conf.urls import static django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # examples: url(r'^$', 'signups.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), ) if settings.debug: urlpatterns += static(settings.static_url, document_root=settings.static_root) urlpatterns += static(settings.media_url, document_root=settings.media_root)
this how settings.py looks:
# static files (css, javascript, images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ static_url = '/whattheheck/static/' # template location template_dirs = { os.path.join(os.path.dirname(base_dir), "whattheheck", "static", "templates"), } if debug: media_url = '/whattheheck/media/' static_root = os.path.join(os.path.dirname(base_dir), "whattheheck", "static", "static-only") media_root = os.path.join(os.path.dirname(base_dir), "whattheheck", "static", "media") staticflies_dirs = ( os.path.join(os.path.dirname(base_dir), "whattheheck", "static", "static") )
can please?
you forgot 1 static
in import statement, see documentation:
from django.conf.urls.static import static # ^^^^^^ 1
right now, tries use static
module function obviously, not work. error 'module' object not callable
raised when trying use module object (for example os
, sys
or third-party) callable (with __call__
method).
Comments
Post a Comment