Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:16:14+00:00 2026-06-04T04:16:14+00:00

I love Django but getting static files served in development is painfully flakey. I

  • 0

I love Django but getting static files served in development is painfully flakey. I have installed webassets to make the job easier. Basically, my assets are 404’ing with my current configuration but admin assets are fine (?!). My project layout is like this;

myapp/
    common/
        static/
            bootstrap/
                img/
                less/
                js/
        templates/
        __init__.py
        assets.py
        urls.py
        models.py
        views.py
    projects/
        templates/
        static/
        __init__.py
        assets.py
        urls.py
        models.py
        views.py
    public/ <- (static files collected here)
settings.py

In my settings I have the following values configured

__DIR__ = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.join(__DIR__, 'media')
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(__DIR__, 'public')
STATIC_URL = '/static/'

My urls are configured like this;

urlpatterns = patterns('',
    url(r'^projects/', include('myapp.projects.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', include('myapp.common.urls')),
)

urlpatterns += staticfiles_urlpatterns()

Again, assets.py looks pretty standard;

from django_assets import register, Bundle

js = Bundle(
    'bootstrap/js/bootstrap-alert.js',
    'bootstrap/js/bootstrap-button.js',
    'bootstrap/js/bootstrap-carousel.js',
    'bootstrap/js/bootstrap-collapse.js',
    'bootstrap/js/bootstrap-modal.js',
    'bootstrap/js/bootstrap-popover.js',
    'bootstrap/js/bootstrap-scrollspy.js',
    'bootstrap/js/bootstrap-tab.js',
    'bootstrap/js/bootstrap-tooltip.js',
    'bootstrap/js/bootstrap-transition.js',
    'bootstrap/js/bootstrap-typeahead.js',
    output='bootstrap/script.js',
    debug=False
)

register('js', js)

And my base template is very basic;

{% load assets %}
{% assets 'js' %}
    <script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endassets %}

So, when runserver is running, all the js files are bundled into 1 tag with the following url http://localhost:8000/static/bootstrap/script.js?ed501ad2. But this 404’s with the message “‘bootstrap/script.js’ could not be found”.

If however, I log into the /admin app then all css assets are rendered correctly. I’ve run collectstatic and verified that the assets does actually live within public/ directory.

What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:16:15+00:00Added an answer on June 4, 2026 at 4:16 am

    Did you add django_assets.finders.AssetsFinder to your STATICFILES_FINDERS as is required in the document of django-assets?

    http://elsdoerfer.name/docs/webassets/django/index.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to love Django, but this business of static and media files in
I'm a big Django user for web development, and I've grown to love the
Love the JQuery Treewiev plugin http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ , but I have one problem with it.
I have a site running on django, (but the question applies to anything, php,
I love django, and I like flex. Django for it's cool debugging system (those
I really love working with Django and Python, when I go back to PHP
I love LINQ to SQL but it has been bugging me that in using
I love NHibernate's ability to have one table to store multiple types based on
I love Ruby and its framework, but I don't think that Ruby On Rails
I love the idea of Grizzly, but I can't find any good examples to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.