Skip to content

Commit

Permalink
Fix static files handling in production
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelliott committed Aug 18, 2013
1 parent 10cd224 commit f964ab6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,38 @@ Development
-----------

### Prerequisites ###
* Python (2.6)
* If you already have a newer version of python you will need to install 2.6 alongside your
current version
* Python (2.7)
* pip
* `easy_install pip`
* virtualenv
* `pip install virtualenv`

### Setup ###
mkdir lexTerm && cd lexTerm
virtualenv -p <path_to_python2.6> --no-site-packages server
virtualenv --no-site-packages server
cd server
source bin/activate
pip install django==1.4
git clone [email protected]:LexTerm/LexTermServer.git lexTerm
cd lexTerm
pip install -r requirements.txt
./manage.py syncdb

### Run it ###
cd lexTerm
python manage.py runserver
./manage.py runserver

Production
----------

### Setup ###
* ssh onto the server
* create a virtual environment
* `git clone https://github.com/LexTerm/LexTermServer.git lexTerm`
* `cd lexTerm`
* `mkdir static`
* In the webserver document root do `ln -s path/to/lexTerm/static static`
* follow the django instructions [here]
(https://docs.djangoproject.com/en/1.5/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache)

### Deploy ###
with rsync
* to update, simply `git pull` in the repository

2 changes: 1 addition & 1 deletion lexTerm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''
STATIC_ROOT = ROOT('static/')

# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
Expand Down

0 comments on commit f964ab6

Please sign in to comment.