-
i have written an python flask app in visual studio, which i want to add ms-identity-python-webapp to: the app sample works correctly on its own so i added the app.py code to my views.py and added the config files and the html files from the sample to my visual studio solution. is that the wrong way to do it? really need help, im sure its something simple, my app works and the sample works, how do i put them together? here is the start of my views.py """ from datetime import datetime import uuid from flask import Flask, render_template, session, request, redirect, url_for import app_config app = Flask(name) from werkzeug.middleware.proxy_fix import ProxyFix @app.route('/') def index(): @app.route("/login") @app.route(app_config.REDIRECT_PATH) # Its absolute URL must match your app's redirect_uri set in @app.route("/logout") @app.route("/graphcall") def _load_cache(): def _save_cache(cache): def _build_msal_app(cache=None, authority=None): def _build_auth_url(authority=None, scopes=None, state=None): def _get_token_from_cache(scope=None): app.jinja_env.globals.update(_build_auth_url=_build_auth_url) # Used in template if name == "main": #@app.route('/home') """Renders the home page."""return render_template('indexOLD.html',title='Home Page',year=datetime.now().year,#user=MSAL23.result.json(),)@app.route('/contact') @app.route('/service') @app.route('/OrderLog') |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Dear customer, we hear you. Rest assured, you are not alone. Merging two separately developed projects is not always as straightforward as we want it to be. You would need to understand both projects well, in order to cherry-pick parts and fit them together. This Meanwhile, this sample was developed to be a self-contained template. If you start from this template and build your business logic on top of it, create your new project using our sample as a template, by visiting this sample's repo homepage, clicking the green "Use this template" button, and then adding your app's logic little by little, it would probably be a smooth ride. P.S.: With regard to another question "is there a way to create a new visual studio solution from the sample ?" below, please create a standalone github issue for it. |
Beta Was this translation helpful? Give feedback.
-
hi rayluo |
Beta Was this translation helpful? Give feedback.
-
This sample was not previously developed inside visual studio. We will need to take a look into this. Thanks for providing this good idea! For now, if you are trying to avoid the "Use this template" route that I mentioned 2 days ago, you may also try to download this sample as a zip file, unzip it, and then just use it as-is inside visual studio. |
Beta Was this translation helpful? Give feedback.
-
Hi rayluo, Checking if you had any luck finding a sample developed inside VS? Thanks, |
Beta Was this translation helpful? Give feedback.
-
@phelimo, I am not aware of one, but we would love to take a look into this in future. |
Beta Was this translation helpful? Give feedback.
Dear customer, we hear you. Rest assured, you are not alone. Merging two separately developed projects is not always as straightforward as we want it to be. You would need to understand both projects well…