TemplateDoesNotExist at /music/1/

0

Witam, nie mogę uruchomić strony na lokalnym serwerze, jakiś błąd jest w kodzie. Który plik by był jeszcze potrzebny abym podał to napiszcie, wkleje go, a tak to mi wyskakuje.

TemplateDoesNotExist at /music/1/
music/detail.html
Request Method:	GET
Request URL:	http://127.0.0.1:8000/music/1/
Django Version:	1.9.5
Exception Type:	TemplateDoesNotExist
Exception Value:	
music/detail.html
Exception Location:	/usr/lib/python3.5/site-packages/django/template/loader.py in get_template, line 43
Python Executable:	/usr/bin/python
Python Version:	3.5.1
Python Path:	
['/home/mors/website',
 '/usr/lib/python35.zip',
 '/usr/lib/python3.5',
 '/usr/lib/python3.5/plat-linux',
 '/usr/lib/python3.5/lib-dynload',
 '/usr/lib/python3.5/site-packages']
Server time:	Czw, 7 Kwie 2016 11:54:14 +0000
Template-loader postmortem

Django tried loading these templates, in this order:

Using engine django:
django.template.loaders.filesystem.Loader: /home/mors/website/templates/music/detail.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python3.5/site-packages/django/contrib/admin/templates/music/detail.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/lib/python3.5/site-packages/django/contrib/auth/templates/music/detail.html (Source does not exist)
Traceback Switch to copy-and-paste view

/usr/lib/python3.5/site-packages/django/core/handlers/base.py in get_response
                    response = self.process_exception_by_middleware(e, request) ...
▼ Local vars
Variable	Value
middleware_method	
<bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0xb586f2cc>>
callback_args	
()
resolver	
<RegexURLResolver 'website.urls' (None:None) ^/>
response_is_rendered	
False
callback	
<function detail at 0xb612f854>
request	
<WSGIRequest: GET '/music/1/'>
urlconf	
'website.urls'
resolver_match	
ResolverMatch(func=music.views.detail, args=(), kwargs={'album_id': '1'}, url_name=detail, app_names=['music'], namespaces=['music'])
self	
<django.core.handlers.wsgi.WSGIHandler object at 0xb650db0c>
callback_kwargs	
{'album_id': '1'}
response	
None
wrapped_callback	
<function detail at 0xb612f854>
/usr/lib/python3.5/site-packages/django/core/handlers/base.py in get_response
                    response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
▼ Local vars
Variable	Value
middleware_method	
<bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0xb586f2cc>>
callback_args	
()
resolver	
<RegexURLResolver 'website.urls' (None:None) ^/>
response_is_rendered	
False
callback	
<function detail at 0xb612f854>
request	
<WSGIRequest: GET '/music/1/'>
urlconf	
'website.urls'
resolver_match	
ResolverMatch(func=music.views.detail, args=(), kwargs={'album_id': '1'}, url_name=detail, app_names=['music'], namespaces=['music'])
self	
<django.core.handlers.wsgi.WSGIHandler object at 0xb650db0c>
callback_kwargs	
{'album_id': '1'}
response	
None
wrapped_callback	
<function detail at 0xb612f854>
/home/mors/website/music/views.py in detail
    return render(request, 'music/detail.html', {'album': album}) ...
▼ Local vars
Variable	Value
album	
<Album: Killers - Iron Maiden>
album_id	
'1'
request	
<WSGIRequest: GET '/music/1/'>
/usr/lib/python3.5/site-packages/django/shortcuts.py in render
            template_name, context, request=request, using=using) ...
▼ Local vars
Variable	Value
context	
{'album': <Album: Killers - Iron Maiden>}
dictionary	
<object object at 0xb70f04c8>
context_instance	
<object object at 0xb70f0eb0>
using	
None
status	
None
dirs	
<object object at 0xb70f04d0>
request	
<WSGIRequest: GET '/music/1/'>
template_name	
'music/detail.html'
content_type	
None
current_app	
<object object at 0xb70f0dc8>
/usr/lib/python3.5/site-packages/django/template/loader.py in render_to_string
            template = get_template(template_name, using=using) ...
▼ Local vars
Variable	Value
context	
{'album': <Album: Killers - Iron Maiden>}
context_instance	
<object object at 0xb70f0eb0>
using	
None
dirs	
<object object at 0xb70f04d0>
dictionary	
<object object at 0xb70f04c8>
request	
<WSGIRequest: GET '/music/1/'>
template_name	
'music/detail.html'
/usr/lib/python3.5/site-packages/django/template/loader.py in get_template
    raise TemplateDoesNotExist(template_name, chain=chain) ...
▼ Local vars
Variable	Value
engines	
[<django.template.backends.django.DjangoTemplates object at 0xb610b90c>]
chain	
[TemplateDoesNotExist('music/detail.html',)]
using	
None
dirs	
<object object at 0xb70f04d0>
engine	
<django.template.backends.django.DjangoTemplates object at 0xb610b90c>
template_name	
'music/detail.html'

urls.py

 
from django.conf.urls import url
from . import views

app_name = 'music'

urlpatterns = [
    # /music/
    url(r'^$', views.index, name='index'),


    # /music/album_id/
    url(r'^(?P<album_id>[0-9]+)/$', views.detail, name='detail'),

    # /music/album_id/favorite/
    url(r'^(?P<album_id>[0-9]+)/favorite/$', views.favorite, name='favorite'),
]
0

Dopisz nazwę apki do INSTALLED_APPS, np.:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'music',
]

1 użytkowników online, w tym zalogowanych: 0, gości: 1