django.core.exceptions.ImproperlyConfigured: Invalid currency locale specified for SHOP_CURRENCY_LOCALE: 'en_US.ISO8859-1'. You'll need to set the locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in your settings module.
I have these in my environment:
declare -x LC_CTYPE="en_US.ISO8859-1"
declare -x LOCALE="en_US.ISO8859-1"
This is the same even if I change the SHOP_CURRENCY_LOCALE to en_US.UTF-8, or en_GB.UTF-8 and when I change the environment variables accordingly.
Any ideas?
Eric
en_US.ISO8859-1
en_US.ISO8859-15
en_US.UTF-8
en_GB.ISO8859-1
en_GB.ISO8859-15
en_GB.UTF-8
--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/ahNvEvQkV8s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
I git cloned my live site’s code to a new development server so that I can add some more features, and at the same time test it out on a BSD OS (live site’s running Debian).
Running the site via gunicorn gave me the locale error, so I tried running it as ./manage.py runserver to see if it made a difference. In this case the error was the same.
django.core.exceptions.ImproperlyConfigured: Invalid currency locale specified for SHOP_CURRENCY_LOCALE: 'en_US.UTF-8'. You'll need to set the locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in your settings module.
--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
SHOP_CURRENCY_LOCALE = 'en_US.UTF-8'
SHOP_USE_RATINGS = False
(test)-bash-4.2# python manage.py createdb --noinput
/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/conf.py:51: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django 1.5 requires. Will fall back to the domains configured as sites.
warn("You haven't defined the ALLOWED_HOSTS settings, which "
/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/conf.py:59: UserWarning: TIME_ZONE setting is not set, using closest match: Asia/Singapore
warn("TIME_ZONE setting is not set, using closest match: %s" % tz)
/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/conf.py:92: UserWarning: mezzanine.pages.context_processors.page is required in the TEMPLATE_CONTEXT_PROCESSORS setting. Adding it now, but you should update settings.py to explicitly include it.
"explicitly include it." % cp)
Traceback (most recent call last):
File "manage.py", line 29, in <module>
execute_from_command_line(sys.argv)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/core/management/__init__.py", line 16, in <module>
from mezzanine.utils.tests import copy_test_to_media
File "/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/tests.py", line 17, in <module>
User = get_user_model()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 127, in get_user_model
user_model = get_model(app_label, model_name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/db/models/loading.py", line 271, in get_model
self._populate()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate
self.load_app(app_name, True)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
models = import_module('%s.models' % app_name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/models.py", line 48, in <module>
class Priced(models.Model):
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/models.py", line 54, in Priced
unit_price = fields.MoneyField(_("Unit price"))
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/fields.py", line 46, in __init__
set_locale()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/utils.py", line 146, in set_locale
raise ImproperlyConfigured(msg % currency_locale)
django.core.exceptions.ImproperlyConfigured: Invalid currency locale specified for SHOP_CURRENCY_LOCALE: ''. You'll need to set the locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in your settings module.
(test)-bash-4.2#
(test)-bash-4.2# locale -a|grep en_US
en_US.ISO8859-1
en_US.ISO8859-15
en_US.UTF-8
SHOP_CURRENCY_LOCALE="en_US.UTF-8"
(test)-bash-4.2# python manage.py createdb --noinput
/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/conf.py:51: UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django 1.5 requires. Will fall back to the domains configured as sites.
warn("You haven't defined the ALLOWED_HOSTS settings, which "
/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/conf.py:59: UserWarning: TIME_ZONE setting is not set, using closest match: Asia/Singapore
warn("TIME_ZONE setting is not set, using closest match: %s" % tz)
/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/conf.py:92: UserWarning: mezzanine.pages.context_processors.page is required in the TEMPLATE_CONTEXT_PROCESSORS setting. Adding it now, but you should update settings.py to explicitly include it.
"explicitly include it." % cp)
Traceback (most recent call last):
File "manage.py", line 29, in <module>
execute_from_command_line(sys.argv)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/core/management/__init__.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/core/management/__init__.py", line 16, in <module>
from mezzanine.utils.tests import copy_test_to_media
File "/root/.virtualenvs/test/lib/python2.7/site-packages/mezzanine/utils/tests.py", line 17, in <module>
User = get_user_model()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 127, in get_user_model
user_model = get_model(app_label, model_name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/db/models/loading.py", line 271, in get_model
self._populate()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/db/models/loading.py", line 75, in _populate
self.load_app(app_name, True)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
models = import_module('%s.models' % app_name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/models.py", line 48, in <module>
class Priced(models.Model):
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/models.py", line 54, in Priced
unit_price = fields.MoneyField(_("Unit price"))
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/fields.py", line 46, in __init__
set_locale()
File "/root/.virtualenvs/test/lib/python2.7/site-packages/cartridge/shop/utils.py", line 146, in set_locale
raise ImproperlyConfigured(msg % currency_locale)
django.core.exceptions.ImproperlyConfigured: Invalid currency locale specified for SHOP_CURRENCY_LOCALE: 'en_US.UTF-8'. You'll need to set the locale for your system, or configure the SHOP_CURRENCY_LOCALE setting in your settings module.
(test)-bash-4.2# python2.7
Python 2.7.6 (default, Mar 4 2014, 10:29:45)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') ## This works
'C/en_US.UTF-8/C/C/C/en_US.UTF-8'
>>> locale.setlocale(locale.LC_MONETARY, 'en_US.UTF-8') ## This does not work
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/locale.py", line 547, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
I remember openbsd needing some settings changed (set) in the .profile file. It's an export of LC_TYPE. When you log in as a user out will set the locale. I'm not sure if this is necessary anymore. It it's in the all-knowing FAQ. That would be the openbsd faq.
>>Use of LC_MONETARY could lead to misleading results until we have a real time currency conversion function.