0

I have a site that is only partially Django driven. I want the Django portion to be anything under http:www.mydomain.com/register. Anything not in this directory should get served by apache as usual.

I also must use fastcgi on my server.

How would I set my .htaccess and urls to get this to work?

2 Answers2

1

You can try something along the lines of this:

# mod_python for your site's apache config:

<VirtualHost *>
    # ...
    <Location "/register/">
        PythonHandler django.core.handlers.modpython
        PythonPath "['/your/project/path'] + sys.path"
        SetEnv PYTHON_EGG_CACHE /tmp/trac-eggs/myproject
        SetEnv DJANGO_SETTINGS_MODULE myproject.settings
        SetHandler python-program
        PythonDebug Off
        PythonAutoReload Off
    </Location>
    # ...
</VirtualHost>

Or possibly,

# mod_wsgi for your site's apache config:

<VirtualHost *>
    # ... 
    WSGIScriptAlias /register/ "/path/to/myproject.wsgi"
    # ...
</VirtualHost>
Louis
  • 155
  • 1
  • 6
0

Something like:

  RewriteEngine On
  RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^/register/(.*)$ /mysite.fcgi/$1 [QSA,L]
rkthkr
  • 8,618
  • 28
  • 38