django-ads icon indicating copy to clipboard operation
django-ads copied to clipboard

ReferenceError: Urls is not defined in ads.js

Open wanjohikibui opened this issue 5 years ago • 5 comments

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']();

wanjohikibui avatar Jun 07 '19 09:06 wanjohikibui

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.

razisayyed avatar Jul 16 '19 19:07 razisayyed

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 .

wanjohikibui avatar Jul 16 '19 21:07 wanjohikibui

We should add it as a dependency to this project, I ran into the same issue.

oesah avatar Jan 29 '20 18:01 oesah

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).

wanjohikibui avatar Jan 30 '20 09:01 wanjohikibui

Hello

I had this same problem and I solved it as follows:

  1. I Added django js reverse to INSTALED_APPS:
INSTALLED_APPS = (
    ...
    'django_js_reverse',
)
  1. Run collectstatic as instructed in django js reverse documentation ./manage.py collectstatic_js_reverse

  2. 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

MauricioVilla avatar May 15 '20 22:05 MauricioVilla