Week 9 — Uploading…

Let Us Finally Upload Our Projects to the Server

Jooyoung Oh
2 min readNov 7, 2021

Now, let us finally upload our project.

First of all, using Robo3T, access your MongoDB and then click the icon on the upper left corner. There, click “Create” as shown below.

Now, finish setting up your information.

Then, on the “Authentication” tab:

  1. Click the “Perform Authentication” checkbox
  2. Input your ID/PW and click “Save”

Now, let us upload our project to EC2 using FileZilla. I used the project below:

Before uploading, we need to modify our code so it reflects the ID/PW feature. Replace this code -

client = MongoClient('mongodb://test:test@localhost', 27017)

-with this one:

client = MongoClient('mongodb://ID:PW@localhost', 27017)

Now, upload the folder to the home/ubuntu folder. Let us try running the python:

# go to the home directory 
cd ~
# go to the respective folder and run the code
python app.py

There should be an error, and this is because we haven’t installed the pymongo package. Install it by inserting this code:

pip install pymongo

Run again and access it via:

http://[myAWSIP]:5000/

Should work!

Fin.

Unlisted

--

--

Jooyoung Oh
Jooyoung Oh

Written by Jooyoung Oh

After graduating from a high school in Al Khobar, Saudi Arabia, I'm currently spending my gap year exploring the world beyond the wall, behind the screen.