Created
August 5, 2011 23:00
-
-
Save biern/1128729 to your computer and use it in GitHub Desktop.
alwaysdata config
This file contains hidden or 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
export PYTHONPATH=~/modules/ | |
export PATH=~/modules/bin:~/modules/:$PATH | |
export WORKON_HOME=$HOME/.virtualenvs | |
source ~/modules/virtualenvwrapper.sh | |
export PIP_REQUIRE_VIRTUALENV=true | |
export PIP_RESPECT_VIRTUALENV=true | |
export PIP_VIRTUALENV_BASE=$WORKON_HOME | |
# source .bash_profile |
This file contains hidden or 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
AddHandler fcgid-script .fcgi | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ django.fcgi/$1 [QSA,L] |
This file contains hidden or 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
#!/home/biern/marcinbiernat.pl/env/bin/python | |
# NOTE: Remember to change shebang when changing _ENV_DIR ! | |
_PROJECT_NAME = 'biern' | |
_ROOT_DIR = '/home/biern/marcinbiernat.pl/' | |
_PROJECT_DIR = os.path.join(_ROOT_DIR, _PROJECT_NAME) | |
_ENV_DIR = os.path.join(_ROOT_DIR, 'env') | |
import os, sys | |
# Setup virtualenv, path, etc | |
os.environ.setdefault('PATH', '/bin:/usr/bin') | |
os.environ['PATH'] = os.path.join(_ENV_DIR, 'bin:') + os.environ['PATH'] | |
os.environ['VIRTUAL_ENV'] = _ENV_DIR | |
os.environ['PYTHON_EGG_CACHE'] = os.path.join(_ENV_DIR, 'egg_cache') | |
# Project path | |
sys.path.insert(0, _PROJECT_DIR) | |
# Django settings | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | |
from django.core.servers.fastcgi import runfastcgi | |
runfastcgi(method='threaded', daemonize='false') |
This file contains hidden or 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
mkdir ~/modules | |
easy_install-2.6 --install-dir ~/modules -U pip | |
easy_install-2.6 --install-dir ~/modules -U virtualenv | |
easy_install-2.6 --install-dir ~/modules -U virtualenvwrapper |
This file contains hidden or 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
# http://wiki.alwaysdata.com/wiki/Deploying_a_Django_App | |
git clone git://github.com/biern/marcinbiernat.pl.git | |
cd marcinbiernat.pl | |
mkdir public | |
# insert django.fcgi and .htaccess here | |
# create virtualenv | |
virtualenv env # don't use --no-site-packages - use provided django version | |
source env/bin/activate | |
pip install (what is needed) | |
# configure django settings (db access and such) | |
./biern/manage.py syncdb # and migrate if needed | |
# link static dirs to public/ | |
# configure domain from admin panel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment