Basic Flask Request

flask

It is a simple Flask project where the processing is done both in the foreground and in the background.


Module Install

pip install Flask
pip install email-validator
pip install Flask-Login
pip install Flask-SQLAlchemy
pip install WTForms
pip install requests
pip install pwinput

You can start web service with python service.py then see localhost:5000 address.

You can perform operations such as logging in and registering both via the web interface and through requests.



Start


Web Type:

image1

Request Type:
username = "test_username"
email = "test_email@test.com"
password = *****
user = RequestProcess(username, email, password)



Register


Web Type

image4

Request Type:
user.register_request()



Login


Web Type

image5

Request Type:
user.login_request()



Add Article


Web Type

image7

Request Type:
title = "Test Title"
content = "Test Content\nTest Content\nTest Content\nTest Content\nTest Content"
user.add_article_request(title=title, content=content)



Dashboard


Web Type

image6

Request Type:
user.dashboard_request()
Result:
{
  "data": {
    "1": {
      "Created Date": "03.05.2023 23:53:53",
      "Title": "Test Title"
    }
  },
  "message": "Success Get Articles"
}



Article Detail


Web Type

resim9

Request Type:
article_id = 1
user.article_detail_request(article_id=article_id)
Request Result
{
  "message": {
    "1": {
      "Content": "

Test Content

\r\n\r\n

Test Content

\r\n\r\n

Test Content

\r\n\r\n

Test Content

\r\n\r\n

Test Content

\r\n", "Created Date": "03.05.2023 23:53:53", "Title": "Test Title" } } }