Questions tagged [django-static]

113 questions
0
votes
0 answers

ReactDOM not rendering in Django template

I am trying to integrate a React frontend into my Django project. I'm using Babel (ver 7.22) and webpack to bundle everything into index-bundle.js Currently, the index-bundle.js file is being fetched (according to the GET requests in terminal), but…
smd21
  • 1
  • 1
0
votes
0 answers

Django static don't read bootstrap javascripts file

When I import bootstrap css and js to django as static, css file connected and works, but js file show me error: "GET /static/bootstrap/js/bootstrap.min.js HTTP/1.1" 404 179. My 'main.html'
0
votes
1 answer

Unusual dark mode option in Django Admin

I added the following code in my setting.py: # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = 'static/' STATICFILES_DIRS = [ …
H C
  • 1,138
  • 4
  • 21
  • 39
0
votes
1 answer

How can I add CKeditot in django ? Can anyone explain step by step?

When I tried to run python manage.py collectstatic it was now working.enter image description here I just expecting that how to add Richtexteditor in in static files
0
votes
1 answer

How to pass link to file in Django views

I am very new to Django and trying display an image on an html page by passing the path to the src from the view. I have this in the 'task1.html' file

{{ description }}

and…
jd_br1
  • 3
  • 3
0
votes
0 answers

Refused to apply style due to unsupported MIME type

Refused to apply style from http://127.0.0.1:8000/plugins/font-awesome-4.7.0/css/font-awesome.min.css'%20%7D because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. STATIC_URL =…
0
votes
1 answer

Django static files not found in production 1.2

My code is working fine in the testing environment (DEBUG=TRUE) but when I switch to DEBUG=FALSE, static files are not being loaded. To run the application I follow: python3 manage.py collectstatic --no-input --clear python3 manage.py…
Ali Solanki
  • 640
  • 7
  • 16
0
votes
2 answers

Why Django can't find static folder in BASE_DIR?

I have these directories: └── MY_FOLDER ├── MY_PROJECT │   └── settings.py │      ├── MY_APP ├── STATIC │   └── style.css ├── MEDIA └── manage.py In the settings.py I've indicated: BASE_DIR =…
0
votes
0 answers

My CSS file won’t load. I try to search the internet but didn’t found a solution. can you assist me?

Hi for some reason my CSS file won’t load. I try to search the internet but didn’t found a solution. can you assist me ? My settings code I've tried every possible solution on the internet, but it's of no use.
user14829429
0
votes
1 answer

Is there a way to load avatar of each user using static method in Django?

I'm looping through each message which has a particular user which in intern as an image associated with it. I want to convert it something like this (which I know is obviously very wrong)
Abhinav
  • 15
  • 3
0
votes
1 answer

Why can't I make changes in my django static files?

A bit of context: I am taking the CS50W course, and now I'm finishing the almost-completed django Mail single-app provided by the distribution code. Within that distribution code, aside from all python files necessary for the server-side, I have…
Cauã
  • 31
  • 6
0
votes
2 answers

Django static JS File not loading

When i am clicking button , js file is not loading internally..the static tag is not working inside home.html ... Its been a very long time since I had to use Django templates but I am having some trouble loading static js files. nav.html
0
votes
0 answers

Serving Django`s static/media files via IBM Cloud Foundry

Using IBM Cloud Foundry service for deployment, I am trying to find a way to serve static/media files with Django in DEBUG=False mode. When deploy, I get a fully functional app with working js and css except media files. My configs: manifest.yml …
0
votes
1 answer

How to make files available not in "/static/", but in "/app/static/"?

I have Django 1.11 project structure like this: project static img1.png app static img2.png File "settings.py" contains: STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR,…
WayMax
  • 87
  • 9
0
votes
2 answers

Django project on Cloud Foundry not loading admin interface CSS

I have a simple Django project deployed with Cloud Foundry. The admin interface (the only interface used by my simple project) looks fine when running locally. When deployed, however, the CSS is visibly broken. The URLs for the CSS and JS assets…
John Skiles Skinner
  • 1,611
  • 1
  • 8
  • 21