Forums

Staticfiles problem, not elegant solution

Hello, I have deployed my project in Django, and when I went to my admin panel, css for for admin didnt worked. So I tried instructions about static files connections, it didnt worked. First I added mapping /static/ to my "~myproject"/static folder, nothing happend. Static folder didnt existed in myproject (eventhought on my localhost css for admin worked well). So I started looking for my adminpanel css, i couldnt find (there wher no folder like static or assets in my project). So I created static folder and admin folder and css (static/admin/admin/css) copied files from django github into it and it worked, but I am not shure if this is and elegant solution. Anyone knows what`s wrong?

What about collectstatic? Did you do that?

Yes I did, python3.4 manage.py collectstatic

Is this good practic to copy static folder from Django github and put it into my project?

No, not really. If you've properly configured static files and the admin app, then collectstatic should be putting the files there for you. See http://help.pythonanywhere.com/pages/StaticFiles/ and http://help.pythonanywhere.com/pages/DjangoStaticFiles/ for details.