1 Replies - 173 Views - Last Post: 18 June 2021 - 10:12 AM Rate Topic: -----

#1 wantsToCode   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 84
  • Joined: 25-February 19

How to set the variables in Django and Gitlab CI/CD

Posted 18 June 2021 - 01:49 AM

I'm trying to run the tests of my Django app in Gitlab CI/CD. The process fails every time with an error: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

I assume this is because I have not my .env file available in the repository and that file contains for example the SECRET_KEY -variable which is then used in the settings.py like this: SECRET_KEY = os.getenv('SECRET_KEY').

So what would be the proper way to set these variables so my tests would pass?

Is This A Good Question/Topic? 0
  • +

Replies To: How to set the variables in Django and Gitlab CI/CD

#2 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 1061
  • View blog
  • Posts: 4,073
  • Joined: 13-June 14

Re: How to set the variables in Django and Gitlab CI/CD

Posted 18 June 2021 - 10:12 AM

Can you not set environment variables in your pipeline description? I don't use GitLab, so check their docs.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1