当我尝试按照本教程在我的 Django 1.4 上安装 Google-auth2 时,出现此错误:
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
import settings
File "/home/ubuntu/xx/settings.py", line 140, in <module>
GOOGLE_OAUTH2_CLIENT_ID = os.environ['GOOGLE_OAUTH2_CLIENT_ID']
NameError: name 'os' is not defined
这一行是:
139- LOGIN_REDIRECT_URL = '/'
**140- GOOGLE_OAUTH2_CLIENT_ID = os.environ['GOOGLE_OAUTH2_CLIENT_ID']**
141- GOOGLE_OAUTH2_CLIENT_SECRET = os.environ['GOOGLE_OAUTH2_CLIENT_SECRET']
142- GOOGLE_WHITE_LISTED_DOMAINS = ['mydomain.org']
SOCIAL_AUTH_USER_MODEL = 'auth.User'