python - ImportError: No module named remote -


i'm trying create following template tag on django:

from django import template django.utils import translation player.remote import mongodb  register = template.library()  @register.assignment_tag def load_item(itemid):   mongo = mongodb.instance()   return mongo['lol-%s' % translation.get_language()]['items'].find_one({'id': int(itemid)}) 

but whenever try load it, fails following error:

'items' not valid tag library: importerror raised loading tags.templatetags.items: no module named remote 

some notes:

  • i can import mongodb using manage.py shell
  • my project path on python path
  • 'player' on settings under 'installed_apps' area.
  • i've tried already: 'player.remote', 'remote', 'app.player.remote', 'teemo.app.player.remote', 'teemo.player.remote'
  • i'm using builtin server, since i'm still developing it
  • i'm using django 1.8 python 2.7.6 on ubuntu

structure (missing lot of files, in general):

teemo   manage.py   player     __init__.py     remote.py   templates     player       resume.html <-- importing 'items' tags   tags     templatetags       __init__.py       items.py 

what missing here?

you need add 'teemo.tags' installed_apps in order django find templatetags.

edit

it seems missing: teemo/tags/__init__.py file.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -