Skip to content

fleuronvilik/flask-api-with-ds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures for Python Developers (w/ Flask)

Watch course on @freecodecamp YouTube Channel

First Steps

  1. Create a virtual environment
  2. Run the following commands
python -m ensurepip --upgrade
python -m pip install -r requirements.txt

Generate Dummy Data

The project includes a script to generate dummy data. Here is how to use it.

  1. Start by opening a python console at the root of your project
  2. In the console type the following lines
from blog import db
db.create_all()
  1. There is a sqlite database file named sqlitedb.file in the blog subfolder. ls blog or ls blog/sqlitedb.file to check.
  2. Run python generate_dummy_data.py in the terminal

Running locally

  1. Execute python server.py in the terminal
  2. View http://127.0.0.1:5000/user/3 (for example) in your browser

Endpoints

User BlogPost
GET /user/<user_id>
/user/ascending_id
/user/descending_id
/blog_post/<blog_post_id>
/blog_post/numeric_body
POST /user /blog_post/<user_id>
DELETE /user/<user_id> /blog_post/delete_last_ten

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Languages