Skip to content

Instantly share code, notes, and snippets.

@chexov
Created November 9, 2011 13:43
Show Gist options
  • Save chexov/1351458 to your computer and use it in GitHub Desktop.
Save chexov/1351458 to your computer and use it in GitHub Desktop.
Hosting howto for Dmirti
http://gitref.org/creating/
http://help.github.com/git-cheat-sheets/
cd myproj
git init
git add *
git commit -m 'init commit' -a
git remote add origin user@hosting:myproj.git
cd ..
scp -r myproj/ hosting:myproj.git
cd -
git push origin master
ssh hosting
virtualenv -p python2.7 p27/
./manage.py runserver 0.0.0.0:8001
> cgi-bin/django.fcgi
#!/var/www/users/idriskaaero/avia/env/bin/python
# encoding: utf-8
import sys, os
from django.core.servers.fastcgi import runfastcgi
project_name = "avia"
project_dir = "/var/www/users/idriskaaero/avia"
parent_dir = os.path.dirname(project_dir)
# Add a custom Python path.
sys.path.insert(0, project_dir)
sys.path.insert(0, parent_dir)
# Switch to the directory of your project. (Optional.)
os.chdir(project_dir)
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % project_name
os.environ['PYTHON_EGG_CACHE'] = os.path.join(parent_dir, "PYTHON_EGG_CACHE")
#runfastcgi(method="prefork", daemonize="false", maxchildren="10", maxrequests="150", minspare="15")
runfastcgi(method="threaded", daemonize="false")
> htdocs/.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /cgi-bin/django.fcgi/$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment