2024-09-18 13:41:28 +08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import django
|
|
|
|
from web.manager.log_manager import LogManager
|
|
|
|
|
|
|
|
sys.path.append(r"web")
|
|
|
|
sys.path.append(r"collector")
|
|
|
|
|
|
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'public_sentiment.settings')
|
|
|
|
django.setup()
|
|
|
|
|
|
|
|
Logger = LogManager.get_logger(__name__)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
2024-09-19 16:58:49 +08:00
|
|
|
Logger.info("启动服务器")
|
2024-09-18 13:41:28 +08:00
|
|
|
|
|
|
|
try:
|
|
|
|
from django.core.management import execute_from_command_line
|
|
|
|
except ImportError as exc:
|
|
|
|
raise ImportError(
|
|
|
|
"Couldn't import Django. Are you sure it's installed and "
|
|
|
|
"available on your PYTHONPATH environment variable? Did you "
|
|
|
|
"forget to activate a virtual environment?"
|
|
|
|
) from exc
|
|
|
|
|
|
|
|
execute_from_command_line(sys.argv)
|