Merge pull request #865 from bmihelac/fix-864-example-app
fix: Example application does not work (#864)
This commit is contained in:
commit
da1c21a780
|
@ -12,3 +12,5 @@ dist/
|
|||
*.python-version
|
||||
.coverage
|
||||
*.sw[po]
|
||||
|
||||
tests/database.db
|
||||
|
|
|
@ -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
|
||||
----------
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue