Importing OrbitControls (Django)

So I'm trying to import OrbitControls, but it gives me error. Anyone know way to import it when using Django? Three is imported successfully.

code

error

I have a three folder in my statics, so in my footer.htm template I did:

{% load static %}
<script src="https://threejs.org/build/three.js"></script>
<script type="text/javascript" src="{% static 'three/OrbitControls.js' %}"> 
<script type="text/javascript" src="{% static 'three/my_three_renderer.js' %}"></script>
</script>

Then in my_three_renderer.js I did:

all my coding    
let controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.addEventListener('change', renderer);

function animate() {
  renderer.render(scene,camera);
  requestAnimationFrame(animate);
}
Back to Top