cd to dir in which your flask app sits. (For instance, if your flask
app’s routes.py
is in
/home/students/filbert/cpsc350/paperclips
, then you should
be in the directory /home/students/filbert/cpsc350
.)
Then run these commands (replacing “hobbies
” with the
name of your directory, “hobapp
” with the name of your app,
and “theOtherPort
” with the name of what will be your
development environment’s port):
$ git clone hobbies hobbies_dev
$ cd hobbies_dev
Change “hobbies
” to “hobbies_dev
” in your
three .py files, then:
$ python -m venv venv
$ source venv/bin/activate
$ export FLASK_APP=hobapp
$ flask run -h 0.0.0.0 -p theOtherPort
$ cd ../hobbies
$ git remote add dev ../hobbies_dev
Now do work in the hobbies_dev
directory, and commit to
the repo there. When you’re ready to deploy, go to your
hobbies
directory (production) and type…
$ git pull dev main (or master)
Verify that your changes are visible on the original port (as well as
theOtherPort
).