So I have just begun learning the Django framework, and I am trying to make a basic application using AJAX to load Django responses into my main ‘Content’ div. So far so good, but one issue I am having is referencing JS/CSS files. All I want is a link to one CSS file, and one JS file in my main index page.
What I am hoping to do is add a reference to style/main.css and js/main.js in my application’s urls.py script, where python would return the contents of the file. So, a standard <link src='style/main.css' ... /> tag would receive the contents of the appropriate file.
Thanks.
Read the documentation on serving static files. Essentially, you can use Django to serve these files during development, but should definitely configure your web server (e.g. Apache) to serve them directly in your production environment.