Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Build a Social Network with Flask Broadcasting Post Model

Josh Keenan
Josh Keenan
20,315 Points

Flask Social Network: No static folder

I have seen this thread about this issue: https://teamtreehouse.com/community/no-css-files-in-the-workspaces But that has not helped me in any way and no solutions have worked for me, has anyone else had this problem recently and can anyone help me?

Chris Freeman
Chris Freeman
Treehouse Moderator 68,457 Points

Are you referring to the workspace associated with the video Post Model?

When I load that workspace, I see:

static
  css
    main.css
    normalize.min.css
  img
    icon-logo.svg
    icon-power.svg
    icon-profile.svg
  js
    main.js
    vendor
      disTime.min.js
      html5shiv.js

Okay. So here's what I did and I got it to work the FIRST time.

1) I downloaded and backed up my workspace. 2) I deleted the one I was working in. 3) I went to the Post Model video and clicked on 'Launch Workspaces'. There should be something like 'requires new workspace at the top of the video when watching it. If you've already watched, just restart the video.

Once you launch workspaces in the 'Post Model' video, you should be good. Make sure you've backed up your original files and re-upload them to get everything working.

On a separate note: I've completed everything up until the follow and unfollow portion and have hit a few snags. Code works, just need to figure out things...name of the game I guess. Welcome to web development,

5 Answers

Josh Keenan
Josh Keenan
20,315 Points

Don't worry, after deleting and re-creating the workspace about 17 times static has appeared, for anyone who has this problem in the future: copy your current workspace (so you don't lose any code), delete the old workspace, open it from the video and voila! you may need to repeat it a lot!!

Simon Fukada
Simon Fukada
7,767 Points

Thank you for mentioning this, I too didn't have the static directory and this solution worked for me but fortunately I only had to delete it once.

In case anyone is wondering how to delete your workspace. On the top menu bar towards the right you should see a Workspaces link (At least at the time I posted this). Click on that, and then you will see your workspaces and there is a "trash can" symbol you can click to delete. Then just click on the launch workspace button (on the video) again to re-launch that workspace. Hopefully, you will then see the static directory!

Josh Keenan
Josh Keenan
20,315 Points

Hey glad to see it still works! Sad to see the issue still persists! Glad this helped you out

Josh Keenan
Josh Keenan
20,315 Points

I don't have static at all..

Christopher Shaw
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 Points

I have been very frustrated. I was also missing the static folder after opening the new workspace. It was only a couple of videos later, when I was getting un-formatted results while the video results looked very pretty, that I looked further into it.

As I had done quite a bit of work that I did not want to redo, I downloaded my existing workspace and deleted it (not easy to find where to delete), then recreated from a later video, and then the static folder exists.

I thought I would be able to upload my individual files, to replace in the workspace, but clicking the upload menu button does nothing. So I have had to copy and paste the text from the backup files to the new workspace files.

Chris Freeman
Chris Freeman
Treehouse Moderator 68,457 Points

I was able to create a new workspace for Django Forms - Custom Forms Media and use the upload button to add a file from my local computer to the workspace. (Windows 8 - Chrome).

However, I noticed that upload would not overwrite an existing file. Perhaps, you need to delete the default files from workspace before you upload the previously captured download files or change the file names slightly for the upload then rename the file once uploaded. Not pretty, but it worked.

If this doesn't solve the issue, please submit an issue to help@teamtreehouse.com. Be sure to include your OS and browser versions.

Christian Basile
Christian Basile
2,067 Points

I do not see the static foulder at all , and I have a weird error when I try to register: Users/christianbasile/Desktop/Sflask/app.py:120: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0. form= forms.RegisterForm() 127.0.0.1 - - [13/Jun/2020 10:06:39] "POST /register HTTP/1.1" 200 - 127.0.0.1 - - [13/Jun/2020 10:06:39] "GET /static/css/normalize.min.css HTTP/1.1" 404 - 127.0.0.1 - - [13/Jun/2020 10:06:39] "GET /static/css/main.css HTTP/1.1" 404 - 127.0.0.1 - - [13/Jun/2020 10:06:39] "GET /static/js/main.js HTTP/1.1" 404 - 127.0.0.1 - - [13/Jun/2020 10:06:39] "GET /static/js/vendor/disTime.min.js HTTP/1.1" 404 - 127.0.0.1 - - [13/Jun/2020 10:06:39] "GET /static/js/main.js HTTP/1.1" 404 -

Thank you. Can anyone send me the js , css codes? Thanks

Josh Keenan
Josh Keenan
20,315 Points

Did you download the workspace?

Christian Basile
Christian Basile
2,067 Points

Hi Josh,

When I click on the workspace I do not see any js, or css or any static file, just the main python codes, and templates (html) no js, nor css anywhere. Is there a link to download these? Thanks