Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static assets not resolving #226

Closed
bertomartin opened this issue Apr 1, 2016 · 8 comments
Closed

Static assets not resolving #226

bertomartin opened this issue Apr 1, 2016 · 8 comments

Comments

@bertomartin
Copy link

Though I'm new to the Flask project setup, I think I have everything setup properly. When I run the app, I don't get the css theme due to being unable to reference the file: /static/assets/javascripts/dist/css-theme.entry.js. This file does exist in that location, but the browser can't seem to resolve it. Any help highly appreciated.

@gbrian
Copy link
Contributor

gbrian commented Apr 1, 2016

Hi,
Have you tried running npm install and npm run dev on assests folder ?

@mistercrunch
Copy link
Member

Did you follow the instructions here?
https://github.com/airbnb/caravel/blob/master/CONTRIBUTING.md

@bertomartin
Copy link
Author

Yes, I ran both. It's really strange as the file it's complaining about exist in the directory as expected. The link is hardcoded in the codebase to: '/static/assets/javascripts/dist/css-theme.entry.js'. This file does exist in the given location.

@bertomartin
Copy link
Author

I went to the file: basic.html, deleted it's content, and re-run the application. It still worked, which is unexpected. So, there's something that I'm missing. Modifying any file has no effect. This is probably just something fundamental to flask that I'm missing. Any help appreciated.

@bertomartin
Copy link
Author

I installed the caravel package as well as forked the code. I wanna run the forked code. However, according to the documentation, to run the code you do: caravel runserver -d. This doesn't seem to be running the source code. I'm not very familiar with flask, so some enlightenment would help here.

@mistercrunch
Copy link
Member

Looks like you're running multiple installs
pip uninstall caravel
python setup.py develop

@bertomartin
Copy link
Author

@mistercrunch thank you. I ended up running it from the build directory, but good to know this.

@ivdelchev
Copy link

I actually have the same problem and not running multiple installs for sure. The javascripts/dist/ files are there after running

npm run dev 

in the assets folder and yet the response back for anything in the assets/dist/ is a 404.
@bertomartin How did you run from the build directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants