Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
move apache config into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
clouserw committed Oct 13, 2010
1 parent 5b17bc4 commit 71ee56c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 45 deletions.
43 changes: 0 additions & 43 deletions apache/config_local-default.wsgi

This file was deleted.

45 changes: 45 additions & 0 deletions docs/source/_includes/example_apache_wsgi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
* An example Apache WSGI configuration::

import sys
import os
import site

VIRTUAL_ENV = '/path/to/virtual/environment'
PROJECT_PATH = '/path/to/projects/FlightDeck'

# All directories which should on the PYTHONPATH
ALLDIRS = [
os.path.join(VIRTUAL_ENV, 'lib/python2.6/site-packages'),
PROJECT_PATH,
os.path.join(PROJECT_PATH, 'flightdeck'),
]

# Remember original sys.path.
prev_sys_path = list(sys.path)

# Add each new site-packages directory.
for directory in ALLDIRS:
site.addsitedir(directory)

# add the app's directory to the PYTHONPATH
# apache_configuration= os.path.dirname(__file__)
# project = os.path.dirname(apache_configuration)
# workspace = os.path.dirname(project)
# sys.path.append(workspace)

for s in ALLDIRS:
sys.path.append(s)

# reorder sys.path so new directories from the addsitedir show up first
new_sys_path = [p for p in sys.path if p not in prev_sys_path]
for item in new_sys_path:
sys.path.remove(item)
sys.path[:0] = new_sys_path

os.environ['VIRTUAL_ENV'] = VIRTUAL_ENV
os.environ['CUDDLEFISH_ROOT'] = VIRTUAL_ENV
os.environ['PATH'] = "%s:%s/bin" % (os.environ['PATH'], VIRTUAL_ENV)
os.environ['DJANGO_SETTINGS_MODULE'] = 'flightdeck.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
6 changes: 4 additions & 2 deletions docs/source/server/installation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation on the server
==========================

FligtDeck depends on Python, virtualenv, virtualenvwrapper, mysql, git,
FligtDeck depends on Python, virtualenv, virtualenvwrapper, mysql, git,
mercurial, xulrunner.

* Download the code::
Expand All @@ -23,5 +23,7 @@ mercurial, xulrunner.

deactivate

* Configure Apache, a sample config is in ``apache/config_local-default.wsgi``. Please copy to ``apache/config_local.wsgi`` before modifying.
Configure Apache
----------------

.. include:: ../_includes/example_apache_wsgi.rst

0 comments on commit 71ee56c

Please sign in to comment.