24👍
I’d highly recommend using the same database backend in production as in development, and all stages in between. Django will abstract the database stuff, but having different environments will leave you open to horrible internationalisation, configuration issues, and nasty tiny inconsistencies that won’t even show up until you push it live.
Personally, I’d stick to mysql, but I never got on with postgres 🙂
10👍
I second all previous answers, adding some explicit reasons:
- MySQL issues Warning exception when you try to store string longer that field width – you won’t get them in SQLite, so not only you’re string will be different between dev and production, but also program behaviour
- bugs in both backends are different – I remember that once I tried SQLite for dev and MySQL for production, but it turned out that I discovered a bug in MySQL backend which was not present in SQLite one. So I filed a ticket for it and switched to MySQL for testing 🙂
And you can even try to compete with SQLite in terms of speed, take a look at my answer for other question:
- [Django]-Pytest.mark.parametrize with django.test.SimpleTestCase
- [Django]-Django 2, python 3.4 cannot decode urlsafe_base64_decode(uidb64)
- [Django]-Using django-admin on windows powershell
8👍
Why would you want to do that?
- SQLite has no stored procedure support yet.
- SQLite is typeless. You can end up with a lot of typecast problems when running MySQL.
- Also SQLite doesn’t support RIGHT join yet.
- [Django]-What does 'many = True' do in Django Rest FrameWork?
- [Django]-Itertools.groupby in a django template
- [Django]-Dynamic choices field in Django Models
7👍
Use the same database in all environments.
As much as the ORM tries to abstract the differences between databases, there will always be certain features that behave differently based on the database. Database portability is a complete myth.
Plus, it seems pretty insane to test and develop against code paths that you will never use in production, doesn’t it?
- [Django]-Get user profile in django
- [Django]-How can I avoid "Using selector: EpollSelector" log message in Django?
- [Django]-Factory-boy create a list of SubFactory for a Factory
- [Django]-Django Rest Framework model serializer with out unique together validation
- [Django]-In django, how do I sort a model on a field and then get the last item?
- [Django]-No handlers could be found for logger
3👍
Just made this major mistake starting off with sqlite and when i try to deploy on production server with mysql, things didn’t work as smooth as i expected. I tried dumpdata/loaddata with various switches but somehow keep getting errors thrown one after another. Do yourself a big favor and use the same db for both production and development.
- [Django]-How does django handle multiple memcached servers?
- [Django]-How can I get MINIO access and secret key?
- [Django]-Django: show the count of related objects in admin list_display