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 6966427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:11:25+00:00 2026-05-27T16:11:25+00:00

I am using Django 1.3.1 and Python 2.7 on WinVista. I am experiencing the

  • 0

I am using Django 1.3.1 and Python 2.7 on WinVista. I am experiencing the same problem whether on the local dev serer or when deployed to my host.

On the main page of my site static media shows:

http://www.drugpolicyreformmovement.com

On secondary pages CSS, images, etc. do not display:

http://www.drugpolicyreformmovement.com/newsarchive2003

http://www.drugpolicyreformmovement.com/newsarchive2010

or

http://www.drugpolicyreformmovement.com/newsarchive2009

The output of ‘manage runserver’ shows a 404 error for static media on those secondary ‘newsarchive’ pages. Somehow ‘document_root’ is different on a secondary page as opposed to the main page, such that it looks in ‘/newsclippings2003/static’ on those secondary pages instead of just looking in ‘/static’ for everything as it should and like it did for the front page.

I don’t know what of my URLconf is relevant to you so I have included the whole file here:

import os
from django.conf.urls.defaults import *
from django.views.generic import ListView, YearArchiveView
from newsclippings.models import Article
from drugpolicyreformmovement.views import ArticleYearArchiveView

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    (r'^$', ListView.as_view(
       queryset = Article.objects.order_by("-date", "publication", "author", "headline"),
       context_object_name='articles',
       template_name='index.html')),
    (r'^newsarchive(?P<year>\d+)/$', ArticleYearArchiveView.as_view()),
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
       { 'document_root' : os.path.join( os.path.dirname(__file__), 'static') }),
    # url(r'^drugpolicyreformmovement/', include('drugpolicyreformmovement.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
)

Again, I think this is the problematic line:

(r'^static/(?P<path>.*)$', 'django.views.static.serve',
    { 'document_root' : os.path.join( os.path.dirname(__file__), 'static') }),

It doesn’t matter what order I put URLconf entries. This line was designed so I wouldn’t have to make changes when I deploy.

  • 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-05-27T16:11:26+00:00Added an answer on May 27, 2026 at 4:11 pm

    Your url in first page is

    http://www.drugpolicyreformmovement.com/static/css/blueprint/print.css
    

    in inner page

    http://www.drugpolicyreformmovement.com/newsarchive2003/static/css/blueprint/print.css
    

    just add / in url or use {{ STATIC_URL }}

    for example

    • /static/css/blueprint/print.css

    or

    • <img src="{{ STATIC_URL }}css/blueprint/print.css" />

    just set STATIC_ROOT in settings

    see here:

    • Django | Managing static files | Django documentation ->
      https://docs.djangoproject.com/en/dev/howto/static-files/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Django and Python 2.6, and I want to grow my application using
I am working on a web application using Python (Django) and would like to
When starting a django application using python manage.py shell , I get an InteractiveConsole
I am using Google motion-charts in a web-site developed in python/django. Is there a
I'm fairly new to both Django and Python. This is my first time using
In Django I am using two applications: python manage.py startapp books python manage.py startapp
I was using python 2.5 and django 1.0.2. But I moved to python 2.6
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
I'm using Django/Python, but pseudo-code is definitely acceptable here. Working with some models that
I'm working on a project, using Python/Django running on a Virtual Private Server, which

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.