Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Sep 21, 2024
1 parent d737434 commit b6f3a90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
# Greybook

> Example application for *[Python Web Development with Flask](https://helloflask.com/en/book/1)* (《[Flask Web 开发实战](https://helloflask.com/book/4)》).
A blog engine built with Python and Flask. The example application for the book *[Python Web Development with Flask](https://helloflask.com/en/book/1)* (《[Flask Web 开发实战(第 2 版)](https://helloflask.com/book/4)》).

Demo: http://greybook.helloflask.com

![Screenshot](https://helloflask.com/screenshots/greybook.png)
![Screenshot](demo.png)

## Installation

Clone the repo:

```
$ git clone https://github.com/greyli/greybook.git
$ cd greybook
$ git clone https://github.com/greyli/greybook
$ cd moments
```

Create & activate virtual env then install dependency:

with venv + pip:
Install dependencies with [PDM](https://pdm.fming.dev):

```
$ python3 -m venv .venv # use `python ...` on Windows
$ source .venv/bin/activate # use `.venv\Scripts\activate` on Windows
$ pip install -r requirements.txt
$ pdm install
```

or with PDM (you need to [install PDM](https://pdm.fming.dev/latest/#installation) first):
> [!TIP]
> If you don't have PDM installed, you can create a virtual environment with `venv` and install dependencies with `pip install -r requirements.txt`.
To initialize the app, run the `flask init-blog` command:

```
$ pdm install
$ source .venv/bin/activate # use `.venv\Scripts\activate` on Windows
$ pdm run flask init-blog
```

Generate fake data then run the application:
If you just want to try it out, generate fake data with `flask lorem` command:

```
$ flask lorem
$ flask run
* Running on http://127.0.0.1:5000/
$ pdm run flask lorem
```

Test account:
It will create a test account:

* username: `admin`
* password: `greybook`

Now you can run the app:

```
$ pdm run flask run
* Running on http://127.0.0.1:5000/
```

## License

This project is licensed under the MIT License (see the
Expand Down
Binary file added demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b6f3a90

Please sign in to comment.