jazzband / django-newsletter

An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
GNU Affero General Public License v3.0
846 stars 204 forks source link

Embed A Sign-up Form Within Any Page problem #380

Open EchChou opened 2 years ago

EchChou commented 2 years ago

Hello, I am trying to use the newsletter form in my index view. I included the form balize to my template as recommended in the readthedocs of the django-newsletter package:

{% csrf_token %}

I replaced the [NAME-OF-NEWSLETTER] with a newsletter name that I have added from the admin page.

but I got the next error:

Page not found (404) No Newsletter matches the given query. Request Method: POST Request URL: http://127.0.0.1:8000/newsletter/welcomeback/subscribe/ Raised by: newsletter.views.SubscribeRequestView

Using the URLconf defined in website.urls, Django tried these URL patterns, in this order:

admin/ newsletter/ ^$ [name='newsletter_list'] newsletter/ ^(?P[\w-]+)/$ [name='newsletter_detail'] newsletter/ ^(?P[\w-]+)/subscribe/$ [name='newsletter_subscribe_request'] The current path, newsletter/welcomeback/subscribe/, matched the last one.

Can you please include an example of how to use newsletter forms ?

ekerstein commented 2 years ago

Did you confirm that "welcomeback" is the same slug from the admin page when you added the newsletter? Not "welcome-back"?