6

I'm trying to set a Django secret key as a local environment variable in my venv/bin/activate.

But the key has a "(" in it and I get a venv error -bash: venv/bin/activate: line 85: syntax error near unexpected token ')'

I'm a bit stuck here. How can I set this Key as a local environment variable so that it accepts these special characters?

4
  • can you change some of the other characters of the key and show it here? Commented Jun 21, 2013 at 13:47
  • 1
    Thanks. How about this: export DJANGO_SECRET_KEY=1t789b5)q@548r!2@mjj9k$ms!joubcpya#yts45n@s&pq28l8 Commented Jun 21, 2013 at 14:31
  • 2
    Put it as a string. DJANGO_SECRET_KEY='1t789b5)q@548r!2@mjj9k$ms!joubcpya#yts45n@s&pq28l8' Commented Jun 21, 2013 at 14:32
  • That was easy. Thanks :) Commented Jun 21, 2013 at 14:45

1 Answer 1

1

Surround the string with single or double quotes. For longer strings (more than one line), you can use single or double quotes in sets of three. For more information and examples, refer to http://docs.python.org/release/2.5.2/ref/strings.html.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.