Mobile app version of vmapp.org
Login or Join
Annie201

: Django websocket app running alongside mod_wsgi app i have a Django project/website that hold 3 chatting application two of them is using HTTp request as a chatbot the uses views.py to retrieve

@Annie201

Posted in: #Apache #Django

i have a Django project/website that hold 3 chatting application two of them is using HTTp request as a chatbot the uses views.py to retrieve the replay from the DataBase , and the third on is using Django channels and websockets as a normal basic one-to0one chatting app, connecting and echoing the messages worked perfectly but the problem is that when i try to send a message using Group() function in consumer.py it doesn't work.

So, i found out that the reason is that my websocket app doesn't seem to route correctly when running alongside my mod_wsgi app. So, the only solution is stopping my Apache,and then serving the whole app from your websockets port via the runserver command. When i did this the Group () worked, but the problem is i developed the whole website using Apache which it serves 2 of 3 apps in my Django website, the 3th one is using web sockets(and it took me a long time). I need both Apache and websockets in my Django project.

this is my Apache config:

ServerRoot "/home/mansard/webapps/gadgetron/apache2"

LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule expires_module modules/mod_expires.so


LoadModule headers_module modules/mod_headers.so

LogFormat "%{X-Forwarded-For}i %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
CustomLog /home/mansard/logs/user/access_gadgetron.log combined
ErrorLog /home/mansard/logs/user/error_gadgetron.log




Listen 16709
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5





Header set Access-Control-Allow-Origin: *

Header set Access-Control-Allow-Headers: content-type

Header set Access-Control-Allow-Methods: *


WSGIDaemonProcess gadgetron processes=2 threads=12 python-path=/home/mansard/webapps/gadgetron:/home/mansard/webapps/gadgetron/src:/home/mansard/webapps/gadgetron/lib/python3.5
WSGIProcessGroup gadgetron
WSGIRestrictEmbedded On
WSGILazyInitialization On
WSGIScriptAlias / /home/mansard/webapps/gadgetron/src/chatbot/wsgi.py process-group=gadgetron application-group=%{GLOBAL}


Any ideas how to address this issue?

PS: someone told me that i need to switch to Nginx as my website configuration (How i can accomplish that?)

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme