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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:31:51+00:00 2026-05-23T11:31:51+00:00

I ran into this problem for quite some time and is having trouble solving

  • 0

I ran into this problem for quite some time and is having trouble solving this. Right now I am using django 1.2.4 and having the following settings:

AUTH_PROFILE_MODULE = 'customUsers.UserProfile'
TEMPLATE_STRING_IF_INVALID = 'Error generating variable'
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ANONYMOUS_USER_ID = -1

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend', # default
    'guardian.backends.ObjectPermissionBackend',
)



MANAGERS = ADMINS        


TEMPLATE_CONTEXT_PROCESSORS = ("django.contrib.auth.context_processors.auth",
                                    "django.core.context_processors.debug",
                                    "django.core.context_processors.i18n",
                                    "django.core.context_processors.media",
                                   # "django.core.context_processors.static", there is no this function in the file
                                    "django.contrib.messages.context_processors.messages",
                                    "customUsers.user_cp_context.userCPContext")


USE_I18N = False

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/Users/carrier24sg/Documents/workspace/static_teachers/'

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/admin/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = '(grqejktuccy6!@5pr#535*vivl#lcv06=v*hvae#&6mx15nzt'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

#ROOT_URLCONF = 'myproject.urls'

#TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
#   '/home/carrier24sg/webapps/django/myproject/templates'
#)


SITE_ID = 2

ROOT_URLCONF = 'teachers.urls'

TEMPLATE_DIRS = (
            '/Users/carrier24sg/Documents/workspace/templates',
            '/Users/carrier24sg/Documents/workspace/teachers/templates'
)



INSTALLED_APPS = (
                  'customUsers',
                  'ConsentForm',
                  'teachers.consent_teachers',
                  'django.contrib.auth',
                    'django.contrib.contenttypes',
                    'django.contrib.sessions',
                    'django.contrib.sites',
                    'django.contrib.messages',
                    'conversation',
                    'teachers.student_profiling',
                    'south',
                    'guardian',
                    'persistent_messages',)

For some reasons I cannot serve static files like js and css. The output of the development server displays 404 error "GET /media/common/css/sidebar.css HTTP/1.1" 404 2202 I have tried entering the url for the static file on browser, instead of telling me that the file cannot be found(which i was expecting), I was shown the url-unmatched django debug page Using the URLconf defined in teachers.urls, Django tried these URL patterns, in this order: ......The current URL, media/js/conversation_load.js, didn't match any of these.

Question: why is django not reading the url http://127.0.0.1:8000/media/js/conversation_load.js like a request for static file?

  • 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-23T11:31:52+00:00Added an answer on May 23, 2026 at 11:31 am

    for example, you have your “media” folder near settings.py

    Then try:

    from os import path
    MEDIA_ROOT = path.join(path.dirname(__file__), 'media')
    

    Where “media” is you media folder name.

    In urls.py:

    from os import path
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': path.join(path.dirname(__file__), 'media')}),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
Today, I ran into this weird problem with a user using Mac OS X.
This originally was a problem I ran into at work, but is now something
I'm writing a C parser using PLY, and recently ran into a problem. This
I ran into this quite often stated problem but even after looking up nearly
I am working on an image upload script and ran into this problem. Using
I know this question has been asked before, but I ran into a problem.
(this is regarding the Ramaze.net framework) I ran into some really strange problems while
I ran into this dilemma when working on an ASP.net web application using Web
I ran into the following algorithmic problem while experimenting with classification algorithms. Elements are

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.