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
- 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
First clone the repository to use it localy:
$ git clone https://github.com/syqu22/flask-pastebin.git
Then install all required libraries through:
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
GET /api/users/${id}
Parameter | Type | Description |
---|---|---|
id |
int |
Required. Id of user to fetch |
GET /api/users
Parameter | Type | Description |
---|---|---|
page |
int |
Used to paginate (one page returns maximum of 50 users) |
GET /api/users/${id}/pastebins
Parameter | Type | Description |
---|---|---|
id |
int |
Required. Id of user to fetch |
GET /api/pastebins/${id}
Parameter | Type | Description |
---|---|---|
id |
int |
Required. Id of pastebin to fetch |
GET /api/pastebins
Parameter | Type | Description |
---|---|---|
id |
int |
Used to paginate (one page returns maximum of 50 pastebins) |