-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error "No Newsletter matches the given query." depending on site setting of newsletter #354
Comments
Here is an update: I have the same behavior on the server, with having the website name setted as "site", any hint would be really great .. Error: No Newsletter matches the given query. |
Are you accessing
"Hiding" issue in a P.S. is not not a good idea as it might be overlooked or lead to confusion in the discussion. If this is a problem for you and you can't find a solution then please open another issue. |
The Are you doing anything special otherwise? Is this a "clean" project or are you trying to add it to an existing site (where other apps are active that might have an impact)? |
@freenkie thanks for the reply, you are absolutly right about the thing in the P.S. ... anyway this is no issue here I included the form described here: https://django-newsletter.readthedocs.io/en/latest/usage.html#embed-a-sign-up-form-within-any-page And when a page-vistor uses this form for a sign up (using double opt in) then the error above appears. The errors appears regardless if I am logged in as admin or not. I just tried again with 127.0.0.1:8000 as "site" for the newsletter "test3", still not working, and still working when I choose example.com as "site" for the newsletter "test3" (setting in the admin interface) Any hints how I can find out the issue are appreciated. Yes this is a clean project |
The "Site" field is a multi select list. You need to select all sites for which you want the newsletter to be active. If only example.com is selected, then only example.com works. If you want others (e.g. localhost) to work the you need to select them too and save. |
Yes I know, I just tried to say that the newsletter signup works perfectly when I choose "example.com" (really the value example.com like in the pre-settings) But it is not working on server (having the realswebsite as "site" or "127.0.0.1:8000" when developing on localhost. --> Means the newsletter sign up is working, the error is maybe caused by some missing "wildcard" when I choose 127.0.0.1:8000 instead of "example.com". When email sign up is working (using example.com as site) then it is working and I am directed to http://127.0.0.1:8000/newsletter/test3/subscribe/email-sent/ (which works) When email sign up is not working (using 127.0.0.1:8000 as site) then the error apears http://127.0.0.1:8000/newsletter/test3/subscribe/ is not available. So I assume there is some setting wrong to allow some kind of wildcard.. |
What do you mean by wildcard? Can you again post the exact settings and URL of the case that you are trying and that fails? |
Really just a minum example check settings below ... many thanks for helping .. Also I dont want to waste your time, a minimum working example with the sign up form would maybe help me enough ... To get the minimum example working I also needed to add SITE_ID = 1 to the settings, I wonder if this causes these errors. But running the Server is not possible without that ( but no hint in the docs about that)... Here is settings.py:
|
I suggest to take #357 into a preconfigured venv and test it for a while. I am pretty sure the pitfall is the SITE_ID in settings.py which breaks multiple configured sites via the admin panel. It causes pain for a long time. |
Up I've just encountered this problem , it was working fine with SQLite but when i migrated to PostgreSQL i started having this issue. I don't find any explanation of how it happens. update : fixed it by manually changing the id of the site to 1 (it was 3) using pgAdmin4. |
HI,
I found your app, which is really amazing.
Anyway I am reading the docs for 2 days and cant find an answer.
I installed everything like in the docs (I am using django 3.1.3 ; django-newsletter 0.9.1; python 3.8.5)
Newsletter sign up works when I set "example.com" site for the newsletter "test3":
[06/Dec/2020 19:32:22] "GET / HTTP/1.1" 200 11928
[06/Dec/2020 19:32:28] "POST /newsletter/test3/subscribe/ HTTP/1.1" 302 0
[06/Dec/2020 19:32:28] "GET /newsletter/test3/subscribe/email-sent/ HTTP/1.1" 200 469
But If I set the localhost "http://127.0.0.1:8000/" as site for the newsletter "test3" then nothing works
Not Found: /newsletter/test3/subscribe/
[06/Dec/2020 19:38:45] "POST /newsletter/test3/subscribe/ HTTP/1.1" 404 1787
Error-page:
Page not found (404)
Request Method: POST
Request URL: http://127.0.0.1:8000/newsletter/test3/subscribe/
Raised by: newsletter.views.SubscribeRequestView
No Newsletter matches the given query.
Any clue? Thanks a lot
Below again the setting as picture, newsletter sign up working or not depending on "site" setting
P.S.: another "issue" I have is copying the ‘stub’-templates to the project_dir does not change a thing, there are still the templates from the package linked
The text was updated successfully, but these errors were encountered: