expect django greater than 2, and use open() instead of file() call
This commit is contained in:
parent
48b1054810
commit
e7e560a403
|
@ -2,7 +2,7 @@ language: python
|
||||||
python:
|
python:
|
||||||
- "3.6"
|
- "3.6"
|
||||||
env:
|
env:
|
||||||
- DJANGO="Django>=2"
|
- DJANGO="Django>2.1"
|
||||||
install:
|
install:
|
||||||
- pip install -q $DJANGO
|
- pip install -q $DJANGO
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
|
|
|
@ -70,7 +70,7 @@ except IOError:
|
||||||
try:
|
try:
|
||||||
from random import choice
|
from random import choice
|
||||||
SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
|
SECRET_KEY = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
|
||||||
secret = file(SECRET_FILE, 'w')
|
secret = open(SECRET_FILE, 'w')
|
||||||
secret.write(SECRET_KEY)
|
secret.write(SECRET_KEY)
|
||||||
secret.close()
|
secret.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
|
|
Loading…
Reference in New Issue