45👍
✅
You can set it to true like this:
# export C_FORCE_ROOT="true"
Then make sure it is set as an env. variable
# echo $C_FORCE_ROOT
true
But make sure to make it permanent, as this will vanish with the next restart
Have fun 🙂 !!
19👍
1st solution – Manually type command at terminal
$ export C_FORCE_ROOT='true'
2nd solution – Edit shell configuration
$ vi ~/.bashrc
# add following line
export C_FORCE_ROOT='true'
$ source ~/.bashrc
3rd solution – Edit manage.py
of Django
import os
if __name__ == '__main__':
os.environ.setdefault('C_FORCE_ROOT', 'true')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{PATH TO SETTINGS FILE}')
execute_from_command_line(sys.argv)
- [Django]-Django – Rotating File Handler stuck when file is equal to maxBytes
- [Django]-CSRF verification failed. Request aborted
- [Django]-Django or Django Rest Framework
2👍
Anywhere so the python process picks it up by using os.environ
.
If your question is about how the environment variables work, please read this tutorial.
- [Django]-Django modifying the request object
- [Django]-Different db for testing in Django?
- [Django]-Access-Control-Allow-Origin in Django app
Source:stackexchange.com