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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:09:27+00:00 2026-06-05T14:09:27+00:00

I have two separate servers. One is hosting django instance on www.example.com , the

  • 0

I have two separate servers. One is hosting django instance on "www.example.com", the other is serving static files on "static.example.com". In django settings, MEDIA_URL points to "static.example.com". Therefore my photologue is using the "static.example.com" domain.

I want to use "www.example.com" for my photologue, but I can’t figure out how I can override the MEDIA_URL setting for the photologue. Do you know any way to solve this?

Note: Django is serving over apache, Static files hosted on AWS (Amazon Web Service). I just want to change only photologue domain. Other static files must stay where they are.

  • 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-05T14:09:28+00:00Added an answer on June 5, 2026 at 2:09 pm

    Unfortunately Photologue doesn’t provide a setting for this.

    But looking at the code I found a workaround that should do the trick. I assume you use the get_SIZE_url() methods. All of those methods call self.cache_url(). So, you could create a subclass of ImageModel (or Photo if you want to have the functionality that comes with it) which overrides this method.

    from photologue.models import ImageModel  # or Photo
    
    class LocalPhoto(ImageModel):   # or Photo
    
        def cache_url(self):
            local_path = os.path.dirname(self.image.url)[7:].split('/', 1)[1]
            return '/%s/%s' % (local_path, 'cache')
    

    If you extended Photo you already have a working get_absolute_url() otherwise an implementation is straight forward.

    Django admin uses get_admin_thumbnail_url() so if you define a PhotoSize with name ‘admin_thumbnail’ the above method should work there too.

    Effects have a method sample_url() used to show the effect on a sample image in Django admin. This method is based on MEDIA_URL so it won’t work. Unfortunately in this case you cannot simply override this method. But since these images won’t change you could upload them to AWS.

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

Sidebar

Related Questions

I have two separate files that one is server-side JS. The other one is
if i have two IIS servers 5v on one network running winxp each hosting
i'm using python twisted and i have two separate servers working, one that recieves
I have two servers, one in a seperate domain and the other on the
I have two separate caches running in a JVM (one controlled by a third
We have two databases, in two separate locations. One of the databases resides in
I have two separate websites on the same server. One site is a forum
i have a site like twitter.com on server one and on server two i
I have two separate installs of WebSphere. (Actually one is WebSphere Application Server V6.1
Working with one of our partners, we have developed now two separate sets of

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.