Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cookiecutter flask
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Remy Mudingay
Cookiecutter flask
Commits
8c8c5c98
Commit
8c8c5c98
authored
8 years ago
by
Steven Loria
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #79 from Jaza/debug-envvar
Use FLASK_DEBUG instead of MYFLASKAPP_ENV
parents
d23a3c45
4c856777
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.rst
+5
-0
5 additions, 0 deletions
README.rst
{{cookiecutter.app_name}}/README.rst
+9
-4
9 additions, 4 deletions
{{cookiecutter.app_name}}/README.rst
{{cookiecutter.app_name}}/autoapp.py
+2
-2
2 additions, 2 deletions
{{cookiecutter.app_name}}/autoapp.py
with
16 additions
and
6 deletions
README.rst
+
5
−
0
View file @
8c8c5c98
...
...
@@ -70,6 +70,11 @@ BSD licensed.
Changelog
---------
0.10.2 (09/10/2016)
*******************
- Use the FLASK_DEBUG system environment variable, instead of MYFLASKAPP_ENV, to control different configs for development and production environments
0.10.1 (08/28/2016)
*******************
...
...
This diff is collapsed.
Click to expand it.
{{cookiecutter.app_name}}/README.rst
+
9
−
4
View file @
8c8c5c98
...
...
@@ -8,15 +8,18 @@
Quickstart
----------
First, set your app's secret key as an environment variable. For example, example add the following to ``.bashrc`` or ``.bash_profile``.
First, set your app's secret key as an environment variable. For example,
add the following to ``.bashrc`` or ``.bash_profile``.
.. code-block:: bash
export {{cookiecutter.app_name | upper}}_SECRET='something-really-secret'
Before running shell commands, set the ``FLASK_APP`` environment variable ::
Before running shell commands, set the ``FLASK_APP`` and ``FLASK_DEBUG``
environment variables ::
export FLASK_APP=/path/to/autoapp.py
export FLASK_DEBUG=1
Then run the following commands to bootstrap your environment ::
...
...
@@ -28,7 +31,8 @@ Then run the following commands to bootstrap your environment ::
You will see a pretty welcome screen.
Once you have installed your DBMS, run the following to create your app's database tables and perform the initial migration ::
Once you have installed your DBMS, run the following to create your app's
database tables and perform the initial migration ::
flask db init
flask db migrate
...
...
@@ -39,7 +43,8 @@ Once you have installed your DBMS, run the following to create your app's databa
Deployment
----------
In your production environment, make sure the ``{{cookiecutter.app_name|upper}}_ENV`` environment variable is set to ``"prod"``.
In your production environment, make sure the ``FLASK_DEBUG`` environment
variable is unset or is set to ``0``, so that ``ProdConfig`` is used.
Shell
...
...
This diff is collapsed.
Click to expand it.
{{cookiecutter.app_name}}/autoapp.py
+
2
−
2
View file @
8c8c5c98
# -*- coding: utf-8 -*-
"""
Create an application instance.
"""
import
os
from
flask.helpers
import
get_debug_flag
from
{{
cookiecutter
.
app_name
}}.
app
import
create_app
from
{{
cookiecutter
.
app_name
}}.
settings
import
DevConfig
,
ProdConfig
CONFIG
=
Prod
Config
if
os
.
environ
.
get
(
'
{{cookiecutter.app_name | upper}}_ENV
'
)
==
'
prod
'
else
Dev
Config
CONFIG
=
Dev
Config
if
get_debug_flag
()
else
Prod
Config
app
=
create_app
(
CONFIG
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment