0

I am new to Django 2.2 and I found that SQLite is default database engine here. But I want to use the PostgreSQL instead of SQLite.

I have created a new project and migrate the (ex: Post) model after creating and adding the app to the settings.py and admin.py file. And after that, I decided to use the postgreSQL, and I did it too by migrating to postgreSQL. Before migrating I created a postgres database and add all the necessary details to the settings.py file's DATABASE settings according to instruction of Django. It's working fine. I haven't got any problem yet. Though I see still the sqlite database file still in the project directory. It looks bit odd though. I'm new to Django. Can you please tell me should I keep that file there or delete sqlitedb file? And is there any security issue with sqlitedb file if I keep there? I love to want a neat and clean project settings. Thanks in advance my dear friends!

3
  • You can delete the sqlite database file after you have migrated to postgreSQL. Commented Jun 21, 2019 at 5:02
  • Thank you Mr. Ahmed for your answer. Can you please clarify why the sqlite deletion will not cause any futuristic problem? Commented Jun 21, 2019 at 6:39
  • SQLite is the default database for django projects.Once you have migrated to postgreSQL database, all the changes will take place there only. Commented Jun 21, 2019 at 6:43

1 Answer 1

0

It's totally up to you. If you want to keep then keep it. And if you want to delete that file delete it. There is no security reason or any problem will occur. Just delete it if you don't need it.

When to Use SQLite?

  • All applications that require portability and don’t require expansion.

  • In cases where applications need to read or write files to disk directly.

When to Use MySQL?

  • Where high-security features are required for data access.

  • For websites that work on MySQL despite some constraints.It's a scalable tool that is easy to manage.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks a lot for your prompt reply Mr. Huzaif. After deleting the file db.sqlite3 I don't see any file named db.postgrsql (i.e db.sqlite3) on that place as a reproduction. Why?
Because PostgresSQL is scalable so we have installed a databse using terminal. See the difference in above answer.
Thank you very much dude. I got it now. I'm bit enthusiastic as I'm a learner. Have a great day!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.