Search code examples
javascriptcssdjangojquery-pluginsrateyo

How to add RateYo to Django project


I plan on using the RateYo jQuery plugin within my Django project but there are a variety of parts I plan on changing and therefore I would like to have all the files directly within my project (unless I can easily modify RateYo options with CDNjs imports)

The official RateYo website shows a variety of methods of implementation but with a Django project structure, I'm not quite sure how to adapt the installation guide.

I have the following project architecture:

PWEB
 |--> exchange
 |      |--> __pycache__
 |      |--> migrations
 |      |--> static
 |      |      |--> exchange
 |      |      |      |--> assets
 |      |      |      |      |--> css
 |      |      |      |      |     |--> *.css
 |      |      |      |      |--> fonts
 |      |      |      |      |--> js
 |      |      |      |      |     |--> ..., jquery.min.js, jquery2.min.js, ...
 |      |      |      |      |--> sass
 |      |      |      |--> images
 |      |--> templates
 |      |      |--> exchange
 |      |      |      |--> *.html
 |      |--> *.py
 |--> PWEB
 |      |--> __pycache__
 |      |--> *.py
 |--> manage.py
 |--> *.*

As you can see, I already have a jquery.min.js file in my project (even a second one). Should I add the file within the RateYo zip archive as jquery3.min.js and watch out what file I use since I'll have 3?

I'm a little lost of where all the files should go to not break what I already have.

The files contained in the RateYo.zip are index.html, jquery.min.js, jquery.rateyo.css, jquery.rateyo.js, jquery.rateyo.less, jquery.rateyo.min.css, jquery.rateyo.min.css.map, jquery.rateyo.min.js, jquery.rateyo.min.js.map


Solution

  • It appears the best solution for this installation would be to place all of these files in your JS folder (if you don't have one, make one) and then reference those files in your HTML file or whatever "index" file you have (as well as any other page where you use jQuery plus the plugin.