Skip to content

Commit 74087bf

Browse files
committed
Updated dependencies & README.
1 parent 15a5f36 commit 74087bf

22 files changed

+483
-23
lines changed

β€Ž.env.exampleβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SECRET_KEY=IHUGVFIYUJYIGUibt6gh
2+
FLASK_ENV=development
3+
FLASK_APP=wsgi.py

β€ŽPipfileβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ python-dotenv = "*"
1212
email_validator = "*"
1313

1414
[requires]
15-
python_version = "3.7"
15+
python_version = "3.8"

β€ŽPipfile.lockβ€Ž

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€ŽREADME.mdβ€Ž

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Flask-WTF Tutorial
22

3-
![Python](https://img.shields.io/badge/Python-v3.8-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
3+
![Python](https://img.shields.io/badge/Python-v^3.8-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
44
![Flask](https://img.shields.io/badge/Flask-v1.1.1-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
55
![Flask-WTF](https://img.shields.io/badge/Flask--WTF-v0.14.2-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
66
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c&logo=GitHub)
77
[![GitHub Issues](https://img.shields.io/github/issues/hackersandslackers/flask-wtform-tutorial.svg?style=flat-square&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-wtform-tutorial/issues)
88
[![GitHub Stars](https://img.shields.io/github/stars/hackersandslackers/flask-wtform-tutorial.svg?style=flat-square8&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-wtform-tutorial/stargazers)
99
[![GitHub Forks](https://img.shields.io/github/forks/hackersandslackers/flask-wtform-tutorial.svg?style=flat-square&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-wtform-tutorial/network)
1010

11-
![Flask-WTF Tutorial](https://res-1.cloudinary.com/hackers/image/upload/q_auto:best/v1/2019/11/flask-wtforms.jpg)
11+
![Flask-WTF Tutorial](https://github.com/hackersandslackers/flask-wtform-tutorial/blob/master/.github/flask-wtforms-tutorial@2x.jpg?raw=true)
1212

1313
Source code for the accompanying tutorial found here: https://hackersandslackers.com/flask-wtforms-forms/
1414

@@ -18,7 +18,7 @@ Source code for the accompanying tutorial found here: https://hackersandslackers
1818
**Installation via `requirements.txt`**:
1919

2020
```shell
21-
$ git clone https://github.com/hackersandslackers/fflask-wtform-tutorial.git
21+
$ git clone https://github.com/hackersandslackers/flask-wtform-tutorial.git
2222
$ cd flask-wtform-tutorial
2323
$ python3 -m venv myenv
2424
$ source myenv/bin/activate
@@ -35,6 +35,18 @@ $ pipenv shell
3535
$ pipenv update
3636
$ flask run
3737
```
38+
39+
## Usage
40+
41+
Replace the values in **.env.example** with your values and rename this file to **.env**:
42+
43+
* `FLASK_APP`: Entry point of your application (should be `wsgi.py`).
44+
* `FLASK_ENV`: The environment to run your app in (either `development` or `production`).
45+
* `SECRET_KEY`: Randomly generated string of characters used to encrypt your app's data.
46+
47+
48+
*Remember never to commit secrets saved in .env files to Github.*
49+
3850
-----
3951

40-
**Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.
52+
**Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.

β€Žconfig.pyβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from os import environ, path
33
from dotenv import load_dotenv
44

5+
# Load variables from .env
56
basedir = path.abspath(path.dirname(__file__))
67
load_dotenv(path.join(basedir, '.env'))
78

@@ -15,5 +16,5 @@ class Config:
1516
FLASK_ENV = environ.get('FLASK_ENV')
1617

1718
# Static Assets
18-
STATIC_FOLDER = environ.get('STATIC_FOLDER')
19-
TEMPLATES_FOLDER = environ.get('TEMPLATES_FOLDER')
19+
STATIC_FOLDER = 'static'
20+
TEMPLATES_FOLDER = 'templates'

β€Žapplication/__init__.pyβ€Ž renamed to β€Žflask_wtforms_tutorial/__init__.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44

55
def create_app():
6-
"""Construct the core application."""
6+
"""Construct the core flask_wtforms_tutorial."""
77
app = Flask(__name__, instance_relative_config=False)
88
app.config.from_object('config.Config')
99
app.config['RECAPTCHA_PUBLIC_KEY'] = 'iubhiukfgjbkhfvgkdfm'
1010
app.config['RECAPTCHA_PARAMETERS'] = {'size': '100%'}
1111

1212
with app.app_context():
13-
# Import parts of our application
13+
# Import parts of our flask_wtforms_tutorial
1414
from . import routes
1515

1616
return app
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)