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

  • Home
  • SEARCH
  • 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 7016399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:46:47+00:00 2026-05-27T22:46:47+00:00

I have a django project that works fine with the embedded server, but when

  • 0

I have a django project that works fine with the embedded server, but when I try to use it on Apache/mod_wsgi, the static files of the admin pages (/static/admin/css) are not found (404). Here are my settings:

MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = '/var/www/wsgi/myproject/static'
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'

STATICFILES_DIRS = ()

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    )


TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    )

TEMPLATE_CONTEXT_PROCESSORS = (
    "socialauth.context_processors.facebook_api_key",
    'django.core.context_processors.media',
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.request",
    "django.core.context_processors.static",
    )

ROOT_URLCONF = 'myproject.urls'

TEMPLATE_DIRS = ('/var/www/wsgi/myproject/templates',)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'myproject.myapp',
    )

I also tried running

sudo python ./manage.py collectstatic

but with no luck.

  • 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-27T22:46:47+00:00Added an answer on May 27, 2026 at 10:46 pm

    What does you apache virtualhost config look like? You should include an Alias directive for the STATIC_ROOT path.

    Something along these lines:

    Alias /static [project-path]/static
    Alias /media [project-path]/media
    <Directory [project-path]/static>
        Order deny,allow
        Allow from all
    </Directory>
    <Directory [project-path]/media>
        Order deny,allow
        Allow from all
    </Directory>
    

    As you’ve written, you would need to run ./manage collectstatic each time you want to deploy new static files in production.

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

Sidebar

Related Questions

I have a Django project that works fine with the development server that comes
I have a django project that runs on a Linux server, and I've been
I have a Django1.1 project that works with a legacy MySQL db. I'm trying
I have a django project that I have been working on as a solo
I have a project that I am working on in django. There are a
I need to have an at-home project now that I'm working on Python/Django at
I have a django project, but for some reason basic jquery isn't working. <html>
I have a Django-project which was running fine, until I made some changes I
I have a Django project that uses Celery for running asynchronous tasks. I'm doing
I am deploying a Django project on apache server with mod_python in linux. I

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.