WebFaction
Community site: login faq

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?)

asked 12 Sep, 18:17

eman_saad's gravatar image

eman_saad
112
accept rate: 0%

edited 12 Sep, 18:19

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×888
×27

question asked: 12 Sep, 18:17

question was seen: 47 times

last updated: 12 Sep, 18:19

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM