No content-type or content-type ~= '^text/html' #6

Closed
opened 2020-07-22 09:27:46 +02:00 by Ghost · 7 comments

I m getting this error, basically for any website.
I did a curl and I get the text/html output.
I m not sure if this matter but in the Generate RSS home page I read "htttp://..." not https and also to connect to server I have to use port 80. With port 8000 it does not connect.
Any advise?

ubuntu@ubuntu:~/hrss$ python3 manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
July 22, 2020 - 07:18:03
Django version 3.0.8, using settings 'hrss.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[2020-07-22 07:18:25,453] [DEBUG] [views] No content-type or content-type ~= '^text/html'
[2020-07-22 07:18:25,674] [DEBUG] [views] URL: https://www.agriculture.com

I m getting this error, basically for any website. I did a curl and I get the text/html output. I m not sure if this matter but in the Generate RSS home page I read "htttp://..." not https and also to connect to server I have to use port 80. With port 8000 it does not connect. Any advise? ubuntu@ubuntu:~/hrss$ python3 manage.py runserver Performing system checks... System check identified no issues (0 silenced). July 22, 2020 - 07:18:03 Django version 3.0.8, using settings 'hrss.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [2020-07-22 07:18:25,453] [DEBUG] [views] No content-type or content-type ~= '^text/html' [2020-07-22 07:18:25,674] [DEBUG] [views] URL: https://www.agriculture.com
Owner

Hi!
The logging message No content-type or content-type ~= ‘^text/html’ is normal behavior and does not indicate an error at all.

Your error should be fixed in 47e24b6459. Please let me know if it works for you.

You can either git checkout master && git pull or download and run https://hipstercat.fr/gogs/hipstercat/hrss/releases/tag/v0.3

Hi! The logging message `No content-type or content-type ~= ‘^text/html’` is normal behavior and does not indicate an error at all. Your error should be fixed in 47e24b64594d022d658e57d6ee856e4c856e4409. Please let me know if it works for you. You can either `git checkout master && git pull` or download and run https://hipstercat.fr/gogs/hipstercat/hrss/releases/tag/v0.3
Author

Thanks for the prompt reply.
Yes it fixed my problem but I got another one.
Basically now I can see the webiste and I can select Element, Title and Content.
When I click Generate I get: 502 Bad Gateway nginx/1.10.3.
The website I m using is https://www.agriculture.com/markets/newswire/
My installation steps w/o errors:
python 3 is installed already.
sudo pip3 install virtualenv
git clone https://hipstercat.fr/gogs/hipstercat/hrss.git
cd hrss && python3 -m virtualenv --python=python3 .
source bin/activate && pip3 install -r requirements.txt
python3 manage.py migrate
python3 manage.py runserver

and I get
ubuntu@ubuntu:~/hrss$ python3 manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
July 22, 2020 - 07:18:03
Django version 3.0.8, using settings ‘hrss.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[2020-07-22 07:18:25,453] [DEBUG] [views] No content-type or content-type ~= ‘^text/html’
[2020-07-22 07:18:25,674] [DEBUG] [views] URL: https://www.agriculture.com

I m connecting to the server from another machine using:
http://192.168.1.xxx:80
the port 8000 does not work though server started at 8000 as I ca see above.
Pls advise
Thanks a lot

Thanks for the prompt reply. Yes it fixed my problem but I got another one. Basically now I can see the webiste and I can select Element, Title and Content. When I click Generate I get: 502 Bad Gateway nginx/1.10.3. The website I m using is https://www.agriculture.com/markets/newswire/ My installation steps w/o errors: python 3 is installed already. sudo pip3 install virtualenv git clone https://hipstercat.fr/gogs/hipstercat/hrss.git cd hrss && python3 -m virtualenv --python=python3 . source bin/activate && pip3 install -r requirements.txt python3 manage.py migrate python3 manage.py runserver and I get ubuntu@ubuntu:~/hrss$ python3 manage.py runserver Performing system checks... System check identified no issues (0 silenced). July 22, 2020 - 07:18:03 Django version 3.0.8, using settings ‘hrss.settings’ Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. [2020-07-22 07:18:25,453] [DEBUG] [views] No content-type or content-type ~= ‘^text/html’ [2020-07-22 07:18:25,674] [DEBUG] [views] URL: https://www.agriculture.com I m connecting to the server from another machine using: http://192.168.1.xxx:80 the port 8000 does not work though server started at 8000 as I ca see above. Pls advise Thanks a lot
Author

ok I have some more information...
I did a new install on my raspberry where I have a local browser. I managed to browse 127.0.0.1:8000 and it worked.
I see only two problems at this point..

  1. When I select the Title and Content on the first article, the selection does not go to the other articles, so eventually my rss feed shows only 1 article/news.
  2. I m obliged to use only a local browser. If I try to work on hrss from another machine I can only connect thru port 80 and I get the 502 Bad Gateway nginx/1.10.3. error after generate selection.
    Any idea?
ok I have some more information... I did a new install on my raspberry where I have a local browser. I managed to browse 127.0.0.1:8000 and it worked. I see only two problems at this point.. 1) When I select the Title and Content on the first article, the selection does not go to the other articles, so eventually my rss feed shows only 1 article/news. 2) I m obliged to use only a local browser. If I try to work on hrss from another machine I can only connect thru port 80 and I get the 502 Bad Gateway nginx/1.10.3. error after generate selection. Any idea?
Owner
  1. This is caused by a too restrictive CSS selector. You can fix that manually by creating a superuser (which is normally optional) by running python3 manage.py createsuperuser and then navigate and log in to http://127.0.0.1:8000/admin/web/feed/. Here you will see all your configured feeds and clicking on the problematic one will allow you to fine tune the settings. Check the element property and set it to a less restrictive one (maybe your current value includes some article ID which is obviously unique).
  2. By default python3 manage.py runserver allows only local connections and isn't open on your local network. You can fix it by running python3 manage.py runserver 0.0.0.0:8080. You can also change the port number if you want to.

Keep in mind HRSS is an abandonned project and I'm not planning to fix issues unless they are very simple to fix.

1. This is caused by a too restrictive CSS selector. You can fix that manually by creating a superuser (which is normally optional) by running `python3 manage.py createsuperuser` and then navigate and log in to http://127.0.0.1:8000/admin/web/feed/. Here you will see all your configured feeds and clicking on the problematic one will allow you to fine tune the settings. Check the `element` property and set it to a less restrictive one (maybe your current value includes some article ID which is obviously unique). 2. By default `python3 manage.py runserver` allows only local connections and isn't open on your local network. You can fix it by running `python3 manage.py runserver 0.0.0.0:8080`. You can also change the port number if you want to. Keep in mind HRSS is an abandonned project and I'm not planning to fix issues unless they are very simple to fix.
Author

Thanks for your support.

  1. I will try it out
  2. after executing your command I got this from my other machine:
    DisallowedHost at /
    Invalid HTTP_HOST header: '192.168.1.99:8000'. You may need to add '192.168.1.99' to ALLOWED_HOSTS.

I checked that \hrss\hrss\settings.py has this ALLOWED_HOSTS = [] but editing as
ALLOWED_HOSTS = [192.168.1.99] did not fix the problem

File "/home/pi/hrss/hrss/settings.py", line 29
ALLOWED_HOSTS = [192.168.1.99]
^
SyntaxError: invalid syntax

Pls advise.
Thanks for your time..

Thanks for your support. 1) I will try it out 2) after executing your command I got this from my other machine: DisallowedHost at / Invalid HTTP_HOST header: '192.168.1.99:8000'. You may need to add '192.168.1.99' to ALLOWED_HOSTS. I checked that \hrss\hrss\settings.py has this ALLOWED_HOSTS = [] but editing as ALLOWED_HOSTS = [192.168.1.99] did not fix the problem File "/home/pi/hrss/hrss/settings.py", line 29 ALLOWED_HOSTS = [192.168.1.99] ^ SyntaxError: invalid syntax Pls advise. Thanks for your time..
Author

found the error
ALLOWED_HOSTS = ['192.168.1.99']

thanks.
Anyway.. I m very sorry you wont support it anymore.
I know I came late :)

found the error ALLOWED_HOSTS = ['192.168.1.99'] thanks. Anyway.. I m very sorry you wont support it anymore. I know I came late :)
Author
  1. worked fine. Eventually I understood better how to narrow the Element selection to get all the results from a few websistes I m interesting in but I must say though I m getting headache to setup correctly the https://www.agriculture.com/markets/newswire
    I deleted my original feed and I lost track of what I did first. Now for any attempt I m getting "Error: feed is empty. Did you set up 'element' field correctly?" and I m sure the Element selection is correct according to how I did the others. I m basically selecting the "element" that contains all the info of a news, that will be replicated for all the other news.
    Will keep on trying.. hope won't loose my mind :)
1) worked fine. Eventually I understood better how to narrow the Element selection to get all the results from a few websistes I m interesting in but I must say though I m getting headache to setup correctly the https://www.agriculture.com/markets/newswire I deleted my original feed and I lost track of what I did first. Now for any attempt I m getting "Error: feed is empty. Did you set up 'element' field correctly?" and I m sure the Element selection is correct according to how I did the others. I m basically selecting the "element" that contains all the info of a news, that will be replicated for all the other news. Will keep on trying.. hope won't loose my mind :)
Ghost closed this issue 2020-07-23 12:14:20 +02:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hipstercat/hrss#6
No description provided.