question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please help with initial installation

See original GitHub issue

I performed the following steps:

$ pip install cookiecutter
$ cookiecutter https://github.com/sloria/cookiecutter-flask.git
full_name [Steven Loria]: Charles Ross
email [sloria1@gmail.com]: chivalry@mac.com
github_username [sloria]: chivalry
project_name [My Flask App]: 
app_name [myflaskapp]: 
project_short_description [A flasky app.]: 
Select use_pipenv:
1 - no
2 - yes
Choose from 1, 2 (1, 2) [1]:
$ cd myflaskapp/
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ export FLASK_APP=autoapp.py
$ export FLASK_ENV=development
$ mv .env.example .env
$ flask run
 * Serving Flask app "autoapp.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 251-726-117

I load the address in a browser and get the following:

127.0.0.1 - - [13/Apr/2019 06:00:45] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [13/Apr/2019 06:00:45] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
127.0.0.1 - - [13/Apr/2019 06:00:45] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [13/Apr/2019 06:00:45] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [13/Apr/2019 06:00:45] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [13/Apr/2019 06:00:45] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/chuck/Projects/education/flask/myflaskapp/venv/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/Users/chuck/Projects/education/flask/myflaskapp/autoapp.py", line 5, in <module>
    app = create_app()
  File "/Users/chuck/Projects/education/flask/myflaskapp/myflaskapp/app.py", line 16, in create_app
    register_extensions(app)
  File "/Users/chuck/Projects/education/flask/myflaskapp/myflaskapp/app.py", line 33, in register_extensions
    webpack.init_app(app)
  File "/Users/chuck/Projects/education/flask/myflaskapp/venv/lib/python3.7/site-packages/flask_webpack/__init__.py", line 27, in init_app
    self._set_asset_paths(app)
  File "/Users/chuck/Projects/education/flask/myflaskapp/venv/lib/python3.7/site-packages/flask_webpack/__init__.py", line 69, in _set_asset_paths
    "Flask-Webpack requires 'WEBPACK_MANIFEST_PATH' to be set and "
RuntimeError: Flask-Webpack requires 'WEBPACK_MANIFEST_PATH' to be set and it must point to a valid json file.

I took a look at the settings.py file and tried to manually set the WEBPACK_MANIFEST_PATH I found there, but that didn’t change anything.

What am I missing?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jamescurtincommented, Sep 18, 2019

Hi @nk9,

Below are the instructions included in the READMEs of all generated projects:


Run the following commands to bootstrap your environment

git clone https://github.com/myuser/myproject
cd myproject
pip install -r requirements/dev.txt
cp .env.example .env
npm install
npm start  # run the webpack dev server and flask server using concurrently

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

flask db init
flask db migrate
flask db upgrade
npm start

As an alternative you could use Docker (which also has a section in the generated project READMEs) which makes configuration even simpler:

docker-compose up flask-dev

Either of these two approaches should be sufficient to fully configure and bootstrap an application.

I think the confusion about how to bootstrap an application arises from the fact that many users expect usage info to be found in the main project’s README. We prefer not to do this and instead keep usage-related information contained within the cookiecutter template, as the configuration instructions contain template fields that are only rendered after a project has been generated. I just updated the main README via https://github.com/cookiecutter-flask/cookiecutter-flask/pull/552 to clarify this.

If you feel as if additional clarification to the usage instructions would be valuable, please feel free to open a PR!

1reaction
oerdcommented, Apr 18, 2019

@chivalry the “generated” Flask project uses Webpack to bundle static assets like javascript or css files. During development you should run the project via npm start command - it will run both Flask and webpack.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to troubleshoot Windows Installer errors - Microsoft Support
Describes how to troubleshoot problems that occur when you install, uninstall, or upgrade a program on a Windows-based computer by using Windows Installer....
Read more >
Fix problems installing Chrome - Google Chrome Help
If you get an error message when you try to download and install Google Chrome, try these fixes. Fix most installation errors.
Read more >
Chapter 2 MySQL Installer Initial Setup
When you download MySQL Installer for the first time, a setup wizard guides you through the initial installation of MySQL products.
Read more >
Grub2/Installing - Community Help Wiki
This page details the procedures for installing and reinstalling GRUB 2. The information applies to most versions of GRUB 2, ...
Read more >
Set up your Samsung Smart TV
1. After you open the box, the Quick Setup Guide is the first thing you'll see. Open this to get an overview of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found