0

I currently have a simple apache /var/www setup. I have a bunch of static HTML files in a directory (let's call it /var/www/mydir), which show up on http://mysite.com/mydir/filename.htm.

Now, I want to start serving Django content (via a virtualenv) on http://mysite.com/, however I would like http://mysite.com/mydir/ to keep serving the static HTML it used to.

Is there any way I can configure Apache to call Django in the case of http://mysite.com/* links and pull up static HTML in the case of http://mysite.com/mydir/* links?

If not, how can I tell Django to serve HTML files from /var/www/mydir for `http://mysite.com/mydir/* links?

4

1 回答 1

2

实际上,您根本不需要 Django 来提供静态内容。出于性能原因,当不在 DEBUG = True 中运行时,该框架甚至不会执行此操作。

您只需将 Apache 配置为具有从URL/mydir/var/www/mydir.

于 2013-05-18T10:19:49.703 回答