importos importsys pwd=os.path.dirname(os.path.realpath(__file__)) sys.path.append(pwd+"../") os.environ.setdefault("DJANGO_SETTINGS_MODULE","myapp.settings") importdjango django.setup() fromapps.city.modelsimportCityCategory fromdb.data.city_dataimportdata forainda