I have a django site working quite successfully with django-cms, but now I want to include some of my own javascript using jQuery. I am new to django, so my problems may arise because of this.
Django-cms uses jQuery itself, and therefore, if I add jquery to the header, things unsurprisingly break. How to add your own jQuery without affecting django-cms?
At the moment, my javascript files are stored in the root media, which I defined in the projects.py parameters, and, as already mentioned, I refer to them in the header.
As I read this, this seems like a dumb question, but I'm still perplexed.
EDIT :: Some codes
I have the media root installed:
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
and in my base template the header includes
<script src="/media/javascript/jquery.js" type="text/javascript"></script> <script src="/media/javascript/application.js" type="text/javascript"></script>
Javascript in application.js works, but when the django-cms stuff gets up, it breaks. For example, trying to add a plugin to a placeholder results in:
Uncaught TypeError: Property 'type' of object function ( selector, context ) {
I assumed that this was because the two jQuery were conflicting
:: OTHER CHANGE :: I should probably add that I use django to host static files only because it is still under development ...
jquery django django-cms
Ben griffiths
source share