This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install virtualenv | |
pip install virtualenvwrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
which python3 #will output the python3 path such as /usr/bin/python3 | |
mkvirtualenv --python=/usr/bin/python3 my_new_project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running virtualenv with interpreter /usr/local/bin/python3 | |
Using base prefix '/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4' | |
New python executable in my_new_project/bin/python3.4 | |
Also creating executable in my_new_project/bin/python | |
Installing setuptools, pip...done. | |
(my_new_project)MacBook-Air-de-Pierre:Repositories Pierre$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /Users/Pierre/Repositories/Perso | |
mkdir trackr | |
cd trackr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trackr | |
└── trackr | |
├── manage.py | |
└── trackr | |
├── __init__.py | |
├── settings.py | |
├── urls.py | |
└── wsgi.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trackr | |
├── README.rst | |
├── docs | |
├── requirements | |
└── trackr | |
├── manage.py | |
└── trackr | |
├── __init__.py | |
├── settings.py | |
├── urls.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trackr | |
├── README.rst | |
├── docs | |
├── requirements | |
│ ├── base.txt | |
│ ├── local.txt | |
│ ├── production.txt | |
│ └── test.txt | |
└── trackr | |
├── manage.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from django.core.exceptions import ImproperlyConfigured | |
def get_env_variable(var_name): | |
""" Gets the environment variable or returns exception. """ | |
try: | |
return os.environ[var_name] | |
except KeyError: | |
error_msg = "Set the {} environment variable".format(var_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONFIG_ROOT = os.path.dirname(os.path.dirname(__file__)) | |
PROJECT_ROOT = os.path.abspath(os.path.join(CONFIG_ROOT, os.pardir)) |
OlderNewer