Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open browser after launching a Django or flask app #1058

Closed
DonJayamanne opened this issue Mar 13, 2018 · 14 comments
Closed

Open browser after launching a Django or flask app #1058

DonJayamanne opened this issue Mar 13, 2018 · 14 comments
Assignees
Labels
area-debugging feature-request Request for new features or functionality

Comments

@DonJayamanne
Copy link

DonJayamanne commented Mar 13, 2018

Investigate the possibility of launching the browser once a django/flask app has been started

Some other IDEs (PTVS) do this today

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality area-debugging needs decision labels Mar 13, 2018
@DonJayamanne DonJayamanne changed the title Launching browser after debugging Django or flask Open browser after launching a Django or flask app Mar 13, 2018
@brettcannon
Copy link
Member

How do you know what port to open? Would we prompt for that and then just open localhost? Would you specify in your launch.json, but then how do you keep it synced with the code? Would probably require people specifying the URL to launch in launch.json.

@brettcannon
Copy link
Member

To help manage our issues and to better communicate what the team plans to work on we are closing issues that we don't plan to work on but would accept a pull request from a volunteer for. To be clear, closing this issue does not mean we won't consider a pull request for this enhancement as outlined in our contributing guide, just that the development team has no plans to work on it themselves.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 18, 2018
@DonJayamanne DonJayamanne reopened this Feb 21, 2019
@DonJayamanne
Copy link
Author

DonJayamanne commented Feb 21, 2019

Re-opening as other extensions are looking at doing this, C# extension does this today (or are in the process of doing this).
They are scraping the debugger output to extract the url.

Also, it makes sense, i.e. when you start debugging a web application the next logical step is to open a browser.

@qubitron qubitron added needs proposal Need to make some design decisions and removed Epic labels Mar 5, 2019
@qubitron
Copy link

qubitron commented Mar 5, 2019

We would need to figure out how this would work in remote scenarios.

@DonJayamanne
Copy link
Author

DonJayamanne commented Apr 5, 2019

This feature has landed in VS Code.

We might want to implement this at least for local debugging and consider a seprate issue for remote scenarios.

FYI - Its just a configuration setting in launch.json, not typescript code etc..

@DonJayamanne DonJayamanne added needs PR and removed needs proposal Need to make some design decisions labels Jul 31, 2019
@karthiknadig karthiknadig added this to the 2019 - October Sprint 1 milestone Sep 25, 2019
@karthiknadig
Copy link
Member

I have another issue here with regex for Django and Flask.

@karrtikr karrtikr self-assigned this Oct 2, 2019
@karrtikr
Copy link

karrtikr commented Oct 2, 2019

@karthiknadig Can you elaborate on that?

@karrtikr
Copy link

karrtikr commented Oct 2, 2019

Flask outputs comes out to be something like this,

 * Serving Flask app "app.py"
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

So I am planning to use,

"serverReadyAction": {
    "pattern": "Running on http://([0-9]+[.][0-9]+[.][0-9]+[.][0-9]+:[0-9]+)",
    "uriFormat": "http://%s",
    "action": "openExternally"
}

Similar for django. By observation, it looks like we'll have http://number.number.number.number:<number> present. So having that as default seems fine to me. Any objections? @karthiknadig @ericsnowcurrently @DonJayamanne

@karthiknadig
Copy link
Member

karthiknadig commented Oct 3, 2019

See here for patterns that worked for me: #5192 (comment)

Note: that it may not always be 127.0.0.1, host can be localhost, loopback, etc. Also, "Running on" may not be there in some cases. SSL can be enabled on those frameworks as well, so just http is not enough either. The pattern in my comment has limitations too, for example it does not handle IPv6 host, but it should be a good starting point to test.

@karthiknadig karthiknadig added needs proposal Need to make some design decisions and removed needs PR labels Oct 9, 2019
@karthiknadig karthiknadig assigned Anapo14 and unassigned karrtikr Oct 9, 2019
@karthiknadig
Copy link
Member

@Anapo14 Spec for this is done right?

@luabud luabud added needs PR and removed needs proposal Need to make some design decisions labels Nov 5, 2019
@luabud
Copy link
Member

luabud commented Nov 6, 2019

Changes will be here https://github.com/microsoft/vscode-python/blob/master/src/client/debugger/extension/configuration/resolvers/base.ts.
If user is in experiment, look at the same markers (django, flask, pyramid, jinja), see if serverReadyAction is openExternally, replace value with:

image.png

Add logging and telemetry for this change.

@karthiknadig karthiknadig added the meta Issue that is tracking an overall project label Nov 6, 2019
@karthiknadig karthiknadig removed this from the 2019 October Sprint 3 milestone Nov 7, 2019
@github-actions github-actions bot removed the needs PR label Aug 9, 2022
@karrtikr karrtikr added the needs PR Ready to be worked on label Aug 9, 2022
@paulacamargo25 paulacamargo25 removed the meta Issue that is tracking an overall project label Dec 11, 2023
@paulacamargo25
Copy link

Adding this issue here to the Python Debugger repository.

@paulacamargo25 paulacamargo25 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
@github-actions github-actions bot removed the needs PR Ready to be worked on label Dec 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

8 participants