https://github.com/transcental/toxicity-server
Backend for my toxicity-checker
https://github.com/transcental/toxicity-server
Last synced: 6 months ago
JSON representation
Backend for my toxicity-checker
- Host: GitHub
- URL: https://github.com/transcental/toxicity-server
- Owner: transcental
- Created: 2022-02-09T19:28:09.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T05:08:28.000Z (almost 3 years ago)
- Last Synced: 2025-07-19T01:41:27.923Z (6 months ago)
- Language: Python
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Flask is a minimal Python framework that helps you create a web server.
Let's take a look at the code we have:
```python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "
Hello, World!
"
```
What did that code do?
First we `import` the `Flask` class. An instance of this class will be our WSGI application.
Next we create an instance of this class. The first argument is the name of the application’s module or package. `__name__` is a convenient shortcut for this that is appropriate for most cases. This is needed so that Flask knows where to look for resources such as templates and static files.
We then use the `route()` decorator to tell Flask what URL should trigger our function. In this case we use `/` routh, which is the default route of any website.
The function returns the message we want to display in the user’s browser. The default content type is HTML, so HTML in the string will be rendered by the browser.
To learn more, checkout the [official guide](https://flask.palletsprojects.com/en/2.0.x/quickstart/).