0

I'm following the django tutorial over at nettuts tutorial

and I'm running into issues. I am all the way to the point where I have to define the location of my templates folder in settings.py. My settings.py looks a little different the the one the tutorials is using. I have entered :

       `TEMPLATES = [
       {
       'BACKEND': 'django.template.backends.django.DjangoTemplates',
      'DIRS': ['blog/templates'],
      'APP_DIRS': True,
       'OPTIONS': {
             'context_processors': [
                'django.template.context_processors.debug',
               'django.template.context_processors.request',
              'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                  ],
            },
         },
        ]`

and below is my traceback

    `Traceback:
     File "C:\Python34\lib\site-packages\django\core\handlers\base.py" in     get_response
      119.                 resolver_match = resolver.resolve(request.path_info)
      File "C:\Python34\lib\site-packages\django\core\urlresolvers.py" in resolve
     366.             for pattern in self.url_patterns:
  File "C:\Python34\lib\site-packages\django\core\urlresolvers.py" in url_patterns
     402.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
      File "C:\Python34\lib\site-packages\django\core\urlresolvers.py" in   urlconf_module
       396.             self._urlconf_module = import_module(self.urlconf_name)
       File "C:\Python34\lib\importlib\__init__.py" in import_module
      109.     return _bootstrap._gcd_import(name[level:], package, level)
       File "C:\Users\Rusty Enchiladea\firstblog\firstblog\urls.py" in <module>
       9.     url(r'^admin', include(admin.site.urls)),

   Exception Type: TypeError at /
    Exception Value: 'function' object is not subscriptable`

I am using a later version of django and am using python3.4, I know the tutorial is using older versions.

any idea how to get this to display in the index.html page I have made in my templates folder? my project name is firstblog and I have created an app named blog.

Thanks

user1968657
  • 19
  • 1
  • 6
  • Show the code of your `urls.py`, please. – catavaran Apr 08 '15 at 01:22
  • it turned out I had in urls.py named it myproject.app.views.home. As soon as I took out the project name and added the app to installed apps, then it worked. I'm so happy right now. I have 2 days to complete this project for an interview. – user1968657 Apr 08 '15 at 01:35

0 Answers0