How to redirect page to user with user prefered language when opening a browser
<p>Django 1.9.6 i18n works perfect when I open the browser and change language.
But I want to save language and the other times when user comes it will be in his/her prefered language.
Now when I open the site it always redirect me to /en .I tried to change my settings and set</p>

<pre><code> LANGUAGE_CODE='ru'
</code></pre>

<p>or something else but it does not work here is my settings file </p>

<pre><code>   ALLOWED_HOSTS = []
   LOGIN_URL=reverse_lazy('login')
   AUTH_USER_MODEL='custom.MyUser'
   INSTALLED_APPS = [
     'django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'custom',
     'languages',
        ]

  MIDDLEWARE_CLASSES = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.locale.LocaleMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]

   ROOT_URLCONF = 'builtcustom.urls'
     WSGI_APPLICATION = 'builtcustom.wsgi.application'
     LANGUAGES=(
                ('en',_('ENGLISH')),
                ('fr',_('FRENCH')),
                ('cs', _('czech')),
                ('hy', _('ARMENIAN')),
                ('ru', _('RUSSIAN')),
                )
    LOCALE_PATHS = (
                        os.path.join(BASE_DIR, 'locale'),

                    )

 LANGUAGE_CODE = 'en-us'
 TIME_ZONE = 'UTC'
 USE_I18N = True
 USE_L10N = True
 USE_TZ =False 
</code></pre>

<p>How can i solve this problem and redirect to url with a language that I want(Dynamically selected from database)??</p>