WebFaction
Community site: login faq

Greetings. I'm very sorry in advance for my English. I am from Russia. I can not deal with the issue of statistical content (css, js, images) on my website. The site is in Django. I created an application: static_media (Static only (no. Htaccess)), I have the same name folder on the server. Tied it to the site as: <site> / media / static served by static_media - Webxxx Just want to say that I want that to this folder (the application) could serve multiple sites. Folder inside static_media are placed as follows:

  1. static_media 1.1.Site1 1.1.1. css 1.1.3. images 1.1.4. js 1.2.Site2 1.2.1. css 1.2.2. images 1.2.3. js 1.3.SiteN 1.3.1. css 1.3.2. images 1.3.3. js

In settings.py my project (which serves the site: Site1) I:

STATIC_ROOT = '/ home / <username> / webapps/static_media/Site1 /'
STATIC_URL = 'http:// <site> / media / static /'
# Additional locations of static files
STATICFILES_DIRS = (
    STATIC_ROOT,
)

As a result, my files are not statistics. 404 Error! I'm confused, you need to create an application for static content or do not want? What is the benefit, if it is created? Why does not this option if settings.py:

WORK_DIR = os.path.dirname (__file__)
STATIC_ROOT = os.path.join (WORK_DIR, 'static'). Replace ('\ \', '/')
STATIC_URL = 'http:// <site> / media / static /'
# Additional locations of static files
STATICFILES_DIRS = (
    STATIC_ROOT,
)

In this case, the statistics files are located in the directory of my project, not created specifically for this purpose folder. Example: Project Project static css images js

Thank you.

asked 05 May '13, 08:25

JumpJump
36
accept rate: 0%

edited 05 May '13, 08:32

Make sure that your static and media applications are mounted on the above paths using your website in the control panel. If you have already done this, open a ticket at our support site, and we'll help you find the cause of the issue.

(05 May '13, 09:15) timg ♦♦
Be the first one to answer this question!
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
×125

question asked: 05 May '13, 08:25

question was seen: 1,491 times

last updated: 05 May '13, 09:15

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