The backend component for the todo mobile app.
- Download the latest version of Python from python.org
- Download MySQL Community Server
- Clone this project:
git clone https://github.com/johneastman/todo-backend.git
- Navigate to the root directory:
cd todo-backend
- Create a virtual environment:
python3 -m venv env
- Activate the environment:
source env/bin/activate
- Install the dependencies:
python3 -m pip install -r requirements.txt
- Create a
.env
file containing the following information. Replace<USERNAME>
and<PASSWORD>
with the username and password of your database:cat >> .env <<EOF DB_HOST=localhost DB_USER=<USERNAME> DB_PASSWORD=<PASSWORD> DB_NAME=todo EOF
- Start the application:
python3 main.py
- Open a browser and navigate to http://127.0.0.1:5000/users. There won't be any output, but you should get a 200 response status.
-
Sign up for a pythonanywhere account (or login if you already have one).
-
Go to the Web menu item and then press the Add new web app button.
-
Click Next, then click on Flask and click on the latest version of Python that you see there. Then click Next again to accept the project path.
-
In the Code section of the Web menu page click on Go to Directory next to Source Code.
-
Click "Open Bash console here" at top of page.
-
Delete or rename the existing
mysite
directory:# delete rm -rf mysite # rename mv mysite/ mysite2/
-
Clone this project into
mysite
:git clone https://github.com/johneastman/boomerang.git mysite
-
Create an environment file in the root directory of the project:
cd mysite touch .env
-
Make sure the last line of
jeastman_pythonanywhere_com_wsgi.py
is this:from main import app as application
-
Back on the dashboard, click "Web" and then click
Reload jeastman.pythonanywhere.com