0

I installed the app django-portfolio, and can use runserver ok. When I go to the admin page to add a new object to the Collections model, I get the following error page.

TemplateDoesNotExist at /admin/portfolio/collection/add/
adminsortable/edit_inline/stacked.html
Request Method: GET
Request URL:    http://127.0.0.1:8000/admin/portfolio/collection/add/
Django Version: 1.8.3
Exception Type: TemplateDoesNotExist
Exception Value:    
adminsortable/edit_inline/stacked.html
Exception Location: C:\Python27\lib\site-packages\django\template\engine.py in find_template, line 146
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.5
Python Path:    
['C:\\depot',
 'C:\\Users\\user\\AppData\\Roaming\\Python\\Python27\\site-packages\\setuptools-5.4.1-py2.7.egg',
 'C:\\WINDOWS\\SYSTEM32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Users\\user\\AppData\\Roaming\\Python\\Python27\\site-packages',
 'C:\\Python27\\lib\\site-packages']
Server time:    Fri, 14 Aug 2015 17:12:32 +0800
Template-loader postmortem

Django tried loading these templates, in this order: Using loader
django.template.loaders.filesystem.Loader: Using loader
django.template.loaders.app_directories.Loader:
C:\Python27\lib\site-packages\django\contrib\admin\templates\adminsortable\edit_inline\stacked.html
(File does not exist)
C:\Python27\lib\site-packages\django\contrib\auth\templates\adminsortable\edit_inline\stacked.html
(File does not exist)
C:\depot\depotapp\templates\adminsortable\edit_inline\stacked.html
(File does not exist)
C:\depot\portfolio\templates\adminsortable\edit_inline\stacked.html
(File does not exist)
Matt Seymour
  • 8,880
  • 7
  • 60
  • 101
ming
  • 427
  • 1
  • 5
  • 14

1 Answers1

0

I think that you haven't registered your app in admin.py file in your app directory.

Do this in admin.py in your app directory (and not project):

from django.contrib import admin
from app.models import MyModel

admin.site.register(MyModel)

Considering that your app name is app and your model name is MyModel

Do this for all the models in your app.

Abhyudit Jain
  • 3,640
  • 2
  • 24
  • 32