fix: Example application does not work (#864)

This commit is contained in:
Bojan Mihelac 2018-11-05 11:05:53 +01:00
parent 5e8d5be9ff
commit 5ea3ebc9e3
3 changed files with 12 additions and 3 deletions

2
.gitignore vendored
View File

@ -12,3 +12,5 @@ dist/
*.python-version
.coverage
*.sw[po]
tests/database.db

View File

@ -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
----------

View File

@ -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,
}
}