Skip to content

document how to stop the server on localhost #108

Closed
@felixvelariusbos

Description

@felixvelariusbos

Hi, thank you for making this cool project!

I'm having issues with actually stopping the server on localhost. Pressing CTRL+C does not seem to actually stop it, at least not immediately. This confused me when I did something like try to run a different file only to have it appear the exact same, or close all instances/terminals that had been running Dash, go to 127.0.0.1:8050 and still see the page happily running. It doesn't seem to matter if I'm on Firefox or Chrome. This is using Git Bash on a Windows 7.

While this was going, I looked at my Task Manager and saw some stray python.exe's running even after I had completely closed the terminal. Force closing them through the Task Manager solved the problem. Sometimes they would dissipate on their own after a minute or so; not sure exactly the difference between when it stopped on its own or kept going.

I'm not sure what'd be going on other than maybe a garbage collection issue, but it made for an interesting "Am I crazy what's going on???" session.

My code is more or less following the Dash tutorials:

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

x = [1,2,3,4,5,6]
y = [7,4,2,1,2,4]

app.layout = html.Div(children = [
                html.H1('Hello World'),
                html.Div('First go at making a framework.'),
                html.H2('A Toy Data Graph'),
                # a simple graph
                dcc.Graph(
                    id = 'toy-graph',
                    figure = {
                        'data': [
                            {'x': x, 'y': y, 'name': 'numbers!'}
                        ],
                        'layout': {
                            'title': 'Random numbers!'
                        }
                    }
                ),
            ])

if __name__ == '__main__':
    app.run_server(debug=True)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions