3

I am using Apache with mod_wsgi to run django server in production.The blog here describes how to deploy SwampDragon on NGNIX. There's issue here which discusses a bit about how to deploy SwampDragon on Apache but its not very clear. How can I deploy SwampDragon on Apache ? will it be required to put server.py file in root folder ?

Update:

I deployed the SwampDragon using Proxy. I am looking for way to deploy the same using mod_wsgi similar to Django. How to write wsgi script for running a python script ?

Ashish Gupta
  • 2,574
  • 2
  • 29
  • 58
  • 1
    If I'm not mistaken, SwampDragon is just an add on for Django, so would it not be as simple as following the tutorial at http://swampdragon.net/documentation/adding-swampdragon-to-an-existing-django-project/ and running Django on Apache with their tutorial at https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/ ? – Jared Fields Jan 11 '16 at 22:10
  • I know how to deploy a django project using modwsgi, but I was not able to figure out how to deploy SwampDragon using that. So, I deployed it using Proxy and mod_proxy_wstunnel in Apache. I want to run a python script using modwsgi, but I was not able to figure out how to write a wsgi application for that. – Ashish Gupta Jan 11 '16 at 22:22
  • 1
    So, again, since SwampDragon is just an extension of Django, I'd think you should be able to just add the Django application using mod_wsgi. Did you check out the second link above? It seems to me that simply adding the definitions outlined at http://swampdragon.net/documentation/adding-swampdragon-to-an-existing-django-project/ and then creating a wsgi.py as outlined in https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/ should work. – Jared Fields Jan 11 '16 at 22:28
  • Django creates wsgi.py by its own.I want to create a wsgi file to run server.py (as mentioned in swampdragon docs). Can you help me figure out how to write a wsgi.py file for running server.py – Ashish Gupta Jan 11 '16 at 22:45
  • You want the apache server to run another server? Why not just run it directly? I haven't ran any other servers through apache before. – Jared Fields Jan 11 '16 at 22:47
  • I will be happy if I can do that. But I was not able to figure out that, so I ran server.py on private ip just like we run django runserver and configured apache to point traffic to that. – Ashish Gupta Jan 11 '16 at 22:59
  • 1
    The issue with running server.py will be that the service will not be multi-threaded. I believe that what you are needing to know, with regards to running the WSGI application directly, is contained in the links I sent you. Other than that, I'm afraid I cannot offer anything more on it. Perhaps a Django or Apache (httpd) group on IRC would be of service. – Jared Fields Jan 11 '16 at 23:04

0 Answers0