https://github.com/realpython/flask-jwt-auth
just testing some jwts
https://github.com/realpython/flask-jwt-auth
Last synced: 8 months ago
JSON representation
just testing some jwts
- Host: GitHub
- URL: https://github.com/realpython/flask-jwt-auth
- Owner: realpython
- License: mit
- Created: 2016-12-13T07:38:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-05-20T14:15:50.000Z (over 3 years ago)
- Last Synced: 2025-03-30T09:09:04.266Z (9 months ago)
- Language: Python
- Size: 16.6 KB
- Stars: 284
- Watchers: 10
- Forks: 161
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask JWT Auth
[](https://travis-ci.org/realpython/flask-jwt-auth)
## Want to learn how to build this project?
Check out the [blog post](https://realpython.com/blog/python/token-based-authentication-with-flask/).
## Want to use this project?
### Basics
1. Fork/Clone
1. Activate a virtualenv
1. Install the requirements
### Set Environment Variables
Update *project/server/config.py*, and then run:
```sh
$ export APP_SETTINGS="project.server.config.DevelopmentConfig"
```
or
```sh
$ export APP_SETTINGS="project.server.config.ProductionConfig"
```
Set a SECRET_KEY:
```sh
$ export SECRET_KEY="change_me"
```
### Create DB
Create the databases in `psql`:
```sh
$ psql
# create database flask_jwt_auth
# create database flask_jwt_auth_test
# \q
```
Create the tables and run the migrations:
```sh
$ python manage.py create_db
$ python manage.py db init
$ python manage.py db migrate
```
### Run the Application
```sh
$ python manage.py runserver
```
Access the application at the address [http://localhost:5000/](http://localhost:5000/)
> Want to specify a different port?
> ```sh
> $ python manage.py runserver -h 0.0.0.0 -p 8080
> ```
### Testing
Without coverage:
```sh
$ python manage.py test
```
With coverage:
```sh
$ python manage.py cov
```