Re: /static/ 404

287 views
Skip to first unread message

Tom Evans

unread,
Oct 9, 2012, 11:31:18 AM10/9/12
to django...@googlegroups.com
On Tue, Oct 9, 2012 at 4:15 PM, Jaap van Wingerde <jvw...@gmail.com> wrote:
> settings.py:
> "STATIC_URL = 'http://jaap.custard.shrl.nl:8000/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> '/home/jaap/data/development/workspace/django/liakoster.nl/static/',
> )"
>
> "jaap@jaap:~/data/development/workspace/django/liakoster.nl$ python
> manage.py runserver jaap.custard.shrl.nl:8000
> Validating models...
>
> 0 errors found
> Django version 1.4.1, using settings 'liakosternl.settings'
> Development server is running at http://jaap.custard.shrl.nl:8000/
> Quit the server with CONTROL-C.
> [09/Oct/2012 17:08:23] "GET /admin/data/maker/add/ HTTP/1.1" 200 15449
> [09/Oct/2012 17:08:23] "GET
> /static/grappelli/jquery/ui/css/custom-theme/jquery-ui-1.8.18.custom.css
> HTTP/1.1" 404 2573
> [09/Oct/2012 17:08:23] "GET /static/grappelli/stylesheets/screen.css
> HTTP/1.1" 404 2477
> [09/Oct/2012 17:08:23] "GET
> /static/grappelli/stylesheets/mueller/grid/output.css HTTP/1.1" 404 2516
> [09/Oct/2012 17:08:23] "GET /static/grappelli/jquery/jquery-1.7.2.min.js
> HTTP/1.1" 404 2489
> [09/Oct/2012 17:08:24] "GET
> /static/grappelli/jquery/ui/js/jquery-ui-1.8.18.custom.min.js HTTP/1.1" 404
> 2540
> [09/Oct/2012 17:08:24] "GET /static/grappelli/js/grappelli.min.js HTTP/1.1"
> 404 2468
> [09/Oct/2012 17:08:24] "GET /static/admin/js/core.js HTTP/1.1" 404 2429
> [09/Oct/2012 17:08:24] "GET /static/admin/js/admin/RelatedObjectLookups.js
> HTTP/1.1" 404 2495
> [09/Oct/2012 17:08:24] "GET /static/admin/js/jquery.js HTTP/1.1" 404 2435
> [09/Oct/2012 17:08:24] "GET /admin/jsi18n/ HTTP/1.1" 200 5439
> [09/Oct/2012 17:08:24] "GET /static/admin/js/actions.js HTTP/1.1" 404 2438
> [09/Oct/2012 17:08:24] "GET /static/admin/js/jquery.init.js HTTP/1.1" 404
> 2450
> [09/Oct/2012 17:08:24] "GET /static/admin/js/core.js HTTP/1.1" 404 2429
> [09/Oct/2012 17:08:24] "GET /static/admin/js/admin/RelatedObjectLookups.js
> HTTP/1.1" 404 2495
> [09/Oct/2012 17:08:24] "GET /static/admin/js/jquery.js HTTP/1.1" 404 2435
> [09/Oct/2012 17:08:24] "GET /static/admin/js/jquery.init.js HTTP/1.1" 404
> 2450
> [09/Oct/2012 17:08:24] "GET /static/admin/js/actions.js HTTP/1.1" 404 2438"
>
> What am I doing wrong?

Well, for starters, you didn't ask a question :)

Assuming your question is "Why am I getting 404's for static content
on my dev server, even though I set STATIC_URL?", have you included
'django.contrib.staticfiles' in INSTALLED_APPS?

What does "python manage.py findstatic admin/js/core.js" return?

Cheers

Tom

Gladson Simplício Brito

unread,
Oct 9, 2012, 11:33:36 AM10/9/12
to django...@googlegroups.com
# coding: utf-8
DEBUG = False or True ?
TEMPLATE_DEBUG = DEBUG

if false, it has to serve files with apache, nginx, etc...
if true, and to operate...

2012/10/9 Jaap van Wingerde <jvw...@gmail.com>



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/utmB9O2bMksJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Jaap van Wingerde

unread,
Oct 9, 2012, 12:56:54 PM10/9/12
to django...@googlegroups.com
On Tue, 9 Oct 2012 16:31:18 +0100
Tom Evans <teva...@googlemail.com> wrote:

> Assuming your question is "Why am I getting 404's for static content
> on my dev server, even though I set STATIC_URL?", have you included
> 'django.contrib.staticfiles' in INSTALLED_APPS?
Yes:
"INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'filebrowser',
'grappelli.dashboard',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
# 'south',
'data',
)"
> What does "python manage.py findstatic admin/js/core.js" return?
jaap@jaap:~$
"cd /home/jaap/data/development/workspace/django/liakoster.nl
jaap@jaap:~/data/development/workspace/django/liakoster.nl$ python
manage.py findstatic admin/js/core.js Found 'admin/js/core.js'
here: /home/jaap/data/development/workspace/django/liakoster.nl/static/admin/js/core.js /usr/local/lib/python2.7/dist-packages/grappelli/static/admin/js/core.js
/usr/share/pyshared/django/contrib/admin/static/admin/js/core.js
jaap@jaap:~/data/development/workspace/django/liakoster.nl$"

Jaap van Wingerde

unread,
Oct 9, 2012, 1:01:07 PM10/9/12
to django...@googlegroups.com
On Tue, 9 Oct 2012 11:33:36 -0400
Gladson Simplício Brito <gladso...@gmail.com> wrote:

> # coding: utf-8DEBUG = False or True ?TEMPLATE_DEBUG = DEBUG
>
>
> if false, it has to serve files with apache, nginx, etc...
> if true, and to operate...
"DEBUG = True
TEMPLATE_DEBUG = DEBUG"

Tom Evans

unread,
Oct 9, 2012, 1:07:57 PM10/9/12
to django...@googlegroups.com
Are you importing a second settings file perhaps, or is there a later
statement that turns DEBUG off? Your findstatic output shows that
staticfiles is installed and configured correctly, Django
automatically adds staticfiles urls to your urlconf when running in
debug mode, there is very little that can go wrong at that point -
apart from debug being off.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages