django-ads
django-ads copied to clipboard
ReferenceError: Urls is not defined in ads.js
Been trying to solve this issue for some hours without success. I getting an error at Line 7 in ads.js file. The Urls is undefined. What could be the workaround here?
var url = Urls['ads:ad-impression']();
Sorry for latency in replying to this issue. I was busy in the previous period.
You need to install django-js-reverse to solve this issue.
pip install django-js-reverse
please refere to django-js-reverse github homepage for installation instructions. https://github.com/ierror/django-js-reverse
I will update the documenation and package requirements soon to solve this.
Hello Razi, Thanks for your reply. Will check it out. Thanks
Kind Regards,
WANJOHI KIBUI GIS Consultant - Developer and Trainer
Mobile: +254 719 696921 *Website: *
w http://www.lifeingis.com/ww.lifeingis.com http://www.lifeingis.com/w http://www.lifeingis.com/ww.geosymp.com http://www.geosymp.com/ *Knowing is not enough, we must apply. *Being willing is not enough, we must do.
On Tue, Jul 16, 2019 at 10:20 PM Razi Alsayyed [email protected] wrote:
Sorry for latency in replying to this issue. I was busy in the previous period.
You need to install django-js-reverse to solve this issue.
pip install django-js-reverse
please refere to django-js-reverse github homepage for installation instructions. https://github.com/ierror/django-js-reverse
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/razisayyed/django-ads/issues/13?email_source=notifications&email_token=ABF6DF2LDGCPG6NXRS7524TP7YNO3A5CNFSM4HVUE7SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2B34SY#issuecomment-511950411, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF6DF45QBPQYAPJVOIJXGDP7YNO3ANCNFSM4HVUE7SA .
We should add it as a dependency to this project, I ran into the same issue.
Sure. As one changes versions, it becomes an issues
Wanjohi KIbui Kind Regards
+254 719 6969 921 (tel:+254%20719%206969%20921) https://www.lifeingis.com (https://link.getmailspring.com/link/[email protected]/0?redirect=https%3A%2F%2Fwww.lifeingis.com&recipient=cmVwbHkrQUJGNkRGNjZKUFc3NElHRDRRR0UzWU40SDRDRDNFVkJOSEhCV0JVR1NZQHJlcGx5LmdpdGh1Yi5jb20%3D)
On Jan 29 2020, at 9:41 pm, Özer S. [email protected] wrote:
We should add it as a dependency to this project, I ran into the same issue.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/[email protected]/1?redirect=https%3A%2F%2Fgithub.com%2Frazisayyed%2Fdjango-ads%2Fissues%2F13%3Femail_source%3Dnotifications%26email_token%3DABF6DF5IFLH3KA6QFI6L4EDRAHET3A5CNFSM4HVUE7SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKIJGDY%23issuecomment-579900175&recipient=cmVwbHkrQUJGNkRGNjZKUFc3NElHRDRRR0UzWU40SDRDRDNFVkJOSEhCV0JVR1NZQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe (https://link.getmailspring.com/link/[email protected]/2?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABF6DF4DZBJHBIUDPFWIZRLRAHET3ANCNFSM4HVUE7SA&recipient=cmVwbHkrQUJGNkRGNjZKUFc3NElHRDRRR0UzWU40SDRDRDNFVkJOSEhCV0JVR1NZQHJlcGx5LmdpdGh1Yi5jb20%3D).
Hello
I had this same problem and I solved it as follows:
- I Added django js reverse to INSTALED_APPS:
INSTALLED_APPS = (
...
'django_js_reverse',
)
-
Run collectstatic as instructed in django js reverse documentation
./manage.py collectstatic_js_reverse
-
In the template I want to render the ads, load the django js reverse tags
{% load ads_tags %}
{% load js_reverse %}
<script type="text/javascript" charset="utf-8">
{% js_reverse_inline %}
</script>
{% render_ads_zone 'content' %}
P.S. I did not have to install django js reverse since in version 1.1.0 it was added as a dependency to the project