fix: Example application does not work (#864)
This commit is contained in:
parent
5e8d5be9ff
commit
5ea3ebc9e3
|
@ -12,3 +12,5 @@ dist/
|
|||
*.python-version
|
||||
.coverage
|
||||
*.sw[po]
|
||||
|
||||
tests/database.db
|
||||
|
|
|
@ -53,9 +53,10 @@ Example app
|
|||
|
||||
::
|
||||
|
||||
cd tests && ./manage.py runserver
|
||||
|
||||
Username and password for admin are 'admin', 'password'.
|
||||
cd tests
|
||||
./manage.py migrate
|
||||
./manage.py createsuperuser
|
||||
./manage.py runserver
|
||||
|
||||
Contribute
|
||||
----------
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
|
@ -75,9 +76,14 @@ elif os.environ.get('IMPORT_EXPORT_TEST_TYPE') == 'postgres':
|
|||
}
|
||||
}
|
||||
else:
|
||||
if 'test' in sys.argv:
|
||||
database_name = ''
|
||||
else:
|
||||
database_name = os.path.join(os.path.dirname(__file__), 'database.db')
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': database_name,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue