在项目中直接执行里面的文件

1,先进入项目根目录

2,导入你要执行的模块

from data_lib.data_api_sales_data import hospital_owner
second_hospital=hospital_owner()

中间可能报错
django.core.exceptions.ImproperlyConfigured: Requested setting YMJ_USER, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

 这里就需要再次导入

 from data_center(根目录)import settings

3,然后执行

secend_hospital.hospital_starts(1)
就可执行该值。

猜你喜欢

转载自www.cnblogs.com/52forjie/p/9364914.html