Deploying Problem On Django channels
I am trying to deployed django channels productions on railway but i am getting deployed logs error :
Project Id : a15d6fa5-744f-422a-998a-349807951c51
60 Replies
Project ID:
a15d6fa5-744f-422a-998a-349807951c51
yes
Can you help me ?
share your repo please
GitHub
GitHub - datamind321/chat-application
Contribute to datamind321/chat-application development by creating an account on GitHub.
@Brody I have send repo
@Brody Can You Check My repo ?
#🛂|readme #5
My also same error app crashed
App deployed successfully , but websocket connection failed
Hi everyone
Anyone here
If yes , say hi 🤚
this is community support, please be patient
Hi brody
I want to deploy an django channels on production using railway deployment platform.
I have successfully deployed application but websocket connection failed showing this log :
" mixed content: the page at 'https://web-production-9959.up.railway.app/accounts/home/' was loaded over https, but attempted to connect to the insecure websocket endpoint 'ws://web-production-9959.up.railway.app/accounts/home/'. this request has been blocked; this endpoint must be available over wss."
I have no idea how to connect websocket with https .
How to solve this error :
My GitHub Repo : https://github.com/datamind321/chat-application/tree/main
Anyone help out me to connect websocket using https on deployment servers.
GitHub
GitHub - datamind321/chat-application
Contribute to datamind321/chat-application development by creating an account on GitHub.
you need to use wss://
I have been already uses wss://
your error message says that you are using ws://
How to use sslserver
I don't use sslserver on installed app ?
you need to use wss:// for your websocket app, railway handles certs so you don't have to
Do that 's compulsory or not ?
I am used now wss://
But error not resolved 😐
let's see the error now please
you are still using ws://
GitHub
chat-application/chat/static/js/messages.js at main · datamind321/c...
Contribute to datamind321/chat-application development by creating an account on GitHub.
thus is my js file i have already updated it , see here
please have a look at your error message, it states you are still using ws://
you need to use wss://
Actually , I know that I have changes on my github repo code but changes not applies on server js file
do a hard refresh
I am trying many times , but it's has not changed
ctrl + f5
Hard Refresh already tried , but not benefit '
are you pushing the code to the same branch railway is set to pull from?
in railway site how pull ?
check the railway service settings to see what branch you have the repo set to
main branch set
what branch are you pushing your code to?
main branch
have you pushed the updates you've made?
yes
i have create new repo push again and redeploy again but same error thrown
Stuck my mind now 😩
hi brody
i have solved my issue but, now an short issue can you see it
redis database exception found ... can you tell me what i do in raiway production django channel
1. where is the redis database, I don't see it in your project
2. wherever the database is, it's not going to be at 127.0.0.1, please check to make sure your client configuration is correct
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("127.0.0.1", 6379)],
},
},
}
i have added it this settings.py and i am using window on my pc so i am dowload memurai for reddis
but this works on my local server , but what i am do for production
you need to deploy a redis database into your project and fill in the given credentials in the config
how to do this
can you tell me ?
I have no idea how to config this
+ New
button at the top right of your projectAfter click database and Add Redis right ?
correct
and what next
read the second half of my message please
I have added it
fill in the given credentials in the config in settings.py
which param all compulasary like hosts ?
host, port, username, password
now correct ?
wait i am tried it ?
After Add Redis Database
check if your config is correct according to its documentation
Thank you so much brody for my help , my issue was resolve
Thanks Again !!!
no problem!