471,354 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

[mostly OT] mod_python & doc file system layout

Hello all,

This is probably more of an apache question, but I'm guessing there
will be other mod_python-beginners who are wondering the same thing.
Let's say I have a web app called MyApp. It uses the usual images and
style sheets. I keep it all in
~/projects/MyApp/{styles,images,index.py,.htaccess}. I configure up
apache to use virtual hosts, and point it to MyApp.

Now when I access myapp.local (which points to 127.0.0.1, obviously),
my index.py is parsed properly. However, any access made to /images or
/styles end up being handled by mod_python, which isn't good, because it
won't load images or style sheets.

I have solved this by moving index.py (and the associated .htaccess)
to a subdirectory "main".

I guess one solution would be to make an access to / on the virtual
server redirect to main.

Another solution, I guess, would be to make the python script load
the images and style sheets.. A solution which I find to be particularly
ugly. :-)

Any mod_python users out there with any other solutions?

--
Kind regards,
Jan Danielsson
Jul 4 '07 #1
1 1121
On Jul 5, 12:22 am, Jan Danielsson <jan.m.daniels...@gmail.comwrote:
Hello all,

This is probably more of an apache question, but I'm guessing there
will be other mod_python-beginners who are wondering the same thing.

Let's say I have a web app called MyApp. It uses the usual images and
style sheets. I keep it all in
~/projects/MyApp/{styles,images,index.py,.htaccess}. I configure up
apache to use virtual hosts, and point it to MyApp.

Now when I access myapp.local (which points to 127.0.0.1, obviously),
my index.py is parsed properly. However, any access made to /images or
/styles end up being handled by mod_python, which isn't good, because it
won't load images or style sheets.

I have solved this by moving index.py (and the associated .htaccess)
to a subdirectory "main".

I guess one solution would be to make an access to / on the virtual
server redirect to main.

Another solution, I guess, would be to make the python script load
the images and style sheets.. A solution which I find to be particularly
ugly. :-)

Any mod_python users out there with any other solutions?
In the subdirectories containing your static files add a .htaccess
file containing:

SetHandler None

Graham

Jul 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by wolf | last post: by
reply views Thread by Python_it | last post: by
2 posts views Thread by exhuma.twn | last post: by
1 post views Thread by Tama | last post: by
5 posts views Thread by m.banaouas | last post: by
3 posts views Thread by Michael | last post: by
4 posts views Thread by Lad | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.