In your settings.py
(or local_settings.py
):
import sys
if 'test' in sys.argv:
DATABASES['default'] = {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
More Related Contents:
- Django: What are the best practices to migrate a project from sqlite to PostgreSQL
- Prevent Django SQLite db from being overwritten while pushing to Heroku
- IntegrityError duplicate key value violates unique constraint – django/postgres
- how to unit test file upload in django
- How can I call a custom Django manage.py command directly from a test driver?
- Django’s self.client.login(…) does not work in unit tests
- Django bulk_create with ignore rows that cause IntegrityError?
- Organizing Django unit tests
- How to install libpq-fe.h?
- ImportError: No module named ‘_sqlite3’ in python3.3
- How to reset the sequence for IDs on PostgreSQL tables
- Disable migrations when running unit tests in Django 1.7
- Django: permission denied when trying to access database after restore (migration)
- Migrating existing auth.User data to new Django 1.5 custom user model?
- Heroku: Django database file lost on every dyno restart
- Django and postgresql schemas
- Docker-compose with django could not translate host name “db” to address: Name or service not known
- How to resolve “django.core.exceptions.ImproperlyConfigured: Application labels aren’t unique, duplicates: foo” in Django 1.7?
- In a django model custom save() method, how should you identify a new object?
- Django Static Files Development
- Tying in to Django Admin’s Model History
- django class-based views with inline model-form or formset
- boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
- How can I restrict Django’s GenericForeignKey to a list of models?
- Error “You’re accessing the development server over HTTPS, but it only supports HTTP”
- Adding root element to json response (django-rest-framework)
- Django Reverse with arguments ‘()’ and keyword arguments ‘{}’ not found
- Django – Highlight Navigation based on current page?
- Run custom admin command from view
- Alternative to the deprecated setup_environ() for one-off django scripts?