Running django and flasks on the same Apache server

I am trying to run django and flask on the same apache server.

WSGISocketPrefix /var/www/wsgi <VirtualHost *:80> ServerAdmin name@email.com ServerName domain.com ServerAlias www.domain.com DocumentRoot /var/www/ LogLevel warn WSGIDaemonProcess apache processes=2 maximum-requests=500 threads=1 WSGIProcessGroup apache Alias /media /var/www/media/ WSGIScriptAlias / /var/www/djangoapps/django.wsgi WSGIScriptAlias /app1 /var/www/flaskapps/app.wsgi </VirtualHost> 
  • The first WSGIScriptAlias launches the django application at the root: domain.com.
  • The second instance of WSGIScriptAlias should launch the flash application in the subdomain: app1 .

But since the main site is sitting over django, when I try to click: domain.com/app1 , django urls.py tries to process this url command. But urls.py should not cope with this, since its application is with an independent jar.

Any ideas how I can do this?

+7
source share
1 answer

I'm not sure if this solves the problem, but have you tried changing the order of your script alias so that /app1 found before / ?

 WSGISocketPrefix /var/www/wsgi <VirtualHost *:80> ServerAdmin name@email.com ServerName domain.com ServerAlias www.domain.com DocumentRoot /var/www/ LogLevel warn WSGIDaemonProcess apache processes=2 maximum-requests=500 threads=1 WSGIProcessGroup apache Alias /media /var/www/media/ WSGIScriptAlias /app1 /var/www/flaskapps/app.wsgi WSGIScriptAlias / /var/www/djangoapps/django.wsgi </VirtualHost> 
+7
source

All Articles