Skip to content

Commit 9702100

Browse files
committed
restructured project
1 parent 3277b67 commit 9702100

File tree

19 files changed

+40
-12
lines changed

19 files changed

+40
-12
lines changed

β€ŽPipfileβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ verify_ssl = true
88
[packages]
99
Flask = "*"
1010
Flask-WTF = "*"
11+
python-dotenv = "*"
1112

1213
[requires]
1314
python_version = "3.7"

β€ŽPipfile.lockβ€Ž

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€ŽREADME.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ git clone https://github.com/hackersandslackers/flask-wtform-tutorial.git
2121
$ cd flask-wtform-tutorial
2222
$ pipenv shell
2323
$ pipenv update
24-
$ python3 main.py
24+
$ flask run
2525
```
2626

2727
Alternatively, try installing via `setup.py`:
@@ -30,7 +30,7 @@ Alternatively, try installing via `setup.py`:
3030
$ git clone https://github.com/hackersandslackers/flask-wtform-tutorial.git
3131
$ cd flask-wtform-tutorial
3232
$ python3 setup.py install
33-
$ python3 main.py
33+
$ flask run
3434
```
3535
-----
3636

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Initialize app."""
2+
from flask import Flask
3+
4+
5+
def create_app():
6+
"""Construct the core application."""
7+
app = Flask(__name__, instance_relative_config=False)
8+
app.config.from_object('config.Config')
9+
app.config['RECAPTCHA_PUBLIC_KEY'] = 'iubhiukfgjbkhfvgkdfm'
10+
app.config['RECAPTCHA_PARAMETERS'] = {'size': '100%'}
11+
12+
with app.app_context():
13+
# Import parts of our application
14+
from . import routes
15+
16+
return app
File renamed without changes.

β€Žapp.pyβ€Ž renamed to β€Žflask_wtf_tutorial/routes.pyβ€Ž

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
from flask import Flask, url_for, render_template, redirect
2-
from forms import ContactForm, SignupForm
3-
4-
app = Flask(__name__, instance_relative_config=False)
5-
app.config.from_object('config.Config')
6-
app.config['RECAPTCHA_PUBLIC_KEY'] = 'iubhiukfgjbkhfvgkdfm'
7-
app.config['RECAPTCHA_PARAMETERS'] = {'size': '100%'}
1+
from flask import url_for, render_template, redirect
2+
from flask import current_app as app
3+
from .forms import ContactForm, SignupForm
84

95

106
@app.route('/')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)