Forums

I need help!!!

AttributeError at / 'str' object has no attribute 'regex'

Exception Location: /home/mulyavko/.virtualenvs/mulyavko/local/lib/python2.7/site-packages/django/core/urlresolvers.py in _populate, line 298

<p class="word">Вы можете прочесть моё <a href = {% url 'resume' %} >Резюме</a> или сразу перейти на <a href = {% url 'develop' %}>страницу моих разработок</a>

My guess would be that you're using a version of Django that is not compatible with the code you're trying to run. Make sure that you're using the version of Django that the code was written for.

Django 1.8

Then make sure that's the version that you are using on PythonAnywhere

In template /home/mulyavko/templates/index.html, error at line 0

ru-ru`<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"--> <!DOCTYPE HTML> "http://www.w3.org/TR/html4/loose.dtd"> <html lang="ru"> {% load staticfiles %}

<link rel="stylesheet" type="text/css" href={% static "style.css" %} >

<title>МСВ главная</title>
background-image: url("STATIC_URL/ukr.jpg")

{% include "shapka.html" %}

<table width="70%" align="center">
    <tr>
        <td width="70%"  valign="top">
            {% include "center.html" %}
        </td>
        <td width="25%" valign="top">
            {% include "right.html" %}
        </td>
    </tr>


</table>

</html> django upgrede, to 1.10 after y am see this error`

What error?

KeyError at / 'ru-ru'

Error during template rendering In template /home/mulyavko/templates/index.html, error at line 0

What is the full traceback?

File "/home/mulyavko/.virtualenvs/mulyavko/local/lib/python2.7/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/mulyavko/.virtualenvs/mulyavko/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 439, in render url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app) File "/home/mulyavko/.virtualenvs/mulyavko/local/lib/python2.7/site-packages/django/urls/base.py", line 91, in reverse return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, args, *kwargs))) File "/home/mulyavko/.virtualenvs/mulyavko/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 346, in _reverse_with_prefix possibilities = self.reverse_dict.getlist(lookup_view) File "/home/mulyavko/.virtualenvs/mulyavko/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 243, in reverse_dict return self._reverse_dict[language_code] KeyError: 'ru-ru'

You may have one or both of USE_I18N or USE_L10N enabled in your Django settings, but you have not fully set us the internationalisation and localisation for your site. See the Django docs on internationalisation and localisation: https://docs.djangoproject.com/en/3.2/topics/i18n/ - make sure you choose the right version of Django in the docs.

I tried everything, nothing works

Did you check whether USE_I18N or USE_L10N were enabled and disable them both?

LANGUAGE_CODE = 'ru-ru'

TIME_ZONE = 'Europe/Kiev'

USE_I18N = False

USE_L10N = False

USE_TZ = True

у Вас есть русскоязычный консультант?

By default USE_L10N should be set to True, did you change it? (We provide support only in English, sorry).

it was like this: True

changed to: False, nothing has changed, changed to: True, nothing !!!

what have you changed on the server ???? The site worked in the morning, but stopped at lunchtime !!!

We haven't changed anything on your server. It's possible that you made changes to your code, but didn't reload the site to pick up those changes, but then your site was restarted when it was moved from one server to another.

Did you reload the site using the button on the "Web" page after making the changes to the value of USE_L10N?

Will I wait for real help in solving my problem or not ????

What do you mean by real help? What is your answer to the question Giles asked?