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:
- How hard would it be to run a Django server (hopefully on the same computer) that would serve data from the php bas开发者_运维技巧ed database? 
- Could python classes (inheriting from django.db.models.Model) be formed to get the data from the php database? 
- Could Django authentication be used with the preexisting users table? 
Cheers. Chris
- 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. 
- 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: 
- The easiest way to do this would be to use django's auth system and then migrate your current users to django. 
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论