I am deciding whether to use rails or django for a smallish web app.
One of the features I love in rails is that you can render .js.erb files, and then serve them to the client as a response, and the browser will execute the script
Is there something equivalent in django? If I change the mime type of a response to text/script will the browser realize it’s a script and run it? Also, can I render scripts using the django template language like rails does with erb? Thanks.
You may render js files in Django by treating them as normal ‘Django Templates’ and using appropriate MIME type in order for browser to detect the files correctly.