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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:46:15+00:00 2026-06-12T23:46:15+00:00

I have my Django static files in Amazon Servers, and I trying to load

  • 0

I have my Django static files in Amazon Servers, and I trying to load these files in my Model Admin File, but its only work with absolute URLs.

In my Django templates I load and call my static files with

{% load admin_static %}
<script type="text/javascript" src="{% static "js/myfile.js" %}"></script>

in settings.py i set this

STATIC_URL = 'https://s3.mydomain.com/static/'

and in my Model Admin, in moment, it only works with

class Media:
    js = ("https://s3.mydomain.com/static/myfile.js",
          "https://s3.mydomain.com/static/myfile2.js",)

How can I load these files only with the static file name?
I trying

class Media:
    js = ("{% static "js/myfile.js" %}",
          "{% static "js/myfile2.js" %}",)

but doesn’t work.

  • 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-12T23:46:17+00:00Added an answer on June 12, 2026 at 11:46 pm

    How about this:

    In your settings file:

    STATIC_URL = "https://aws.domain.com/"
    

    It is standard settings. Note, that it must end in a slash if set to a non-empty value.

    from django.conf import settings
    
    class Media:
        js = (settings.STATIC_URL + "js/myfile.js",
              settings.STATIC_URL + "js/myfile2.js")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a general question about the new Django 1.3 static file framework. I
I have a couple of conceptual questions: regarding serving static files (media) in Django
I'm trying to render static files locally in development. I have followed the rules
I have a project (myapp) in heroku but I can't get the static files
I'd like to love Django, but this business of static and media files in
I love Django but getting static files served in development is painfully flakey. I
Possible Duplicate: Trying to serve django static files on development server - not found
I'm trying to configure Django to serve static files when using runserver (production works
I'm trying to serve static files for download in a django application, I figured
My scenario I'm using django-storage to have the files served via Amazon S3. This

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.