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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:43:50+00:00 2026-05-29T09:43:50+00:00

I’m configuring Django on Apache under Ubuntu 11.04. My media files is not available.

  • 0

I’m configuring Django on Apache under Ubuntu 11.04. My media files is not available.

httpd.conf

Alias /robots.txt /home/i159/workspace/prod-shivablog/shivablog/robots.txt
Alias /favicon.ico /home/i159/workspace/prod-shivablog/shivalog/favicon.ico

AliasMatch ^/([^/]*\.css) /home/i159/workspace/prod-     shivablog/shivablog/site_media/static/css/$1

Alias /media/ /home/i159/workspace/prod-shivablog/shivablog/site_media/static/
Alias /static/ /home/i159/workspace/prod-shivablog/shivablog/site_media/static/

<Directory /home/i159/workspace/prod-shivablog/shivablog/static>
Order deny,allow
Allow from all
</Directory>

<Directory /home/i159/workspace/prod-shivablog/shivablog/media>
Order deny,allow
Allow from all
</Directory>

WSGIScriptAlias / /home/i159/workspace/prod-shivablog/shivablog/deploy/wsgi.py
WSGIDaemonProcess local-shivablog.com python-path=/home/i159/workspace/prod-    shivablog/shivablog/:/home/i159/.envs/shivablog/python2.7/site-packages

<Directory /home/i159/workspace/prod-shivablog/shivablog>
<Files wsgi.py>
Order allow,deny
Allow from all
</Files>
</Directory>

urls

# Static files url.
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
                                   {'document_root': settings.MEDIA_ROOT}),
(r'^site_media/static/(?P<path>.*)$', 'django.views.static.serve',
                                {'document_root': settings.STATIC_ROOT}),

wsgi

import os, sys

sys.path.insert(0,  os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir,  os.pardir)))
sys.path.insert(0,  os.path.abspath(os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir)))

from django.core.handlers.wsgi import WSGIHandler
os.environ["DJANGO_SETTINGS_MODULE"] = "shivablog.settings"
application = WSGIHandler()

settings

MEDIA_ROOT = ''

MEDIA_URL = "/media/"

STATIC_ROOT = ''

STATIC_URL = "/site_media/static/"

How to make my media files available? What the configurations are correct? After collectstatic all the static and media files collects to site_media/static. Should I get my media files from this directory (site_media/static)?

  • 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-29T09:43:50+00:00Added an answer on May 29, 2026 at 9:43 am

    You should not have an entry in your urls.py file for media or static files. If you do at least wrap them in a cause which only does this in debug mode = True.

    https://docs.djangoproject.com/en/1.2/howto/static-files/

    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
                                       {'document_root': settings.MEDIA_ROOT}),
    (r'^site_media/static/(?P<path>.*)$', 'django.views.static.serve',
                                    {'document_root': settings.STATIC_ROOT}),
    

    Also your .htaccess file has the following lines which point to the same folder, I think they should be different as your static files are not in your media folder.

    Alias /media/ /home/i159/workspace/prod-shivablog/shivablog/site_media/static/
    Alias /static/ /home/i159/workspace/prod-shivablog/shivablog/site_media/static/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.