{ "info": { "author": "Victor Hu", "author_email": "selain@nature.ee.ncku.edu.tw", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6" ], "description": "# Django-Eel\n\nDjango-Eel is a Django App for HTML GUI applications, with easy Python/JS interoperation. It is a porting version of [Eel](https://github.com/ChrisKnott/Eel).\n\n### Repo branches\n\n - **master** : the master branch of Django-Eel\n - **eel-master** : keeping sync with [Eel](https://github.com/ChrisKnott/Eel)/master\n\n### Requirements\n\n - Django ( >=2.0.7 recommended )\n - channels ( >=2.1.2 recommended )\n - gevent ( >=1.3.4 recommended )\n\n### Getting Started\n\n#### Installation\n\nDownload Django-Eel package from GitHub and install:\n```\npython setup.py install\n```\nOr install through PIP:\n```\npip install git+https://github.com/seLain/django-eel\n```\n\n#### Create demo project\n\nCreate an empty django project:\n```\ndjango-admin startproject demo\n```\nCreate examples django app:\n```\ndjango-admin startapp example\n```\nAdd **channels**, **django_eel**, and **example** to **demo/settings.py**\n```python\nINSTALLED_APPS = [\n 'django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'channels',\n 'django_eel',\n 'example',\n]\n```\nSet ASGI_Application in **demo/settings.py**. It is required by channels.\n```python\nWSGI_APPLICATION = 'demo.wsgi.application'\nASGI_APPLICATION = \"demo.routing.application\"\n```\nAdd **routine.py** under **demo** project root. The **routine.py** routes websocket requests to **EelConsumer**.\n```python\nfrom channels.routing import ProtocolTypeRouter, URLRouter\nfrom django.conf.urls import url\nfrom django_eel.consumers import EelConsumer\n\napplication = ProtocolTypeRouter({\n # (http->django views is added by default)\n \"websocket\": URLRouter([\n url(r\"^eel$\", EelConsumer), # do not alter this line\n ]),\n})\n```\nConfigure demo\\urls.py to route http request to eel and example respectively.\n```python\nurlpatterns = [\n path('admin/', admin.site.urls),\n url(r'^eel/', include('django_eel.urls')), # do not alter this line\n url(r'^example/', include('example.urls')), # set by your app name\n]\n```\nThat's the configuration part. Now we add a helloword example.\n\n#### Create template and view\n\nCreate **example\\templates\\example\\hello.html** :\n```html\n\n\n
\n