Merge pull request #865 from bmihelac/fix-864-example-app

fix: Example application does not work (#864)
This commit is contained in:
Bojan Mihelac 2019-01-30 15:32:54 +01:00 committed by GitHub
commit da1c21a780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -58,9 +58,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,4 +1,5 @@
import os
import sys
INSTALLED_APPS = [
'django.contrib.admin',
@ -71,9 +72,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,
}
}