views:

49

answers:

1

I've seen a lot of posts about switching from php to Django but none have covered this. I have a website that is built entirely in php (php 5, mysql, and apache2). This site is used only for collecting data from users. Now I need to make a second half of the site to display the data. This will be step 2 of 5 in the overall plan, and I'd rather not keep using php. I was wondering:

  1. How hard would it be to run a Django server (hopefully on the same computer) that would serve data from the php based database?

  2. Could python classes (inheriting from django.db.models.Model) be formed to get the data from the php database?

  3. Could Django authentication be used with the preexisting users table?

Cheers. Chris

+3  A: 
  1. Python and PHP can be run from the same server just fine. There may be performance issues on heavy loads when mixing mod_php with mod_pythong/mod_wsgi though.

  2. Much of Django is based on its own ORM. So you would not be getting the full benefits of Django if you're serving data from a database built outside of its ORM unless you changed the schema to match directly. But to answer your questions:

  3. The easiest way to do this would be to use django's auth system and then migrate your current users to django.

Justin Lucas
inspected can help with this immensely
Nick Presta
There should not be performance issues if you configure Apache properly. Also avoid using mod_python, not even loading it into Apache at the same time if using mod_wsgi.
Graham Dumpleton
Anyone attempting to do this should follow the link in Nick Presta's comment (the comment on the question).
dustynachos