Hi,

There is a difference to running the runserver in development and
production mode. In development mode the server automatically serves all of
you static files (JS and CSS). In production mode you should have a
webserver in front of the uwsgi server that serves the python code. For
example you can use Apache and nginx (see
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
and https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/).

If you check in the output of the server you can see that the static files
are not found([16/Jul/2015 17:31:20]"GET /static/css/bootstrap.min.css
HTTP/1.1" 404 102). The 404 means that the file cannot be found, and you
can't get a page with the correct stylesheet when the stylesheet is not
found.

You CAN try to run the following :
python manage.py collectstatic

In the project directory and create the static files, that then will be
served from your runserver process.

Regards,

Andréas

2015-07-16 20:39 GMT+02:00 Chris Nowak <chrisnow...@gmail.com>:

> I'm following the Try Django Tutorial #37 on Youtube and around the 11
> minute mark, after the author sets DEBUG = False and ALLOWED_HOSTS = ['*'] to
> put the website into production mode, he runs the server again and the
> website appears nicely designed on his end. However, when I run it again on
> my end while following along, the Bootstrap design of the website
> completely falls apart with some images not even showing up.
>
> I'm suspecting that this has something to with the static_in_env vs.
> static_in_pro when it comes development vs. production, but I'm not sure,
> just a beginner. Also, the following is what I'm getting in my command
> terminal:
>
>
> [16/Jul/2015 17:31:20]"GET /static/css/bootstrap.min.css HTTP/1.1" 404 
> 102[16/Jul/2015 17:31:20]"GET /static/css/custom.css HTTP/1.1" 404 
> 95[16/Jul/2015 17:31:20]"GET /static/img/marketing1.jpg HTTP/1.1" 404 
> 99[16/Jul/2015 17:31:20]"GET /static/css/navbar-static-top.css HTTP/1.1" 404 
> 106[16/Jul/2015 17:31:20]"GET /static/img/mvp_landing_logo.png HTTP/1.1" 404 
> 105[16/Jul/2015 17:31:20]"GET /static/js/bootstrap.min.js HTTP/1.1" 404 
> 100[16/Jul/2015 17:31:20]"GET /static/js/ie10-viewport-bug-workaround.js 
> HTTP/1.1" 404 115
>
>
> I have attached screen shots of the website and how it's breaking. Any
> help or advice on how to fix this issue is appreciated. Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f5998fb8-3910-430b-a25b-8b48464f9c24%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f5998fb8-3910-430b-a25b-8b48464f9c24%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbkwddYSeL21mboivH-EEONx8vRdnhr66px405bEo%3D-27w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to