Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2255 closed enhancement (wontfix)

Setting up mod_python for Django via a .htaccess file

Reported by: mm@… Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords: mod_python, Apache, .htaccess
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In How to use Django with mod_python is described how someone could set up django for use with Apache and mod_python.

That works good, if you have a Apache setup like these described there. I have another setup (hint: all is done via mod_vhost_alias, which dynamically search the appropriate folder for the given domain itself, so for example a subdomain is created as simply as create a new folder at the right place in the filesystem) and while I thought about how to get django work altough, I asked myself "why dont use .htaccess?"

TurboGears does that, and it works great, but as I tried for django it doesnt work. Other people seem to have same problems. A few minutes ago in the #django IRC channel:

'''Pistahh:''' mpathy: few months ago I did not have success with .htaccess+django
'''Pistahh:''' mpathy: I had mysterious errors

I set the priority to high, because I think handling the Apache configuration via a external file, placed in the folder of the project, is much more flexible than any other ways to setup Apache.

Its also feels a little bit more django for me, than fumbling on these and that - and it also could be simply generated from django in further versions.

But before I get too verbose for a ticket, just a few questions:

  • Why it doesnt work?
  • Would it be hard to tweak django that it works with .htaccess files instead of modifiying the apache confs?
  • Dont you think it would be great (if it finally works with django) to include a .htaccess file to the files that are generated if a new project starts, or make django-admin script able to generate a .htaccess file for the project?
  • What other possibilities would I have to use django with a Apache + mod_python + mod_vhost_alias - setup?

I would really appreciate a working .htaccess support (and perhaps our company would donate sth. if I tell them what the oppurtunities would be for us *g*) in django!!

Change History (3)

comment:1 Changed 9 years ago by szekeres@…

14:48 < mpathy> Pistahh: You could also add a comment to show them that its important ;)

So this is a comment that fixing this error is important. :)

comment:2 Changed 9 years ago by ubernostrum

  • priority changed from high to normal

IIRC the Location directive, which is key to setting up Django to only serve under a certain URL, is not available in .htaccess files.

comment:3 Changed 9 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

I'm closing this ticket, because requiring admin access to httpd.conf in order to use Django with mod_python is fine by me.

Note: See TracTickets for help on using tickets.
Back to Top