hg clone ssh://hg@bitbucket.org/thux/edilcloud-back
The virtualenv, put simply, is an isolated working copy of Python which allows you to work on a specific project without worry of affecting other projects. It enables multiple side-by-side installations of Python, one for each project. It doesn’t actually install separate copies of Python, but it does provide a clever way to keep different project environments isolated.
Virtualenvwrapper is a set of extensions to virtualenv. It gives you commands like mkvirtualenv, lssitepackages, and especially workon for switching between different virtualenv directories. This tool is especially useful if you want multiple virtualenv directories.
pip install --user virtualenv virtualenvwrapper
Add three lines to your shell startup file (.bashrc, .profile, etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Workspace
source /usr/local/bin/virtualenvwrapper.sh
####Create virtualenv:
-
virtualenv (standard):
-
python2:
virtualenv edilcloud-back/venv
-
python3:
virtualenv edilcloud-back/venv --python /usr/bin/python3
-
-
virtualenvwrapper:
-
python2:
mkvirtualenv edilcloud-back
-
python3:
mkvirtualenv --python=/usr/bin/python3 edilcloud-back
-
-
Python3 Venv (only for python 3):
python3 -m venv edilcloud-back/venv
####Activate virtualenv:
-
virtualenv (standard) & Python3 Venv (only for python 3):
. venv/bin/activate
-
virtualenvwrapper:
workon edilcloud-back
Cookiecutter prepare automatically .env
file, but is necessary install the global package
sudo pip install autoenv
and configure your .bashrc
:
echo "source `which activate.sh`" >> ~/.bashrc
For create autoenv in your project (in this example with virtualenvwrapper) create .env
file as follows:
echo "workon edilcloud-back" > .env
The complete autoenv documentation can be found here.
Any package are developed internal in Thux, to automataically check correct repo cretate .pip/pip.conf
:
[global]
find-links = https://pypi.thux.it/
pip install .
createdb edilcloud-back
gedit web/settings/local.py
#!python
# -*- coding: utf-8 -*-
SECRET_KEY = 'Place your brand new security key here'
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'edilcloud-back',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
EMAIL_HOST = ''
EMAIL_PORT = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = True
EMAIL_SUBJECT_PREFIX = ['whistle']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
dj migrate
dj createsuperuser
cd edilcloud-back/web
mkdir static
dj r
TYPOLOGY, CATEGORY, SUBCATEGORY, ECC
- python manage.py shell < web/management/scripts/import_typology.py
- python manage.py shell < web/management/scripts/import_category.py
DEV ssh -i "Edilcloud-key.pem" ec2-user@35.178.108.7