On Wed, Apr 6, 2016 at 3:57 AM, asimkon . <asimkos...@gmail.com> wrote:
> I managed to connect Apache 2.2 with django framework successfully using > Python 2.7 and mod_wsgi.so (Apache module) thanks to the instructions from > https://pusonchen.wordpress.com/2013/06/03/build-django-website-with-apache-mod_wsgi-on-windows/. > The problem is that i see the Django project Web page using localhost or > 127.0.0.1 in my browser. > I want to change it to localhost/mysite as i have built other projects in > php with Apache (WampServer) using Cakephp and other php scripts. Is there > any way or i will have to sacrifice my entire Apache Web server for just > only Django project? > Afterwards i just download > https://dev.mysql.com/downloads/connector/python/ (MySQL driver) install > it and play with syncdb to create tables in my MySQL database. I create the > db using phpmyadmin and import the info in my settings.py django project > folder. > > Regards > Kostas Asimakopoulos > So, you are running this on your local machine then? I did some quick googling for you because I wasn't sure if Apache could run mod_php and mod_wsgi together. Apparently it can. See this google search: https://www.google.com/search?client=ubuntu&channel=fs&q=can+apache+run+mod_php+and+mod_wsgi+at+the+same+time%3F&ie=utf-8&oe=utf-8 The basic premise is that you set one port to your php application, and another port to your Python application. So, if you visit, say 127.0.0.1:80, you will arrive at your php application. If you instead visit 127.0.0.1:8000, you will arrive at your Python application. Unfortunately, I do not believe there is any way to have both applications listen on the same port. You could, however, create an alias so that when you visit 'htttp://localhost/mysite' it actually points to 127.0.0.1:8000 which is the port for your Python application. >Afterwards i just download https://dev.mysql.com/downloads/connector/python/ (MySQL driver) install it and play with syncdb to create tables in my MySQL database. I create the db using phpmyadmin and import the info in my settings.py django project folder. Can you explain this further? Are you not using the Django ORM? -- https://mail.python.org/mailman/listinfo/python-list