[Ilugc] [ILUG-C] [Kanchi-LUG] [FSFTN]

  • From: lgp171188@xxxxxxxxx (L. Guruprasad)
  • Date: Mon, 21 Apr 2014 14:27:30 +0530

Hi Praveen,

On Mon, Apr 21, 2014 at 2:07 PM, praveen s <praveen9482 at gmail.com> wrote:

Hello everyone,
I am using django framework,
In this framework I am not able to collect static files,
I was give

Did you run the 'collectstatic' manage.py command? It picks up the
static files in folders listed in STATICFILES_DIR, 'static' folder in
each of the app directories and copies it to the STATIC_ROOT
directory, where you shouldn't be placing any file on your own. The
static files in STATIC_ROOT folder will be served only when the DEBUG
flag is set to True. For production deployment, the files will not be
automatically served by Django and you will have to configure your
webserver to serve those files using one of the methods described in
https://docs.djangoproject.com/en/dev/howto/static-files/deployment/

settings.py

STATICFILES_DIR = (
    os.path.join(BASE_DIR, "static"),
)

STATIC_ROOT = 'C:/Documents and
Settings/praveen.s/Desktop/Django/django_test/static'

You might have problems if the directory specified in STATICFILES_DIR
and STATIC_ROOT are the same

STATIC_URL = '/static/'

STATICFILES_FINDERS = (
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder"
    )


This collects files into a admin folder, but my own css files are not
collected... When I try to load my logo image I'll show page not found
(404) error. What should I do?

Are the files you are trying to access, present under the STATIC_ROOT directory?

Thanks & Regards,
Guruprasad

Other related posts: