1

I'm new to Django. I'm using Django-Pipeline with Bower. I followed this documentation

Here's the structure of my Django project:

|- myProject
    |- manage.py
    |- bower.json
    |- bower_components
        |- jquery
        |- bootstrap
        |- ...
    |- myProject
        |- settings.py
        |- static // This is the folder that gets created
            |- jquery
            |- bootstrap
            |- ...
    |- myApp

Is it a normal behaviour for Django to create a "static" directory inside myProject? If I manually delete the static folder, it automatically gets created at the next page refresh.

What I don't get is I have specified where to find static files using the STATICFILES_DIRS setting. So to me it would seem logical that Django (in development environment at least) would serve files directly from my bower components folder.

Am I missing something?

EDIT: I am not running collectstatic. This folder gets created just when I refresh the page.

gkpo
  • 2,623
  • 2
  • 28
  • 47
  • 2
    STATICFILES_DIRS sets where to pick files from. STATIC_ROOT sets where to put them in. I never had the case but, as it's a target directory, it feels logical it would get created if it does not exist. – spectras Mar 11 '15 at 11:20
  • 1
    In my development machine it does not automatically create a static folder, only when I manually run `manage.py collectstatic`. – Selcuk Mar 11 '15 at 13:19
  • Yeah that's the thing. It seems logical it would get created to me as well. But I'm not running collectstatic so this is why I find it strange... – gkpo Mar 14 '15 at 16:58
  • Collectstatic come in picture when you set BEBUG=False , main task of collectstatic is copy all static file to static root directory – GrvTyagi Sep 24 '15 at 02:20

2 Answers2

1

django-pipeline by default collect static to save results of compiling. See option PIPELINE_COLLECTOR_ENABLED to turn it off (appeared into django-pipeline version 1.6.5). But it may cause an errors, if you are using something like LESS.

Max Vyaznikov
  • 4,135
  • 2
  • 11
  • 10
0

How are your PIPELINE settings? In particular the output_filename settings of PIPELINE_JS and PIPELINE_CSS?

Because I think django-pipeline is responsible for the creation of such folder, while compiling and minifying sources, not django

abidibo
  • 4,175
  • 2
  • 25
  • 33
  • 1
    The output_filename looks like this: 'output_filename': 'css/styles.css'. However I'm not running collectstatic, so I don't think these should matter... ? – gkpo Mar 11 '15 at 16:51