Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Gabor Galantai
PLUS
Gabor Galantai
Courses Plus Student 17,247 Points

Why is everything in Python about Sqlite in the courses if that's not a suitable database for a real life project?

Kenneth Love I am curious why is no python course using MySQL or some serious database if even you claim in one of the Django videos that Sqlite is not adequate for a real project? What sense does it make to learn something if we can't use it for real? I am very upset that both the Flask and the Django framework track is using Sqlite, and there is nothing about using MySQL in Python. At least one of them could teach how to use MySQL (and what to use in order to connect to MySQL), but no... :(

Steven Parker
Steven Parker
231,261 Points

Can you link to the video where it is said that "SQLite is not adequate for a real project"? It seems curious because SQLite is integrated into some mobile platforms.

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Hey Gabor,

Like Andreas cormack said, SQLite is better suited for teaching. For example, in later Django courses, I include the database with the code so you can have exactly what I have at each step. That's not possible with MySQL or Postgres.

And upgrading to either of those databases requires you to install another library (psycopg2 for Postgres or mysqliclient for MySQL) and using that adapter in place of the SQLite one. Where you change that depends on the libraries and ORM that you're using, but they all have excellent docs for this bit of configuration. And then...you're done! You'll use the new database assuming it's available and all of your connection details are correct.

There are a couple of workshops coming up on deploying Django projects that'll cover using Postgres and MySQL on a live, public server, too.

Hi Gabor

I agree, it would be great to have a project using MySQL. The reason Sqlite is used is because its easy for teaching and development purposes as you dont have to worry about having a server setup or connections to it. I have transferred from Sqlite database to Mysql with no issues. In Django, setup the connection to mysql and run migrations. In Flask make your connection and run the app.py file.

Gabor Galantai
Gabor Galantai
Courses Plus Student 17,247 Points

Are you saying that all I need is to change the Sqlite-related imports to MySQL related imports, and I can run the same code?