title: Configure REDIS in Gitlab CI/CD for usage in Django
body: <p>I had a working pipeline on GitLab which started failing after I added tests involving REDIS. I've applied (?) what is written <a href="https://docs.gitlab.com/ee/ci/services/redis.html#use-redis-with-the-docker-executor" rel="nofollow noreferrer">inside GitLab docs</a> but still REDIS is not discovered by my tests. </p>
  
  <p>Here's my <code>gitlab-cy.yml</code> file: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>pep8:
    image: python:latest
    services:
      - postgres:10-alpine
      - redis:latest
    variables:
      POSTGRES_DB: ci
      DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
      REDIS_URL: redis
    stage: test
    script:
      - python -V
      - pip install -r ./requirements/gitlab.txt
  
      - pytest --pep8
    cache:
      paths:
      - ~/.cache/pip/</code></pre>
  </div>
  </div>
  </p>
  
  <p>And here's how I'm using it inside Django: </p>
  
  <p><code>REDIS_URL = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
  cache = redis.StrictRedis.from_url(url=REDIS_URL)</code></p>
  
  <p>I've also set Environment Variables inside CI/CD settings in GitLab  <code>REDIS_URL</code> to <code>redis</code> however still when the test executes <code>None</code> gets assigned to <code>host</code> and the test fails ....-> <code>self = Connection&lt;host=None,port=6379,db=0&gt;</code></p>
  
  <p>Any idea how to connect with Redis on GitLab? </p>