Hi! I'm novice in Django and I run project under virtualenv on Win-10.
So I try to install edge followed by instruction. All works fine untill go to "login" or "Signup" page.
The whole console was filled by chains of exceptions like this:
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\root\Envs\OnEdge\lib\site-packages\django\template\base.py", line 835, in _resolve_lookup
current = current[bit]
File "C:\Users\root\Envs\OnEdge\lib\site-packages\django\template\context.py", line 83, in __getitem__
raise KeyError(key)
KeyError: 'tag'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\root\Envs\OnEdge\lib\site-packages\django\template\base.py", line 841, in _resolve_lookup
if isinstance(current, BaseContext) and getattr(type(current), bit):
AttributeError: type object 'Context' has no attribute 'tag'
During handling of the above exception, another exception occurred:
... and so one...
Also DebugToolbas show this exceptions:
However, in the browser, I can make both a login and a sign up. Also view and modify profile.
In traceback I also noticed this part of exceptions:
Traceback (most recent call last):
File "C:\Users\root\Envs\OnEdge\lib\site-packages\django\template\base.py", line 856, in _resolve_lookup
(bit, current)) # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [tag] in [{'True': True, 'False': False, 'None': None}, {'True': True, 'False': False, 'None': None, 'csrf_token': <SimpleLazyObject: 'rozs6ZhIsFDsoSkYfSu5pdh3XGSWkYGuJGEyyQAUajKfnNR6lAd4RbWFP1VbHS5J'>, 'user': <SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x000001D435AF54A8>>, 'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x000001D435B26DA0>, 'debug': True, 'sql_queries': <function debug.<locals>.<lambda> at 0x000001D435B21D90>, 'LANGUAGES': [('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian BokmĂĄl'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')], 'LANGUAGE_CODE': 'en-us', 'LANGUAGE_BIDI': False, 'MEDIA_URL': '/media/', 'STATIC_URL': '/static/', 'TIME_ZONE': 'Europe/Kiev', 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x000001D435ADEDD8>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40}, 'form': <LoginForm bound=False, valid=False, fields=(username;password;remember_me)>, 'view': <accounts.views.LoginView object at 0x000001D435ADEEB8>, 'site': <django.contrib.sites.requests.RequestSite object at 0x000001D435AF5EB8>, 'site_name': '127.0.0.1:8000', 'next': '', 'block': <Block Node: form. Contents: [<TextNode: '\n '>, <crispy_forms.templatetags.crispy_forms_tags.CrispyFormNode object at 0x000001D435B26400>, <TextNode: '\n\n <div class="form-mess'>, <django.template.defaulttags.URLNode object at 0x000001D435B264E0>, <TextNode: '">Sign up</a>.\n </p>\n '>]>, 'template_pack': 'bootstrap3', 'form_action': '', 'form_method': 'post', 'form_tag': True, 'form_class': '', 'form_id': '', 'form_style': '', 'form_error_title': None, 'formset_error_title': None, 'form_show_errors': True, 'help_text_inline': False, 'html5_required': False, 'form_show_labels': True, 'disable_csrf': False, 'inputs': [], 'is_formset': False, 'form_attrs': {}, 'flat_attrs': '', 'error_text_inline': True, 'label_class': '', 'field_class': '', 'include_media': True, 'attrs': {}, 'field': <django.forms.boundfield.BoundField object at 0x000001D435AF54E0>, 'labelclass': None, 'wrapper_class': None}]
This led me to think of setting up a locale. So first I check LANGUAGE_CODE in base.py settings file
LANGUAGE_CODE = 'en-us'
(this is the default setting and it does not fix the problem)
but parameter LANGUAGES do!
LANGUAGES=[('en', 'English')]
It would be appropriate to put these parameters in the local.env, but I do not know how to do it correctly.
LANGUAGE_CODE=en-us
and LANGUAGES=('en', 'English')
or LANGUAGES=(en, English)
not change this environment variables.