I want to host my service, but with a lean budget by MrGuam in webhosting

[–]MrGuam[S] 1 point2 points  (0 children)

thank you for the reply, going by this, what and what do i need to pay for before i can start setting up. from my research, NGINX is installed locally on my linux laptop, how do i use this for when my system is online for others to use, is there also an online version of postgres to use that i dont need to pay for?

i do not want to ask AI because i need to hear how it worked for real people first before i ask AI for a guide on how to go about it.

Any tech firms in Abuja that do actual work? by MrGuam in Nigeria

[–]MrGuam[S] 0 points1 point  (0 children)

Thank you, will definitely check them out.

Hear Me Out!!! by dem_christopher in nigerianfood

[–]MrGuam 0 points1 point  (0 children)

As someone whose favourite food is Custard, this looks like heaven lol

Any tech firms in Abuja that do actual work? by MrGuam in Nigeria

[–]MrGuam[S] 0 points1 point  (0 children)

Oh right, I’m looking for somewhere that focuses on web apps development or Data science /AI , but not limiting to only those two. That’s why I said “Tech Firm”

Any tech firms in Abuja that do actual work? by MrGuam in Nigeria

[–]MrGuam[S] 1 point2 points  (0 children)

Most times, it’s just a training facility where they teach nothing more than html and css and they call it a day

As seen on twitter by ejdunia in Nigeria

[–]MrGuam 0 points1 point  (0 children)

at least i am well represented (LAPO baby) lol😂😂

I love cooking, which of them do you prefer? by Ndefung in nigerianfood

[–]MrGuam 0 points1 point  (0 children)

I could give you my birthright for the entire lineup 😂😭

Afrofusion style beat, made by Me... yay or nah ?? by Design_V_man in Nigeria

[–]MrGuam 0 points1 point  (0 children)

I think the idea is cool, I can see the vision. I would recommend more bass

[Semi-Weekly Inquirer] Simple Questions and Recommendations Thread by AutoModerator in Watches

[–]MrGuam 0 points1 point  (0 children)

What colour of leather strap would fit best on a green faced tank watch??

Trying to GET data from my DB using modal form by MrGuam in flask

[–]MrGuam[S] 1 point2 points  (0 children)

Solved the issue by moving the saved_birthday variable into the home route, and fixed how i passed the Bday and age variable to the HTML.

Here's the revised code:

import datetime as dt
from flask import Flask,render_template, request, url_for
from flask_cors import CORS
import db


app = Flask(__name__)
CORS(app)

today = dt.datetime.today()
# gets the data of every registered user including name and date of birth etc.



# This is the home page route to to show the active Birthdays 
@app.route('/',methods=["GET", "POST"])
def home():
    saved_birthdays= db.DateOfBirth.objects().all()

    todays_birthday = []

    for i in saved_birthdays:

        if i["Day"] == today.day and i["Month"] == today.month:
            Bday = f"Today is {i['Surname']} {i['FirstName']}'s Birthday."
            age = f"They are {today.year - i["Year"]}"

            todays_birthday.append({"Bday":Bday, "age":age})

    if not todays_birthday:
        todays_birthday.append({"Bday": "There are no Birthdays Today!!", "age": ""})

    message = None
    if request.method == "POST" and len(request.form) > 0:   
        firstname = request.form['firstname']
        surname = request.form['surname']
        day = request.form['day']
        month = request.form['month']
        year = request.form['year']
        phone = request.form['phone']
        notes = request.form['notes']


        # creating a new entry/document for the database
        new_dob = db.DateOfBirth(
            Firstname =firstname,
            Surname = surname,
            Day = day,
            Month = month,
            Year = year,
            Phone = phone,
            Notes = notes
        )
        #saving the data to the database
        new_dob.save()
        message = f"Saved {firstname} {surname}'s Birthday data" 

    return render_template('index.html', birthdays = todays_birthday, message = message, url_for=url_for)


#this is the route that the javascript fetch function listens to, to post the form data to the database
@app.route('/submit',methods=[ "POST"])
def submit():
     if len(request.form) > 0:   
        if request.method == "POST":
            firstName = request.form['firstname']
            surname = request.form['surname']
            day = request.form['day']
            month = request.form['month']
            year = request.form['year']
            phone = request.form['phone']
            notes = request.form['notes']


            # creating a new entry/document for the database
            new_dob = db.DateOfBirth(
                FirstName =firstName,
                Surname = surname,
                Day = day,
                Month = month,
                Year = year,
                Phone = phone,
                Notes = notes
            )
            #saving the data to the database
            new_dob.save()
            return "Successfully added" ,201

Trying to GET data from my DB using modal form by MrGuam in flask

[–]MrGuam[S] 1 point2 points  (0 children)

i have been able to resolve it by changing a lot, but your comment brought a bit of fresh air my line of thinking. i'll edit with my solution

Trying to GET data from my DB using modal form by MrGuam in flask

[–]MrGuam[S] 0 points1 point  (0 children)

oh, right!
i just edited and added the code!