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

Documentation - Mention collectstatic #686

Closed
orblivion opened this issue Feb 3, 2015 · 8 comments
Closed

Documentation - Mention collectstatic #686

orblivion opened this issue Feb 3, 2015 · 8 comments

Comments

@orblivion
Copy link

In the quickstart guide, you mention making sure django's static file serving is working. But for some setups, you also have to run collectstatic for the static files to be visible. You might want to mention that there, unless you think it goes without saying.

@tim-schilling
Copy link
Contributor

Are you running your project with DEBUG = False?

@tim-schilling
Copy link
Contributor

In a development environment, you shouldn't have to use collectstatic.

@orblivion
Copy link
Author

Hmm. Maybe I have my dev environment set up wrong. I didn't put a ton of
time into figuring it all out. But, I am running with debug = True.

Thanks, and sorry for the trouble

On Tue, Feb 3, 2015 at 10:07 AM, Tim Schilling notifications@github.com
wrote:

In a development environment, you shouldn't have to use collectstatic.


Reply to this email directly or view it on GitHub
#686 (comment)
.

@tim-schilling
Copy link
Contributor

No problem. You should be able to run your project with python manage.py runserver then browse out to http://127.0.0.1:8000/admin and it should have some sort of css styling without having to run collectstatic.

@mlissner
Copy link

I ran into this issue too and I suggest we re-open this bug. The problem is that you might be running with DEBUG = True in an environment that uses Apache or that otherwise needs to run collectstatic.

I was struggling to get the toolbar working until I opened the browser console for something else and discovered that the files were returning 404's. At that point I ran collectstatic, and everything started working.

Can we add something to the docs that says:

If you are running in an environment that requires that you collect your static assets, run manage.py collectstatic after adding debug_toolbar to INSTALLED_APPS.

That'd go a long ways for people with setups like mine.

@aaugustin
Copy link
Contributor

This isn't specific to the toolbar. You'd have the same behavior with any other application that uses static files e.g. django.contrib.admin. We don't want to duplicate Django's documentation -- in this case, the documentation of the staticfiles app.

@mlissner
Copy link

It's a small thing to add a line about this and it'll save some people lots of time and trouble.

Your call, but in my experience very few Django apps require this step b/c most don't have static resources. At least for me, this wasn't something I was thinking about in the least.

@aaugustin
Copy link
Contributor

I'm still reluctant to recommend a step that will be unnecessary for 99,99% of developers, given that runserver serves static files out of the box. There's enough confusion around staticfiles already. If you use a non-standard development setup, you're a little bit on your own.

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