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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:02:25+00:00 2026-05-26T13:02:25+00:00

Looked at some other similar answers on stack overflow, but no relevant answer was

  • 0

Looked at some other similar answers on stack overflow, but no relevant answer was found.

STATIC_ROOT = /home/www/proj_a/static
MEDIA_ROOT = /home/www/proj_a/media
STATIC_URL = /static/
MEDIA_URL = /media/

in some class in some model, we have the upload_to set

pix = models.FileField(_('photo'), upload_to='upload', blank=True)

I would have expected the file to be sent to /media/upload/1.jpg
However, it ends up in /static/upload/1.jpg

This is not lining up with my understanding of docs on Django 1.3.

I am using Django 1.3 in Debug mode.

I am not using Apache yet, I’ll worry about it later, for now I am just trying to figure out the runserver issue in debug mode.

Thx

  • 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-26T13:02:26+00:00Added an answer on May 26, 2026 at 1:02 pm

    You can set a custom storage directory by doing something like this:

    upload_dir = FileSystemStorage(location=UPLOAD_ROOT, base_url='/uploads')
    pix = models.FileField(_('photo'), upload_to='/upload', blank=True, storage=upload_dir)

    UPLOAD_ROOT is defined in my settings.py file: /path/www/upload

    Check these 2 pages for more details:

    http://abing.gotdns.com/posts/2009/django-file-upload-handling-examples/

    http://docs.djangoproject.com/en/dev/howto/custom-file-storage/

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

Sidebar

Related Questions

I have looked at some of the other posts made on similar topics but
I looked to some similar questions but I didn't really get my answer, so
I've checked for other questions relevant to this, but the only answer is Use
I've found similar but not identical questions 742371 and 4081217 with great answers, but
I checked some other similar questions but some of them are old and i'm
I've looked for some other articles on this problem and even tried some of
I've looked for some help on the reddit site itself, but I still can't
Some days ago I looked at boost sources and found interesting typedef . There
I have looked at this page for some time now. Amazing, really. But I
there were a few question similar to mine on the stack but none that

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.