Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Bubbles66126y@sbiewald oh my apologies.
So I need a login/signup program. It doesn’t need security (it’s not for real production just an example project for some of the students at this school) and I’m trying to work on the SQLite database to go with the whole log in and sign up functions.
I’ve been trying to do it myself but I’m having a lot of trouble understanding how everything in flask works. -
I'll drop a small snippet here, maybe it helps:
from flask import request
...
@app.route('/signup', methods=['get', 'post'])
def signup():
if request.method == 'GET:
return signup_form_HTML
else:
# Form data is in request.form[key]
do_db_actions() # SQLite or whatever
return response_HTML
The request object is unique to every request. -
Bubbles66126yI was using SQLite but I could try SQLAlchemy. I’m just trying to get this done as soon as I can. My problems are mostly coming from that I’m trying to learn flask as I go and I can’t understand any of it
-
Bubbles66126yIf anyone could add me on discord and help so it’ll be easier to have a conversation that would be great
BubbsTheSupreme#0157 -
Bubbles66126yAnd if it means simplifying and shortening a lot of the project I’ll even use JSON as a simple database which never crossed my mind until now
-
Bubbles66126y@Charon92 are we gonna continue using devRant or sumn else. And I can wait No worried thank you for help
-
Bubbles66126yI have the css and html although I don’t know what I have to do with some of the html to get it to work with Flask. I want to learn I just can’t understand it.
-
@Bubbles
a) defined the 'routes', e.g. functions for the sites (see above)
b) return the HTML in the functions
CSS is placed in the static folder. It is reachable with /static/ in the URL.
The Flask quick start guide is quite helpful: http://flask.pocoo.org/docs/1.0/... -
Bubbles66126y@sbiewald I’m not really able to understand. I can return files but that’s about it. I have a program written but I don’t know why. And i can’t understand the fixes and explainations on SO because I don’t even know what I did wrong in the first place
Low key if someone wants to help me with a flask registration form that would be great because it’s kicking my ass.
If you didn’t see my last rant I switched from php to python because I know python and php didn’t like working or doing anything.
rant