Похожие чаты

Hey Can we use http & https both at same time

in flask ?

9 ответов

12 просмотров
CHRS- Автор вопроса
Malware ( DM = BLOCK )
yeah

how 🤔.. i try via decorator.. but its show connection reset

CHRS
how 🤔.. i try via decorator.. but its show connect...

acc to first search result of google: https://stackoverflow.com/questions/18962418/https-with-http-in-flask-python

CHRS- Автор вопроса
Malware ( DM = BLOCK )
acc to first search result of google: https://sta...

suppose i want to run an endpoint only on https /admin -> https /dashboard -> http

CHRS
suppose i want to run an endpoint only on https /...

i got this from some random website : from flask import Flask, redirect, request, url_for app = Flask(name) @app.route('/admin', methods=['GET']) def admin(): if request.is_secure: # The request is already using HTTPS, so proceed with handling the endpoint. return 'Admin Page (HTTPS)' else: # Redirect the request to the HTTPS version of the endpoint. return redirect(url_for('admin', _scheme='https', _external=True)) @app.route('/dashboard', methods=['GET']) def dashboard(): if request.is_secure: # Redirect the request to the HTTP version of the endpoint. return redirect(url_for('dashboard', _scheme='http', _external=True)) else: # The request is already using HTTP, so proceed with handling the endpoint. return 'Dashboard Page (HTTP)' if name == 'main': app.run(port=5000)

CHRS- Автор вопроса
Malware ( DM = BLOCK )
i got this from some random website : from flas...

i think same.. means we just need to make decorator .. and filter the stuff 😱😱

Malware ( DM = BLOCK )
i got this from some random website : from flas...

To post more than a few lines of code, use a pastebin like: * dpaste.org * linkode.org * bin.kv2.dev * hastebin.com If you are stuck in a terminal, you can use ix.io or paste.rs to paste from the CLI: <command to print output> |& curl -F 'f:1=<-' ix.io <command to print output> |& curl --data-binary @- https://paste.rs

Malware ( DM = BLOCK )
i got this from some random website : from flas...

Also, try making a habit of including your sources in your replies

Похожие вопросы

Обсуждают сегодня

Hi, I can't understand promises in JavaScript and what we should use them for (maybe the teacher didn't teach well XD). Do you have a solution for this? And are promises used...
A
29
Ещё такой вопрос. Мне необходимо хранить пароль пользователя локально. Для этого планирую использовать ini файл. Это для автозаполнения полей логин и пароль при авторизации. Е...
Евгений
19
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
Xem delist ho rha hai agr naa bhechu toh kya hoga after 1 july?
ABHI
27
@ackza What is the main purpose of the Voting? It's basically to quality check and approve contents. If your post is really good quality or correct and it get downvoted or d...
Imman
1
VIP 332 Quarterly XVS Buyback, Funds Allocation and New Tokenomics Summary This VIP outlines the protocol’s Quarterly Buyback and Funds Allocation strategy as per our Tokeno...
Venus Announcements
8
Hi guys, I'm looking for a good LLM course. Is there any course to learn LLMs in advanced? I'm aiming to use them in my apps, so a perfect course in my openion, is not only a ...
Taha
14
Did you guys see the latest tweet from TonGifts? 🚀
Mike
44
Quick reminder regarding the first phase of the token merger⚠️ As we approach Phase 1 of the token merger, OCEAN and AGIX will migrate to FET starting July 1st! Here's a li...
Stip11
1
I love the passion, really do. I do think this is being blown way out of proportion. We are not deleting our Telegram or not allowing you to talk about anything you want, a...
Mike Herron
3
Карта сайта