Flask-Githubcard-1.0.4
توضیحات
Generator a github card for flask web application
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | Flask-Githubcard-1.0.4 |
| نام | Flask-Githubcard |
| نسخه کتابخانه | 1.0.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | jiangwei |
| ایمیل نویسنده | qq804022023@gmail.com |
| آدرس صفحه اصلی | https://2dogz.cn |
| آدرس اینترنتی | https://pypi.org/project/Flask-Githubcard/ |
| مجوز | Apache Software License |
# flask-githubcard
A flask's extension to generate a github card for yourself.
[中文文档](https://github.com/weijiang1994/flask-githubcard)
### Quick Start
```shell
pip install flask-githubcard
```
Step 1: Initial the extension
```python
from flask import Flask
from flask_githubcard import GithubCard
app = Flask(__name__)
githubcard = GithubCard(app)
```
Step 2: In your `<head>` section of your base template add the following code:
```html
<head>
{{githubcard.init_css()}}
{{githubcard.init_js()}}
</head>
```
Step 3: Render the github card in your template.
```html
<div>
{{githubcard.generate_card()}}
</div>
```
Open your browser and visit your web page, github card like bellow here:

### Advanced
#### Configure yourself github info
```python
from flask import Flask
from flask_githubcard import GithubCard
app = Flask(__name__)
githubcard = GithubCard(app)
app.config['GITHUB_USERNAME'] = 'weijiang1994'
app.config['GITHUB_REPO'] = 'Blogin'
```
#### Choose theme
```html
<head>
{{githubcard.init_css(theme='darkly')}}
</head>
<div>
{{githubcard.generate_card(theme='darkly')}}
</div>
```
Darkly Theme

Use Ajax
```python
from flask import Flask
from flask_githubcard import GithubCard
app = Flask(__name__)
githubcard = GithubCard(app)
@app.route('/ajax')
def ajax():
return jsonify(githubcard.create(theme='darkly').get_raw_data())
```
### Note
- Due to the use of GitHub's API without authorization, the number of unique IP visits is limited to 60 times per hour, if more than 60 times, 403 will be reported. If the frequency of access is too high, please go to the authorized account on GitHub
- In the case where the network state is not good, the access to Github will have timeout, which may cause the web page to not open!
نیازمندی
| مقدار | نام |
|---|---|
| - | Flask |
| - | Requests |
نحوه نصب
نصب پکیج whl Flask-Githubcard-1.0.4:
pip install Flask-Githubcard-1.0.4.whl
نصب پکیج tar.gz Flask-Githubcard-1.0.4:
pip install Flask-Githubcard-1.0.4.tar.gz