Note to self: The educational video studio Socratica has some of the best (and most amusing, in a wry way) videos about Python.
Pretty much every web hosting company allows you to create MySQL databases. It’s reasonably simple with cPanel and the MySQL Database Wizard. Then you can create tables and field names, etc., with phpMyAdmin.
So what if you’re developing a small database application on your laptop, and you don’t want to mess around with XAMPP or MAMP? No problem! Handy cPanel also gives us Remote MySQL so you can allow remote access to your databases from your laptop. Find it under Databases in cPanel.
To find the IP address your laptop is using right now, go to ip4.me. Copy and paste it into the box labeled “Host” and then click “Add Host.”
NOTE 1: At home, at school, and in a coffee shop, your IP address will be different. Therefore you will need to enter a new IP address into Remote MySQL at each location where you work on your app locally.
NOTE 2: Use the separate cPanel tool MySQL Databases for managing database users.
Here are detailed instructions for an assignment for which my students create a new database via cPanel.
This semester I’ve been gradually building out a single, comprehensive python-beginners repo at GitHub, and the latest segment is all about getting started with Flask — a popular Python framework for building web apps (and easier than Django).
- Introduction to Flask
- Part 2: Baby Steps with Flask
- Part 3: Templates in Flask
- Part 4: Forms in Flask
- Part 5: Deploy a Flask app
I have tried to use various books and online tutorials to teach Flask for the past two years, but I’ve finally given up on that because there’s just so much extra stuff (confusing for my students), or they are outdated and largely wrong now, or both.
Miguel Grinberg’s new, fully updated mega-tutorial for Flask is comprehensive and thorough — but it’s just too thorough, really, for journalism and communications students who only learned Python about four weeks ago.