-
Notifications
You must be signed in to change notification settings - Fork 8
Example on making changes on UI, DB schema
- Run the app on local server (http://127.0.0.1:5000/) by command "python app.py /d/edusample", then browse to the page where I want to make changes
- For example, project_profile.html using chrome, press F12, then Ctrl + Shift + C (or the button on the image), click on the element that I want to change:
- Add changes in the style tab on the bottom right corner, that way I am able to see immediate changes on the left side:
- Then copy and paste modifications to the templates
- Make changes to the Table classes in the python file, or add a new class to add in a new table:
-
To apply the modification to the local server, I can either delete existing database and rebuild or I can add changes manually to the account.db
a. [rebuild]Delete account.db, then modifying the code at the bottom of app.py, and run the app using the same command to rebuild the database:
b. [make changes manually]In command line, cd to the folder where account.db lives in, then type "sqlite3 account.db" in cmd, then I'm ready to update changes to the current account.db.
a. If you already have a changelist for the schema, you can write the needed ALTER commands that reflect those changes. To run them, either write a script or do it manually by logging into the MySQL shell.
b. If you are unsure of the changelist for the schema, you can reconstruct it by...
- log into the MySQL shell
- List all tables with
show tables;
- For each table, do the following.
show fields from tablename;
(replacing tablename with the name of the table)
Compare the information with that in app.py
to see if any changes are needed.