public_sentiment/manage.py
2024-09-19 16:58:49 +08:00

31 lines
781 B
Python

#!/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__':
Logger.info("启动服务器")
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)