Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syqu22/flask-pastebin
Simple flask web application
https://github.com/syqu22/flask-pastebin
bootstrap5 flask flask-login flask-sqlalchemy flask-wtf jinja2 mysql pastebin pytest python
Last synced: 30 days ago
JSON representation
Simple flask web application
- Host: GitHub
- URL: https://github.com/syqu22/flask-pastebin
- Owner: syqu22
- License: mit
- Created: 2021-05-01T20:07:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-06T11:56:13.000Z (over 2 years ago)
- Last Synced: 2024-08-03T15:15:19.434Z (4 months ago)
- Topics: bootstrap5, flask, flask-login, flask-sqlalchemy, flask-wtf, jinja2, mysql, pastebin, pytest, python
- Language: Python
- Homepage:
- Size: 292 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - syqu22/flask-pastebin - Simple flask web application (python)
README
# flask-pastebin
This is my first Flask project.
I wanted to do pastebin web application to learn about Python and Web Applications.
Technology I have used:
- Flask
- Flask-WTF for forms and validation
- Flask-SQLAlchemy for Database functionality
- Flask-Login for user authentication
- Pytest for testing
- Jinja2 + Bootstrap 5 for Templates## Features
- Publish public or private pastebins
- Paste expiration
- User privalges to view/edit/delete his own pastebins
- Syntax highlighting
- View recently created public pastebins
- Fetch all data through simple API
## Screenshots
## InstallationFirst clone the repository to use it localy:
```sh
$ git clone https://github.com/syqu22/flask-pastebin.git
```Then install all required libraries through:
```bash
pip install -r requirements.txt
```
There's already an user preloaded in database and you can access him with:Login: ```test```
Password: ```test123```
There's also a special url ```/admin```
thanks to Flask-Admin, where you can have access to database from the website
## API Reference#### Get user
```http
GET /api/users/${id}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of user to fetch |#### Get users
```http
GET /api/users
```| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `page` | `int` | Used to paginate (one page returns maximum of 50 users)|#### Get pastebins of user
```http
GET /api/users/${id}/pastebins
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of user to fetch |#### Get pastebin
```http
GET /api/pastebins/${id}
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of pastebin to fetch |#### Get pastebins
```http
GET /api/pastebins
```| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | Used to paginate (one page returns maximum of 50 pastebins) |