TemplateSyntaxError: settings_tags is not a valid tag library

2024/10/7 0:18:51

i got this error when i try to run this test case: WHICH IS written in tests.py of my django application:

def test_accounts_register( self ):self.url = 'http://royalflag.com.pk/accounts/register/'self.c = Client()self.values = {'email': '[email protected]','first_name': 'bilal','last_name': 'bash','password1': 'bilal','password2': 'bilal',}self.response = self.c.post( self.url, self.values )

my django version is 1.2.1 and python 2.6 and satchmo version is 0.9.2-pre hg-unknown

the complete error log is:

    .E....
======================================================================
ERROR: test_accounts_register (administration.tests.AccountsRegisterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):File "C:\pytho\satchmo\administration\tests.py", line 53, in test_accounts_reg
isterself.response = self.c.get( self.url )File "C:\django\django\test\client.py", line 290, in getresponse = self.request(**r)File "C:\django\django\test\client.py", line 230, in requestresponse = self.handler(environ)File "C:\django\django\test\client.py", line 74, in __call__response = self.get_response(request)File "C:\django\django\core\handlers\base.py", line 141, in get_responsereturn self.handle_uncaught_exception(request, resolver, sys.exc_info())File "C:\django\django\core\handlers\base.py", line 180, in handle_uncaught_ex
ceptionreturn callback(request, **param_dict)File "C:\django\django\views\defaults.py", line 23, in server_errort = loader.get_template(template_name) # You need to create a 500.html templ
ate.File "C:\django\django\template\loader.py", line 157, in get_templatetemplate, origin = find_template(template_name)File "C:\django\django\template\loader.py", line 134, in find_templatesource, display_name = loader(name, dirs)File "C:\django\django\template\loader.py", line 42, in __call__return self.load_template(template_name, template_dirs)File "C:\django\django\template\loader.py", line 48, in load_templatetemplate = get_template_from_string(source, origin, template_name)File "C:\django\django\template\loader.py", line 168, in get_template_from_str
ingreturn Template(source, origin, name)File "C:\django\django\template\__init__.py", line 158, in __init__self.nodelist = compile_string(template_string, origin)File "C:\django\django\template\__init__.py", line 186, in compile_stringreturn parser.parse()File "C:\django\django\template\__init__.py", line 282, in parsecompiled_result = compile_func(self, token)File "C:\django\django\template\defaulttags.py", line 921, in load(taglib, e))
TemplateSyntaxError: 'settings_tags' is not a valid tag library: Template librar
y settings_tags not found, tried django.templatetags.settings_tags,satchmo_store
.shop.templatetags.settings_tags,django.contrib.admin.templatetags.settings_tags
,django.contrib.comments.templatetags.settings_tags,django.contrib.humanize.temp
latetags.settings_tags,livesettings.templatetags.settings_tags,sorl.thumbnail.te
mplatetags.settings_tags,satchmo_store.contact.templatetags.settings_tags,tax.te
mplatetags.settings_tags,pagination.templatetags.settings_tags,product.templatet
ags.settings_tags,payment.templatetags.settings_tags,payment.modules.giftcertifi
cate.templatetags.settings_tags,satchmo_utils.templatetags.settings_tags,app_plu
gins.templatetags.settings_tags,tinymce.templatetags.settings_tags----------------------------------------------------------------------
Ran 6 tests in 47.468sFAILED (errors=1)
Destroying test database 'default'...
Answer

It seems to me you probably have a code like {% load settings_tags %} somewhere in your template. Django looks for templatetags/settings_tags.py file in your installed apps' directories. This is the result of not finding a file like this. Maybe the app, which contains it is not in your INSTALLED_APPS or maybe it's a typo. You should be getting the same error when you put this url in your browser.

https://en.xdnf.cn/q/70308.html

Related Q&A

Setting NLTK with Stanford NLP (both StanfordNERTagger and StanfordPOSTagger) for Spanish

The NLTK documentation is rather poor in this integration. The steps I followed were:Download http://nlp.stanford.edu/software/stanford-postagger-full-2015-04-20.zip to /home/me/stanford Download http:…

python variable scope in nested functions

I am reading this article about decorator.At Step 8 , there is a function defined as:def outer():x = 1def inner():print x # 1return innerand if we run it by:>>> foo = outer() >>> foo.…

How can I throttle Python threads?

I have a thread doing a lot of CPU-intensive processing, which seems to be blocking out other threads. How do I limit it?This is for web2py specifically, but a general solution would be fine.

get lastweek dates using python?

I am trying to get the date of the last week with python. if date is : 10 OCT 2014 meansIt should be print10 OCT 2014, 09 OCT 2014, 08 OCT 2014, 07 OCT 2014, 06 OCT 2014, 05 OCT 2014, 04 OCT 2014I trie…

Why is vectorized numpy code slower than for loops?

I have two numpy arrays, X and Y, with shapes (n,d) and (m,d), respectively. Assume that we want to compute the Euclidean distances between each row of X and each row of Y and store the result in array…

Handle TCP Provider: Error code 0x68 (104)

Im using this code to sync my db with the clients:import pyodbcSYNC_FETCH_ARRAY_SIZE=25000# define connection + cursorconnection = pyodbc.connect()cursor = connection.cursor()query = select some_column…

vectorized radix sort with numpy - can it beat np.sort?

Numpy doesnt yet have a radix sort, so I wondered whether it was possible to write one using pre-existing numpy functions. So far I have the following, which does work, but is about 10 times slower tha…

Which library should I use to write an XLS from Linux / Python?

Id love a good native Python library to write XLS, but it doesnt seem to exist. Happily, Jython does.So Im trying to decide between jexcelapi and Apache HSSF: http://www.andykhan.com/jexcelapi/tutoria…

put_records() only accepts keyword arguments in Kinesis boto3 Python API

from __future__ import print_function # Python 2/3 compatibility import boto3 import json import decimal#kinesis = boto3.resource(kinesis, region_name=eu-west-1) client = boto3.client(kinesis) with ope…

Setting a transparent main window

How to set main window background transparent on QT? Do I need an attribute or a style? Ive tried setting the opacity, but it didnt work for me. app.setStyleSheet("QMainWindow {opacity:0}"