Skip to content

Commit

Permalink
MUST UPDATED VERSION
Browse files Browse the repository at this point in the history
just accept everything this is most updated version of website that works
  • Loading branch information
robbie2005 committed Jan 28, 2024
1 parent cb57e9c commit 0e0c7b6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 31 deletions.
Binary file modified __pycache__/app.cpython-311.pyc
Binary file not shown.
37 changes: 15 additions & 22 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
from flask import Flask, jsonify, request, render_template
from flask import Flask, jsonify, request, render_template, session, redirect, url_for
from flask_cors import CORS
import requests
from flask_sqlalchemy import SQLAlchemy


app = Flask(__name__)
CORS(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///mydatabase.db'
db = SQLAlchemy(app)

# Set a secret key for session management
app.secret_key = 'your_secret_key' # Change this to a strong, random secret key


def is_user_authenticated():
print(str(session))
return 'user_id' in session

@app.route('/')
def index():
def main_index():
return render_template('index.html')

@app.route('/home')
def login_page():
return render_template('landing_page.html')
@app.route('/about')
def about():
return render_template('aboutus.html')
@app.route('/yelp-test')
def yelp_default_test():
url = "https://zotmeal-backend.vercel.app/api"

querystring = {"location": "anteatery"}

response = requests.request(
"GET", url, params=querystring)

return (jsonify(response.json()))
@app.route('/home')
def home():
return render_template('home.html')
@app.route('/view')
def view():
return render_template('view.html')
Expand All @@ -38,8 +34,5 @@ def edit():
return render_template('edit.html')



if __name__ == '__main__':
db.create_all()
app.run(debug=True)

6 changes: 3 additions & 3 deletions static/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const register = document.getElementById("register-btn");
email: email,
password: password
});
window.location.href = "http://127.0.0.1:5000/home";
window.location.href = "/home";
})
.catch((error) => {
const errorCode = error.code;
Expand All @@ -74,7 +74,7 @@ const register = document.getElementById("register-btn");
password: password
});
console.log('hello')
window.location.href = "http://127.0.0.1:5000/home";
window.location.href = "/home";
})
.catch((error) => {
const errorCode = error.code;
Expand All @@ -95,7 +95,7 @@ document.addEventListener("DOMContentLoaded", function() {
password: password
});

window.location.href = "http://127.0.0.1:5000/home";
window.location.href = "/home";
}).catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
Expand Down
6 changes: 3 additions & 3 deletions static/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ document.addEventListener("DOMContentLoaded", function() {
*/
const view = document.getElementById("view");
view.addEventListener("click", function() {
window.location.href = "http://127.0.0.1:5000/view";
window.location.href = "/view";
});
const send = document.getElementById("send");
send.addEventListener("click", function() {
console.log('asdfasdf2')
window.location.href = "http://127.0.0.1:5000/send";
window.location.href = "/send";
});

const edit = document.getElementById("edit");
edit.addEventListener("click", function() {
console.log('asdfasdf3')
window.location.href = "http://127.0.0.1:5000/edit";
window.location.href = "/edit";
});
});
7 changes: 4 additions & 3 deletions templates/landing_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="{{url_for('static', filename='firebase.js')}}" defer type="module"></script>
<script src="{{url_for('static', filename='home.js')}}" defer type="module"></script>
<link rel="stylesheet" href="{{url_for('static', filename='landing_page.css')}}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down Expand Up @@ -68,9 +69,9 @@ <h3>Sign in</h3>

</nav>
<div class="page-btns">
<button type="button" class="btn1"></button>
<button type="button" class="btn2"></button>
<button type="button" class="btn3"></button>
<button id="view" type="button" class="btn1"></button>
<button id="send" type="button" class="btn2"></button>
<button id="edit" type="button" class="btn3"></button>
</div>
</div>
</div>
Expand Down

0 comments on commit 0e0c7b6

Please sign in to comment.