用户水军识别应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
910 B

  1. """
  2. WSGI config for Zhijian_Project_WebService project.
  3. It exposes the WSGI callable as a module-level variable named ``application``.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
  6. """
  7. import os
  8. import configparser
  9. import threading
  10. from text_analysis.views import predict
  11. from text_analysis.views import data_structure
  12. #加载配置文件
  13. configFile = './config.ini'
  14. # 创建配置文件对象
  15. con = configparser.ConfigParser()
  16. # 读取文件
  17. con.read(configFile, encoding='utf-8')
  18. dbConfig = dict(con.items('database'))#数据库配置信息
  19. #开启数据入库线程
  20. t = threading.Thread(target=data_structure, name='dataStructureThread',args=(dbConfig,))
  21. t.daemon = True
  22. t.start()
  23. from django.core.wsgi import get_wsgi_application
  24. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "text_analysis.settings")
  25. application = get_wsgi_application()