提供反向ajax聊天室的django应用程序
django-chatrooms的Python项目详细描述
安装
从pypi安装鸡蛋:
$ pip install django-chatrooms
或者从github获取最新版本:
$ pip install -e git+git://github.com/qubird/django-chatrooms#egg=chatrooms
如果您使用buildout,只需将django聊天室添加到eggs部分即可。
egg设置负责安装所有需要的依赖项,不管怎样,您可能需要安装greenlet和libevent才能让gevent正常工作。
安装egg后,将下列应用程序添加到您的设置中。已安装的应用程序:
INSTALLED_APPS = ( # ..., 'polymorphic', 'chatrooms', # ..., )
然后将聊天室URL包含到您的URL模式:
urlpatterns = patterns('', # ..., url(r'^chat/', include('chatrooms.urls')), # ..., )
确保还将静态文件urlpatterns添加到urlconf中,例如:
from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns += staticfiles_urlpatterns()
而且 'django.contrib.staticfiles' 是已安装的应用程序中的一个。
然后就可以运行syncdb了。