Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tecladocode/web_blog
Simple web-based blog to introduce Flask, HTML, CSS, Bootstrap, and Jinja2.
https://github.com/tecladocode/web_blog
Last synced: about 2 months ago
JSON representation
Simple web-based blog to introduce Flask, HTML, CSS, Bootstrap, and Jinja2.
- Host: GitHub
- URL: https://github.com/tecladocode/web_blog
- Owner: tecladocode
- Created: 2015-12-30T10:37:14.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-02-17T13:57:27.000Z (almost 3 years ago)
- Last Synced: 2023-03-01T08:35:32.568Z (almost 2 years ago)
- Language: Python
- Size: 13.7 KB
- Stars: 42
- Watchers: 7
- Forks: 54
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Web blog
========[Original course code](https://github.com/schoolofcode-me/web_blog/releases/tag/v1.0.0) | [Code updated to Flask 2.0](https://github.com/schoolofcode-me/web_blog/releases/tag/v2.0.0)
This is a simple web-based blog that doesn't do much but introduces Flask, HTML, CSS, Bootstrap, Jinja2, and other concepts such as endpoints and APIs.
The blog requires MongoDB to be running without authentication enabled.
Once this is running, execute the app with `flask run` and navigate to the endpoint (default: `http://127.0.0.1:5000/`).
The available endpoints are:
- `/`
- `/login`
- `/register`
- `/blogs`
- `/blogs/new`
- `/posts/`
- `/posts/new/`## How to use this code
1) Create a new virtual environment: `python -m venv .venv`
2) Activate the virtual environment:In powershell:
```powershell
.\.venv\Scripts\activate
```In bash
```bash
source .venv/Scripts/activate
```In CMD
```cmd
.venv\Scripts\activate
```In Mac OS / Linux:
```bash
source .venv/bin/activate
```3) Verify that the file `.flaskenv` is in the top directory and that it contains the environment variable `FLASK_APP=src.app`.
4) Run the app
```
flask run
```