Skip to content

Commit

Permalink
Remove secrets again from dependencies (it was causing the pipeline i…
Browse files Browse the repository at this point in the history
…ssue). Fix pycodestyle violations
  • Loading branch information
nnayk committed Nov 12, 2023
1 parent 4e0f9bb commit 0540b28
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Backend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"http://127.0.0.1:5001" # This is where db_access.py is running.
)


@app.route("/submit", methods=["POST"])
def submit():
data = request.get_json()
Expand Down Expand Up @@ -80,4 +81,4 @@ def create_user():
try:
app.run(port=5000, debug=True)
except OSError as e:
print(f"Error: {e}. Is port 5000 already in use?")
print(f"Error: {e}. Is port 5000 already in use?")
1 change: 1 addition & 0 deletions Backend/db_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# MongoDB connection
connect(db="dbPicturePerfect", host="localhost", port=27017)


class User(Document):
username = StringField(required=True, unique=True)
name = StringField(required=True)
Expand Down
3 changes: 2 additions & 1 deletion Backend/generate_url.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests
import sys


def generate_url(prompt):
url = "https://imagegolf.io/api/generate"
data = {
Expand All @@ -11,11 +12,11 @@ def generate_url(prompt):

return (r.json()["output"])


if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: script_name <input_value>")
sys.exit(1)

input_value = sys.argv[1]
result = generate_url(input_value)
print(result)
3 changes: 1 addition & 2 deletions Backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ pycodestyle
flask
flask_cors
mongoengine
werkzeug
secrets
werkzeug

0 comments on commit 0540b28

Please sign in to comment.