Certainly, here's the cleaned-up version of your Markdown content. It includes proper formatting, corrections to the image URLs, and minor text improvements for clarity.
Source: GitHub Repository
This project has evolved to demonstrate several functionalities:
tokenreq
decorator function for route security.- Signup route for registering a username, email, and password in MongoDB.
- Login route for obtaining access and refresh JWT tokens.
- Refresh route for renewing the access token when it expires.
- Unprotected and protected routes to demonstrate JWT-based security measures.
Several security techniques have been added. The application uses an unprotected MongoDB backend running on localhost:27017
.
- .env: Set environment variables. Use
.env.example
as a template. - pyproject.toml: Lists prerequisites. Run
poetry install
to install dependencies.
Install Gunicorn within the poetry shell environment. To verify the installation, run which gunicorn
.
You'll need a launch.json
file as shown below to run the app in debugging mode.
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"program": "/Users/bob/code/Rest_API_Flask/.venv/bin/gunicorn",
"gevent": true,
"args": ["app.run:app", "--bind=127.0.0.1:8000", "--reload", "-w", "4"]
}
]
}
Note: Using the simple RUN command in VSCode will launch Werkzeug on port 5000, not Gunicorn.
For shell execution, use the provided runme.sh
script. In this case, Gunicorn is launched as a Python module, not as an installed binary.
Let me know if this revision meets your requirements.