Kaynağa Gözat

脚本运行问题

jiaweiqi 3 yıl önce
ebeveyn
işleme
500114d915

+ 1 - 1
carwin_activity/app_settings.py

@@ -1,6 +1,6 @@
 #coding=utf-8
 
-from .const import *
+# from .const import *
 
 DATABASES = {
     'default': {

+ 7 - 2
carwin_activity/settings.py

@@ -19,8 +19,13 @@ VERSION = '1.0.0'
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
-from .const import *
-from .app_settings import *
+
+if __name__ == 'settings':
+    from const import *
+    from app_settings import *
+else:
+    from .const import *
+    from .app_settings import *
 
 # Quick-start development settings - unsuitable for production
 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/