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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:12:37+00:00 2026-06-07T13:12:37+00:00

To see the static files (images and pdf), I defined STATIC_DIRS with the values

  • 0

To see the static files (images and pdf), I defined STATIC_DIRS with the values containing directories’ names where I upload those files:

STATICFILES_DIRS = (
    '/home/alessandro/Scrivania/progetto/media/photos/custodia/',
    '/home/alessandro/Scrivania/progetto/media/definitiva/',
    '/home/alessandro/Scrivania/progetto/media/proforma/',
    '/home/alessandro/Scrivania/progetto/media/fpdf/';
)

In STATIC_URL:

STATIC_URL = '/static/' 

In Installed Apps:

INSTALLED_APPS = (
   ....

    'django.contrib.staticfiles',

)

The permissions are 0777.

Now When I want to see the image or pdf files, I get this error message.
Page not found

I am using this URL:
http://127.0.1:8000/home/alessandro/Scrivania/progetto/media/photos/custodia/powered_by.png

Any Ideas? Why is this problem occuring?

  • 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-06-07T13:12:38+00:00Added an answer on June 7, 2026 at 1:12 pm

    By default, static and media files are not served with Django’s builtin dev server. If you want it to serve those files directly, add staticfiles_urlpatterns and a MEDIA_URL pattern to your urlconf.

    from django.conf import settings
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    from django.conf.urls.static import static
    
    # ... the rest of your URLconf goes here ...
    
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    

    This will only work if DEBUG is True.

    For more information, refer to the corresponding docs.

    Note: You should not do this in production! Always use a separate webserver for static files in production mode.

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

Sidebar

Related Questions

I'd like to include files, data and images in a static library API so
Please see following methods. public static ProductsCollection GetDummyData(int? customerId, int? supplierId) { try {
I see a program to reverse a string public class ReverseName{ public static void
I remember reading that static variables declared inside methods is not thread-safe. (See What
In the majority of cases I see Log instances declared as follows: public static
class t { public function tt() { echo 1; } } t::tt(); See?The non-static
(r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}), As you can see, I have a directory called media under
I'm currently experiencing problems with static content - most noticeably jQuery datepicker images, but
I upload images to my App using Ajax and an Iframe. In Development everything
I'm using valid expires and no-cache headers for my static files and they stay

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.