static files not loading only on django admin page

Multi tool usestatic files not loading only on django admin page
This is on a production server with DEBUG = False. My static files will load on the home page but not the admin page. It gives me a error 404 in the browser console. This only happens on the admin page. I've checked to make sure that the .css files are in the specified directory's and they are along with the code inside them. NOTE: The same server and file structure was working earlier. I've tried almost everything I can think of any help would be greatly appreciated!
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATIC_ROOT = '/home/django/django_project/django_project/static/'
STATIC_URL = '/static/'
collectstatic
settings.py
1 Answer
1
I finally figured it out. I set the /static
in nginx config for django but not the path for /static/admin
. Thank you everyone for you help. Happy coding.
/static
/static/admin
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
U4WnzGZ7BC3SwnjKiR9u
Popular posts from this blog
PySpark - SparkContext: Error initializing SparkContext File does not exist I have small piece code in PySpark, but I keep getting errors. I'm new to this so im not sure where to start. from pyspark import SparkContext, SparkConf conf = SparkConf().setAppName("Open json").setMaster("local[3]") sc = SparkContext(conf = conf) print("Done") I ran this in cmd with the command : spark-submit .PySparkOpen.py I then get the following error statement: C:UsersAbdullahDocumentsMaster Thesis>spark-submit .PySparkOpen.py 18/06/30 15:21:58 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-Java classes where applicable 18/06/30 15:22:01 ERROR SparkContext: Error initializing SparkContext. java.io.FileNotFoundException: File file:/C:/Users/Abdullah/Documents/Master%20Thesis/PySpark/Open.py does not exist at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:611) at...
django NoReverseMatch Exception I'm getting the following error while using hyperlink in Django. Error : django.urls.exceptions.NoReverseMatch: 'mywebapp' is not a registered namespace django.urls.exceptions.NoReverseMatch: 'mywebapp' is not a registered namespace mywebapp/template/about.html .. <body> <a href="{% url 'mywebapp:home' %}">Click here</a> Hello World!!!<p>Today is {{today}}</p> mywebapp/template/home.html .. <h4>Homepage.</h4> settings.py .. INSTALLED_APPS = [ ... 'mywebapp'#new ... ] Make sure you have app_name='home' in your mywebapp/urls.py . If that doesn’t solve the problem, then you need to show your urls.py . – Alasdair Jun 30 at 20:20 app_name='home' mywebapp/urls.py urls.py ...
Audio Livestreaming with Python & Flask I'm currently strugling with my implementation of a simple live streaming web application using Python and Flask. It seems that I'm not able to stream my live recorded audio from the servers microphone input to the webpage. server.py from flask import Flask, render_template, Response import cv2 import framework import pyaudio import audio_processing as audioRec FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 CHUNK = 1024 audio = pyaudio.PyAudio() app = Flask(__name__) @app.route('/') def index(): """Video streaming home page.""" return render_template('index.html') # Stream routing @app.route('/video_feed') def video_feed(): """Video streaming route. Put this in the src attribute of an img tag.""" return Response(generateVideo(), mimetype='multipart/x-mixed-replace; boundary=frame') @app.route("/audio...
Did you
collectstatic
?– Cole
Jul 1 at 2:26