Code Monkey home page Code Monkey logo

django-tornado-demo's People

Contributors

bdarnell avatar geekan avatar oliver006 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-tornado-demo's Issues

request problem

Hello,

def main():
    tornado.options.parse_command_line()
    wsgi_app = tornado.wsgi.WSGIContainer(
        django.core.handlers.wsgi.WSGIHandler())

    application = Application([(r'/websocket/', planet_socket.WsDate),
                               ('.*', FallbackHandler, dict(fallback=wsgi_app)),
                               ],
                              **settings)

    print options.port
    server = tornado.httpserver.HTTPServer(application)
    server.listen(options.port)
    tornado.ioloop.IOLoop.current().start()

if __name__ == '__main__':
    main()

When we are running the project as above, We take the problems as below.

When a request starts(such as showing 10K records to the screen) all other requests are waiting until the first request is completed.
Requests which are running on Web Socket are waiting for first request's completion.
When a user starts the first request then all other users are waiting the first request's completion.
Sample Project is here. How Can We fix this problems..

Do you have any idea ?

Thanks...

django built-in webserver

Hi, is there any way to run this (tornado_main.py) along with django builtin webserver, not just inside wsgi app, please?

How to setup gunicorn with this example

Hi bdarnell,
It is very usefull repo for me. I am runing tornado server and it is working fine, But when I am using gunicorn i'm facing some issues. Can you please look at this error,

Traceback (most recent call last):
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 503, in spawn_worker
worker.init_process()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 116, in init_process
self.wsgi = self.app.wsgi()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
import(module)
File "/home/dhana/webrtc/neonarc2/tornado_server.py", line 10, in
from rtc import render_view
File "/home/dhana/webrtc/neonarc2/rtc/init.py", line 7, in
django.setup()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/init.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/dhana/webrtc/neonarc2/user_management/models.py", line 3, in
from allauth.account.models import EmailAddress
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/allauth/account/models.py", line 20, in
from .managers import EmailAddressManager, EmailConfirmationManager
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/allauth/account/managers.py", line 57, in
class EmailConfirmationManager(models.Manager):
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/utils/deprecation.py", line 58, in new
wrapper = warn_about_renamed_method(class_name, *renamed_method)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/workers/gtornado.py", line 36, in handle_exit
self.stop()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/workers/gtornado.py", line 117, in stop
PeriodicCallback(self.stop_ioloop, 1000, io_loop=self.ioloop).start()
AttributeError: 'TornadoWorker' object has no attribute 'ioloop'
Traceback (most recent call last):
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 503, in spawn_worker
worker.init_process()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 116, in init_process
self.wsgi = self.app.wsgi()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
import(module)
File "/home/dhana/webrtc/neonarc2/tornado_server.py", line 10, in
from rtc import render_view
File "/home/dhana/webrtc/neonarc2/rtc/init.py", line 7, in
django.setup()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/init.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/dhana/webrtc/neonarc2/user_management/models.py", line 3, in
from allauth.account.models import EmailAddress
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/allauth/account/models.py", line 20, in
from .managers import EmailAddressManager, EmailConfirmationManager
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/allauth/account/managers.py", line 57, in
class EmailConfirmationManager(models.Manager):
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/django/utils/deprecation.py", line 58, in new
wrapper = warn_about_renamed_method(class_name, *renamed_method)
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/workers/gtornado.py", line 36, in handle_exit
self.stop()
File "/home/dhana/webrtc/env/local/lib/python2.7/site-packages/gunicorn/workers/gtornado.py", line 117, in stop
PeriodicCallback(self.stop_ioloop, 1000, io_loop=self.ioloop).start()
AttributeError: 'TornadoWorker' object has no attribute 'ioloop'
[2015-03-15 11:41:34 +0000] [9697] [INFO] Worker exiting (pid: 9697)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.