Sto seguendo il numero ufficiale di Django Tutorial 2 ma per qualche motivo non riesco a creare un sito di amministrazione nonostante abbia seguito correttamente tutti i passaggi.Sito amministratore: TemplateDoesNotExist at/admin/
Questo è l'errore che ottengo:
TemplateDoesNotExist at /admin/
admin/login.html
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.3.1
Exception Type: TemplateDoesNotExist
Exception Value:
admin/login.html
Exception Location: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/template/loader.py in find_template, line 138
Python Executable: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.2
Python Path:
['/Users/jcugley/Documents/Programming/Python/Django/mysite',
'/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/Library/Python/2.7/site-packages']
Server time: Tue, 24 Jan 2012 18:40:03 -0600
L'errore si verifica dopo che io commento dalle linee seguenti (commentate):
### urls.py ###
from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin # THIS LINE
admin.autodiscover() # THIS LINE
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)), # THIS LINE
)
Se li io commento di nuovo si libera dell'errore.
ho fare hanno django.contrib.admin
nei miei INSTALLED_APPS in settings.py
Cosa hai impostato TEMPLATE_DIRS e TEMPLATE_LOADERS su settings.py –
TEMPLATE_DIRS è vuota (nulla è stato detto nel tutorial) e TEMPLATE_LOADERS ha 'django.template.loaders.filesystem.Loader' e 'django.template.loaders. app_directories.Caricatore '(I caricatori di modelli non sono mai menzionati) – Jarrod
Puoi incollare l'intero codice zip a dropbox o qualcosa del genere? –