Replies: 1 comment 6 replies
-
You are confusing this package with another one. See this issue for more details: #294. If you are using this package, then follow the docs referenced in the readme file for your deployment instructions. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello miguel
@miguelgrinberg
i have made django+react+socketio project and i when i try to deploy it to heroku i get this error messages 'socketio.sgunicorn.GeventSocketIOWorker'
this my Procfile file :
release: python manage.py migrate web: gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker --log-file=- backend.wsgi:application
and this my wsgi.py
`
import os
from django.core.wsgi import get_wsgi_application
import socketio
import eventlet
import gevent
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
application = get_wsgi_application()
sio=socketio.Server(async_mode='gevent',cors_allowed_origins='*', logger=True, engineio_logger=True, ping_timeout=2)
application = socketio.WSGIApp(sio, application)
@sio.on('mohamed')
def mohamed(data, datamain) :
print('the main s the main of the function that has the most of the ten to use in the game')
print('this the function that has teh name of the ten to use in te div of text')
print(datamain)
sio.emit('res', {
"name" :"this the response of the await of the function"
})
eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
`
and this the App.js
import React, {useEffect} from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter as Router , Switch, Link, Route} from "react-router-dom"; import Home from './Home' import axios from 'axios'; import endpoint from "./endpoint" const App=()=>{ const getData=async()=>{ const res=await fetch('http://localhost:8000/api/try/', { method :"POST", headers :{ "Content-Type": "application/json" }, body :JSON.stringify({ email :"mohamed" }) }) const data=await res.json(); console.log(data) } useEffect(()=>{ getData(); }) return ( <Router> <Link to="/login">login</Link> <Link to="/home">Home</Link> <Switch> <Route path="/home" component={Home} /> {/* <Route path="/login" component={Login}/> */} </Switch> </Router> ) } export default App;
and there is another problem when i try to connect the backend with that api("http://localhost:8000/") give me API has been blocked by the client ..
Beta Was this translation helpful? Give feedback.
All reactions