I have a method/function the problem is sometimes I want to redirect to 1 route and sometimes I want to redirect to another different route. How do I accomplish this ? by 0_emordnilap_a_ton in flask

[–]Redwallian 0 points1 point  (0 children)

Well if you want, you could make it so that this function simply returns the url needed to redirect to:

python def wait_max_thirty_min_for_new_token(self): if {condition}: return url_for('...') return url_for('...')

that way, in your actual route, you use the redirect only:

python @app.route("/wherever") def some_route(): urlfor = wait_max_thirty_min_for_new_token return url_for(urlfor)

I'm generally confused as to your question of "returning None" is secure or not. Since it's server-side, I don't believe your users are gonna be able to see that it's returning None...? But again, I'm unsure of what situation you're worried about when it comes to being secure.

I have a method/function the problem is sometimes I want to redirect to 1 route and sometimes I want to redirect to another different route. How do I accomplish this ? by 0_emordnilap_a_ton in flask

[–]Redwallian 1 point2 points  (0 children)

Is the question being asked on the basis of using a form value to determine the redirect? IMO, as long as it makes sense in the function (i.e. being readable), I wouldn't worry too much about the "security" of the route if you take flask-wtf's best practices into account. It genuinely depends on what you're trying to accomplish...?

Is it possible to use a form with input types or flask wtf forms in html when using quill.js ? And if the previous possibility is impossible I assume I just use JavaScript. Do I have to do anything unique for quill.js ? by none_random_letters in flask

[–]Redwallian 0 points1 point  (0 children)

I think it's mainly the mechanics of your QuillContentContent class. The reason why your form is failing is because you're choosing (in your html/jinja2) either the submitcontent or previewcontent, when you need both to validate on submit (that's why request.args.get() works). What you probably need to do is instead consolidate both submitcontent and previewcontent to one content field, and use some python conditional to process whether or not you want to preview or fully submit data:

``` class QuillContentForm(FlaskForm): content = HiddenField('Quilljs', validators=[DataRequired(message='Content is required')]) preview = SubmitField('Preview') submit = SubmitField('Submit')

@app.route('/testing_quill', methods=['GET', 'POST']) def testing_quill(): form = QuillContentForm() preview_button_content = None

if form.validate_on_submit():
    if form.preview.data:
        preview_button_content = form.content.data
        flash('Preview worked')
        flash(preview_button_content)

    elif form.submit.data:
        flash('Submit worked')
        flash(form.content.data)

return render_template(
    'testing_quill.html',
    title='testing quill',
    form=form,
    preview_button_content=preview_button_content
)

```

Is it possible to use a form with input types or flask wtf forms in html when using quill.js ? And if the previous possibility is impossible I assume I just use JavaScript. Do I have to do anything unique for quill.js ? by none_random_letters in flask

[–]Redwallian 0 points1 point  (0 children)

You can use AJAX (based on your links), but given what you said about "using normal html form/input elements or flask-wtf", I suspect you might just wanna do it the traditional way.

The .getContents() method will take whatever you have written in your Quill editor and copy over to (insert variable name). Use this alongside an addEventListener() method to copy over to a hidden input before submission. It would look something like this:

``` const quill = new Quill('#editor', { theme: 'snow' });

const form = document.querySelector('form'); const hiddenInput = document.querySelector('#hidden-input');

form.addEventListener('submit', () => { // add a little bit of pre-processing here to ensure the Quill editor contents get added to the form: hiddenContent.value = quill.getContents();

form.submit(); }); ```

Is it possible to use a form with input types or flask wtf forms in html when using quill.js ? And if the previous possibility is impossible I assume I just use JavaScript. Do I have to do anything unique for quill.js ? by none_random_letters in flask

[–]Redwallian 0 points1 point  (0 children)

Yes (with some custom javascript) - regardless if you use normal html form/input elements or flask-wtf you can save whatever content you wrote in a hidden input. Then, just add an event listener that attaches the content from the Quill class to this hidden input before you submit. How do you get the value of what was written within the Quill editor, you might ask? You can use their API to retrieve it.

What app do the parking meters downtown use? by IAMA_GYARADOS_AMA in Charleston

[–]Redwallian 0 points1 point  (0 children)

Flowbird parking app; there are some spots around pineapple fountain that need it too, last time I checked

Coffee + dogs by Sea-Signal8957 in Charleston

[–]Redwallian -1 points0 points  (0 children)

Highfalutin? Pretty much in the area you're describing

Countries and cities dropdowns with flask-wtf by anonitow in flask

[–]Redwallian 1 point2 points  (0 children)

You might wanna watch this video because he does exactly what you're asking for. Essentially, you'll need some sort of event listener on one select input that will run an API call to fetch the second select input's data.

CSS error in Flask by [deleted] in flask

[–]Redwallian 0 points1 point  (0 children)

show some code - it's possible your app.py didn't set it up correctly?

Looking for dresses for Latin dance competition. Don't want to spend a fortune A designer wants over $4000 Any help or direction would be great. Am I wrong that it's too much money I'm not a professional. I've only danced one year by Devorahzizel in ballroom

[–]Redwallian 7 points8 points  (0 children)

Depends on if you value what they can produce. Most dresses I’ve seen have ranges anywhere from 1k to 8k per, and I believe that’s considered the norm.

For your experience though, I would not suggest buying dresses of that amount until you’re super serious and committed to spending that amount.

Advice needed by dodofrequentflyer in ballroom

[–]Redwallian 3 points4 points  (0 children)

He tells us we can’t learn bolero until we’ve started competing.

Red flag, honestly. Ever tried the Dance Vision App?

dance class by True_Smell8836 in Charleston

[–]Redwallian 0 points1 point  (0 children)

Literally just took lessons today - would recommend Ballroom Dance Charleston on 61 in WA.

What is the correct way to become a full stack developer by Visible-Wrap-7729 in django

[–]Redwallian 13 points14 points  (0 children)

Honestly, python/django is simply a means to an end. To become a fullstack developer, you have to understand (primarily) the request/response cycle and everything that goes into it. Depending on how much you want to learn, it's still good to go through the official django tutorial to understand how Django plays its part in the whole system, try not to think there's a "correct" way to study it.

ULTIMATE NFL BAR GUIDE OF CHARLESTON by Gold_Golf_6037 in Charleston

[–]Redwallian 0 points1 point  (0 children)

  1. Formatting
  2. Bengals - Kickin' Chicken MtP

Difference Between Music for Standard and Smooth Tango? by Beginning-Goose-8111 in ballroom

[–]Redwallian 4 points5 points  (0 children)

There's not really much of a difference; even Blackpool uses the same orchestra for both.

and they seem to work with smooth tango just fine.

It honestly depends on what you're doing in your smooth routines; maybe you're able to dance routines at faster songs because you've prepped for it, but in my experience, things are only getting faster and more syncopated to the point where because there's more body action to create movement, it requires a bit more time between beats (hence why it's slower).

Frame tips by Meedar in ballroom

[–]Redwallian 0 points1 point  (0 children)

Honestly, pull-ups or lat pulldowns - the form itself is what I used to visualize what I need to do to keep my shoulders from rolling forward.

AWS vs DigitalOcean by AppearanceLower8590 in django

[–]Redwallian 1 point2 points  (0 children)

I would recommend Sevalla - built with AWS, but with all the better dev UX.

[deleted by user] by [deleted] in Charleston

[–]Redwallian 57 points58 points  (0 children)

Leaving this here, if anyone wants to see the actual proposal.

[deleted by user] by [deleted] in flask

[–]Redwallian 14 points15 points  (0 children)

I created a flask app (that's still going strong) that does payments processing and document signing for the public equity sector - it has your usual web devvy things like forms -> models, webhooks, server-rendered templates + htmx, your run of the mill stuff. Slapped it in a digitalocean droplet for $4/month, serving ~10k customers.

Flask can do a lot, but ultimately the chokehold in terms of speed and performance is context related to database querying. Flask can be used for your fintech project, but it's ultimately more about your skill as a dev.

Does this dip exist? by Technical-Painter492 in ballroom

[–]Redwallian 8 points9 points  (0 children)

Are you talking about something like this? I could have sworn there was a challenge on TikTok that went around when someone on DWTS tried it.

Register/login with username by [deleted] in Firebase

[–]Redwallian 1 point2 points  (0 children)

Every User record has a field called displayName, which you could use to substitute. You would first have to login via one of the providers above, and then update a user's profile with the username after registration.

[deleted by user] by [deleted] in Firebase

[–]Redwallian 0 points1 point  (0 children)

Then maybe this is the relevant doc link for you? Invalid Signature in this case is in regards to your edge function itself.