WebFaction
Community site: login faq

2 days of banging my head against the wall. I know this has been answered many times but i'm seriously struggling.

I have followed all the docs, especially: https://docs.webfaction.com/software/django/config.html

my django app is set up: portfolio_django (django1.7/python2.7.4)

my static only app is set up: "portfolio_static" (no .htaccess).

django points to it:

STATIC_URL = 'http://www.josephmohan.co.uk/static/'
STATIC_ROOT = '/home/skru/webapps/portfolio_static/'
STATICFILES_DIRS = ('/home/skru/webapps/portfolio_django/myproject/jmohan/static/jmohan/',)

DEBUG: False

ran python2.7 manage.py collectstatic

files ARE copied into static app.

when i run: python2.7 manage.py findstatic style.css it finds the file at: /home/skru/webapps/portfolio_static/jmohan/style.css

in the template:

<link href="{% static 'style.css' %}" rel="stylesheet" media='screen'>

404 error..

I'm almost certain my settings.py is correct, and findstatic finds it. how do i know that www.josephmohan.co.uk/static is actually pointing at the static server?

the admin files are a 404 aswell,

I've been using Django for a couple of years, but i'm new to webfaction.

To any webfaction guys please feel free to dig through my code, the website is josephmohan.co.uk

asked 09 Apr '15, 16:21

skru
112
accept rate: 0%

edited 09 Apr '15, 17:27

Thanks! the best thing about days like this is you learn a tonne!

(09 Apr '15, 19:01) skru

I added your "portfolio_static" app to your site configuration, using "/static" as the URL path, and your CSS is now loading.

Hope that helps!

permanent link

answered 09 Apr '15, 17:30

seanf
12.2k41836
accept rate: 37%

Worked it out... in myproject/urls.py: urlpatterns = patterns('',

url(r'^admin/', include(admin.site.urls)),
url(r'^', include('jmohan.urls')),

) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

permanent link

answered 09 Apr '15, 17:33

skru
112
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×31
×22

question asked: 09 Apr '15, 16:21

question was seen: 2,530 times

last updated: 09 Apr '15, 19:01

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM