Re: How to Speed up Loading the First Page of Django Project?

2017-11-19 Thread flora . xiaoyun . huang
Hi, The worker id and hit id are passed via GET. (It's a website for amazon mechanical turker to finish tasks.) And views.py checked their worker id and hit id to see whether they are valid. If they're valid, then the turker will be directed to the following pages. On Sunday, November 19,

Re: How to Speed up Loading the First Page of Django Project?

2017-11-18 Thread flora . xiaoyun . huang
Thank you for your reply. The first page always loads slowly while the rest of the pages loads at a normal speed. Whether I restart the apache or not doesn't affect the speed of loading the first page - always slow. Below is the configuration file in the sites-available folder under apache. My

Re: How to Speed up Loading the First Page of Django Project?

2017-11-18 Thread flora . xiaoyun . huang
And this is the first few lines of requests in the network section in developer tools. You can see that the first step to verify the user's identification takes so long.

Re: How to Speed up Loading the First Page of Django Project?

2017-11-21 Thread flora . xiaoyun . huang
Hi Jason, Thanks for your help! I just solved the bug. The reason of the bug is that in the first step after I verify the worker's identification, I should put them in the database. And in django default setting, PASSWORD_HASHERS is set to PBKDF2 to hash the password for each worker. It is a

Re: How to Speed up Loading the First Page of Django Project?

2017-11-21 Thread flora . xiaoyun . huang
But that's all I revised of the code. The configuration file of server engine and all the other things keep the same. On Tuesday, November 21, 2017 at 2:09:08 PM UTC-5, Jason wrote: > > That is not a good solution. There's a reason why the default password > hashing algorithm is complex. > >

How to Speed up Loading the First Page of Django Project?

2017-11-16 Thread flora . xiaoyun . huang
Hi, I am deploying a Django project on Apache2. The Apache is running using mod_wsgi daemon mode. The first page of the website usually loads so slow. Before loading the first page (html, css) the user's identification should be verified (check the variable they pass through GET). When

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-25 Thread flora . xiaoyun . huang
Thanks for your reply. But I am afraid this is not the problem. The urls are dispatched correctly. Different pages of my website can be directed correctly. The live discussion is just one function on one page. Other parts of this page are functioning well. On Monday, June 25, 2018 at

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-25 Thread flora . xiaoyun . huang
So you mean I need these two commands to get my website running. Do you notice something unusual from the log info of uwsgi and daphne? On Monday, June 25, 2018 at 11:36:00 AM UTC-4, laixintao wrote: > > No, runserver is for web development, and runworker is for channel (AKA > websocket)

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-25 Thread flora . xiaoyun . huang
Thanks for your reply. Here is the log information of daphne: 2018-06-25 15:12:38,199 INFO Starting server at tcp:port=8000:interface=0.0.0.0, channel layer experiment_platform.asgi:channel_layer. 2018-06-25 15:12:38,200 INFO HTTP/2 support not enabled (install the http2 and

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-25 Thread flora . xiaoyun . huang
Are you referring to only using daphne command? I cannot get my website running with only this command. On Monday, June 25, 2018 at 11:55:01 AM UTC-4, Mikhailo Keda wrote: > > no, for Channels 2 you need one command > https://channels.readthedocs.io/en/latest/deploying.html > -- You received

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-25 Thread flora . xiaoyun . huang
Oh... I'd better not change the framework of my website. Do you have any ideas about the bug based on the existing information I provide? On Monday, June 25, 2018 at 12:35:58 PM UTC-4, Mikhailo Keda wrote: > > yea, why not? > > I'm using daphne with supervisord + Nginx > -- You received this

Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-24 Thread flora . xiaoyun . huang
Hi I am deploying a website with a live discussion feature. But people cannot send nor receive messages on this discussion page. In the console it shows: "WebSocket connection to 'ws:///room1/' failed: Error during WebSocket handshake: Unexpected response code: 200" I don't know where

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-26 Thread flora . xiaoyun . huang
I think I must have messed the ports up. Here is a summary: redis: 6379 daphne: 8000 (if running daphne with this command: daphne experiment_platform.asgi:channel_layer --port 8000 --bind 0.0.0.0 -v2 &) ws (see *nginx.conf*): 8000 [I guess the error message in the browser console "WebSocket

Re: Websocket 200 error

2019-02-18 Thread flora . xiaoyun . huang
Thank you in advance! On Monday, February 18, 2019 at 4:14:44 PM UTC-5, flora.xia...@gmail.com wrote: > > Hi, > > The real-time discussion function (supported by Daphne) on my website is > not working (Other non-real-time functions are good). The console echos: > "WebSocket connection to

Websocket 200 error

2019-02-18 Thread flora . xiaoyun . huang
Hi, The real-time discussion function (supported by Daphne) on my website is not working (Other non-real-time functions are good). The console echos: "WebSocket connection to 'ws://xxxforum/room_xxx/' failed: Error during WebSocket handshake: Unexpected response code: 200". I've went through

Re: Websocket 200 error

2019-02-18 Thread flora . xiaoyun . huang
I am guessing maybe there is an issue with the redis-server? *The log I received from Daphne*: 2019-02-18 21:07:54,543 ERRORError trying to receive messages: Error running script (call to f_3640886a0c8901ca9188f5f7a5f7a346145b9c5f): @user_script:3: @user_script: 3: -MISCONF Redis is

Re: Websocket 200 error

2019-02-19 Thread flora . xiaoyun . huang
The redis issue solved, by revising redis configuration: config set stop-writes-on-bgsave-error no And the redis server can be restarted. On Monday, February 18, 2019 at 9:19:52 PM UTC-5, flora.xia...@gmail.com wrote: > > I am guessing maybe there is an issue with the redis-server? *The log I

url routing correct locally but doesn't work on server

2019-02-21 Thread flora . xiaoyun . huang
Hi everyone. The problem I came across is that the url routing is correct locally but not on the server. The urls.py and views.py are the same locally and on the server. For example after we enter the website link the first page of the website should be directed to *xxx.com/consent_form*,