installation changed - default virtual python environment within the project

This commit is contained in:
zalun 2010-02-07 00:18:20 +00:00
Родитель 731229b132
Коммит 4e9ff1890b
6 изменённых файлов: 19 добавлений и 21 удалений

24
INSTALL
Просмотреть файл

@ -24,25 +24,23 @@ commands are specific to Ubuntu with Bash):
$ sudo pip install -U virtualenv
5. Create directory for Python environments
$ sudo mkdir /srv; sudo mkdir /srv/python-environments
$ cd /srv/python-environments
$ sudo virtualenv --no-site-packages flightdeck
# current directory: /path/to/projects/FlightDeck
$ mkdir flightdeckenv
$ virtualenv --no-site-packages flightdeckenv
6. Install via pip from requirements.txt and custom packages
$ cd /path/to/project/FlightDeck
$ ./scripts/install.sh
7. Check if everything is working
* activate flightdeck environment
$ cd /srv/python-environments
$ source flightdeck/bin/activate
$ source flightdeckenv/bin/activate
the PS1 may change (regarding on the settings) to
(flightdeck)zalun@localhost $
(flightdeckenv)username@localhost $
* display the Django version
$ django-admin.py --version
1.1.1
* check if the same as in requirements file
$ grep Django /path/to/projects/FlightDeck/tools/pip-requirements.txt
$ grep Django tools/pip-requirements.txt
Django==1.1.1
* display list of packages
$ yolk -l
@ -80,11 +78,11 @@ commands are specific to Ubuntu with Bash):
Extending the Python codebase
1. Install the package (example of installing PIL - graphics operations for Python)
$ cd /srv/python-environments
$ pip install -E flightdeck/ pil
$ cd /path/to/projects/FlightDeck
$ pip install -E flightdeckenv/ pil
2. Save the requirements
$ pip freeze -E flightdeck/ > /path/to/projects/FlightDeck/tools/pip-requirements.txt
$ pip freeze -E flightdeckenv/ > tools/pip-requirements.txt
@ -98,8 +96,8 @@ Adding third party projects
# add line
-e hg+http://bitbucket.org/andrewgodwin/south/@0.6.2#egg=south
# update environment
$ cd /srv/python-environments
$ sudo pip install -E flightdeck/ -r /path/to/projects/FlightDeck/tools/pip-requirements.txt
$ cd /path/to/projects/FlightDeck
$ sudo pip install -E flightdeckenv/ -r tools/pip-requirements.txt
2. Install custom packages
# Add to the scripts/install.sh

Просмотреть файл

@ -55,7 +55,7 @@ SECRET_KEY = 'somesecretkey'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
'django.template.loaders.eggs.load_template_source', # this was commented out
)
MIDDLEWARE_CLASSES = (

Просмотреть файл

@ -24,7 +24,7 @@ SECRET_KEY = '_878&mu1t!-d*u^*@l$afwe$p4r(=*$kyyjy37ibf9t8li5#lv'
DEBUG = False
#MEDIA_ROOT = os.path.join(FRAMEWORK_PATH, '/flightdeck/media/')
#ADMIN_MEDIA_ROOT = os.path.join(FRAMEWORK_PATH, 'flightdeck/adminmedia/')
ADMIN_MEDIA_ROOT = os.path.join(FRAMEWORK_PATH, 'flightdeck/adminmedia/')
#MEDIA_URL = '/sitemedia/'
#MEDIA_SERVER = ''
#ADMIN_MEDIA_PREFIX = ''.join([MEDIA_SERVER,'/adminmedia/'])

Просмотреть файл

@ -3,8 +3,7 @@
source scripts/config.sh
PYTHON_ENVIRONMENT=$PROJECT_NAME
PYTHON_COMMAND='python'
PYTHON_COMMAND=python
# define directories
PYTHON_ENVIRONMENTS_DIR='/srv/python-environments'
PROJECT_DIR=`pwd`
V_ENV=$PYTHON_ENVIRONMENTS_DIR/$PYTHON_ENVIRONMENT
V_ENV=$PROJECT_DIR/pythonenv

Просмотреть файл

@ -12,16 +12,16 @@ done
### PIP packages installation
export PYTHONPATH=
sudo pip install -E $V_ENV/ -r $PROJECT_DIR/tools/pip-requirements.txt
pip install -E $V_ENV/ -r $PROJECT_DIR/tools/pip-requirements.txt
# TODO: write a proper bash script which will install from configurable files
### Grappelli section
# checkout the repository
sudo svn checkout http://django-grappelli.googlecode.com/svn/trunk/grappelli/ $SRC/grappelli
svn checkout -r 680 http://django-grappelli.googlecode.com/svn/trunk/grappelli/ $SRC/grappelli
# link to site-packages
if [ ! -e $SITE_PACKAGES/grappelli ]
then
sudo ln -fs $SRC/grappelli $SITE_PACKAGES/grappelli
ln -fs $SRC/grappelli $SITE_PACKAGES/grappelli
fi
# link adminmedia within project
if [ ! -e $PROJECT_DIR/$PROJECT_NAME/adminmedia ]

Просмотреть файл

@ -8,6 +8,7 @@ logs
adminmedia
dev.db
pip-log.txt
flightdeckenv
*local.py
*local.wsgi
*local.sh