PythonAnywhere->TemplateSyntaxError: 'blog_extras' is not a valid tag library: ImportError raised loading nrpccms.newsroom.templatetags.blog_extras: No module named settings

57 views
Skip to first unread message

Mario Osorio

unread,
Oct 18, 2013, 9:56:55 PM10/18/13
to django...@googlegroups.com
Trying to deploy my very first app in PythonAnywhere (or at AnywhereAnywhere for that matter) I'm currently getting

    TemplateSyntaxError: 'blog_extras' is not a valid tag library: ImportError raised loading nrpccms.newsroom.templatetags.blog_extras: No module named settings

(full error log)[http://dpaste.com/1421863/]
(see error live)[http://nimbiotics.pythonanywhere.com/]

The app newsroom is the very first one in INSTALLED_APPS:

    #! python
    # ...
    INSTALLED_APPS = (
        "nrpccms.newsroom",
        "django.contrib.admin",
    # ...

Also, blog_extras.py is at MY_PROJECT/MY_APP/templates, and there IS a __init__.py at MY_PROJECT/mY_APP

Please help me pinpoint my mistakes as I don't know where else to look: This are my first baby steps in the arts of webapps/django

Thanks a lot in advanced!

Mario Osorio

unread,
Oct 19, 2013, 8:35:55 PM10/19/13
to django...@googlegroups.com

Fixed: I had to add my projects folder to sys.path in my wsgi script. This is my new wsgi script:

activate_this = '/home/nimbiotics/.virtualenvs/nrpccms/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

import os
import sys

path = '/home/nimbiotics/projects'
if path not in sys.path:
    sys.path.append(path)

###########################################################
nrpccms_path = '/home/nimbiotics/projects/nrpccms'
if nrpccms_path not in sys.path:
    sys.path.append(nrpccms_path)
###########################################################

os.environ['DJANGO_SETTINGS_MODULE'] = 'nrpccms.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Reply all
Reply to author
Forward
0 new messages