开发者

(django initial setup) Django installation is redirecting all traffic to django page, fix?

I'm a complete newbie to Django. I've been trying to get it working on my Ubuntu server.

everytime someone my server, it redirects to the "Congratulations on your first Django-powered page." It completely ignores the index.html file in the www directory. Why is that? Is there a away to make it so that it only goes to the django page when I goto a subdomain /testproject instead?

here is what I got

python version: 2.5.2 Django version 1.2 b1

I'm using mod_python. here is my apache http.conf file

MaxRequestsPerChild 1

<location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE testproj1.settings
    PythonPath "['/root/django/django_projects'] + sys.path"
    PythonDebug On
</location>

<location "/admin_media">
   SetHandler None
</location>

<location "/media">
   SetHandler None
</location>

<LocationMatch "\.(jpg|gif|png)$">
    SetHandler None
</开发者_StackOverflow中文版LocationMatch>


   SetHandler None

Thanks!


"It completely ignores the index.html file in the www directory. Why is that?"

Because you installed django and django takes over from that point. You should probably change the <Location> path to "testproject" instead of "/" as obviously the latter means root/homepage. Though I'm not sure this will quite workout properly because I'm not sure it will take over the entire testproject directory like it would to the root, I could be wrong.

If you have access to, you can instead setup a subdomain as it's probably not feasible to set it up in /testproject/.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜