Watch course on @freecodecamp YouTube Channel
- Create a virtual environment
- Run the following commands
python -m ensurepip --upgrade
python -m pip install -r requirements.txt
The project includes a script to generate dummy data. Here is how to use it.
- Start by opening a python console at the root of your project
- In the console type the following lines
from blog import db
db.create_all()
- There is a sqlite database file named sqlitedb.file in the blog subfolder.
ls blog
orls blog/sqlitedb.file
to check. - Run
python generate_dummy_data.py
in the terminal
- Execute
python server.py
in the terminal - View http://127.0.0.1:5000/user/3 (for example) in your browser
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 |