I'm using Backbone and Django in a project. Initially I wanted to use Backbone views throughout the site to render my HTML content, however, there was a CRUD page that required FILE uploads and stuff so I decided to use the Django to render the site.
Now, since the form is at the url /item/article/new (http://localhost/item/article/new/), when I load up the page, it is unable to locate the requirejs dependency as stated in the config.js file. Just so that it's clear, the require.js script tag is like such:
<script src="{{ STATIC_URL }}js/libs/require/require-jquery.min.js" data-main="{{ STATIC_URL }}js/config"></script>
My config.js file:
require.config({
// Set base url for paths to reference
baseUrl: 'static/js',
// Initialize the application with the main application file.
deps: ['main'],
paths: {
jquery: 'libs/require/require-jquery.min',
...
...
}
})
Now, since my baseUrl is set to static/js, when I navigate to /item/article/new, it complains that it could not find http://localhost/item/article/new/static/js/main.js
.
What do I need to do to fix this?
Thanks in advance!