Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I have an error during the session, code 400, message Bad request version ('׫')

Let’s me explain that. Few days ago I installed a django app with docker, I had no problem with that, and later I tried to add a security for settings.py and now I have an error

code 400, message Bad request version ('׫') 
You're accessing the development server over HTTPS, but it only supports HTTP.

and now when I start creating new app I have a same error but I did not add security for new app

So my files

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

db.sqlite3 manage.py requirements.txt  src  venv

I am using django 4.0 with psycopg 2.9.3

Next, when I am going to run a server

python manage.py runserver 

I have seen that

Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 18 unapplied migration(s). Your project may not work properly until you 
apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
March 27, 2023 - 09:17:44
Django version 4.0, using settings 'src.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

When I log in to the server http://127.0.0.1:8000/

I see on browser this https://localhost:8000/

and a same error code 400

Shoud i delete a docker?

Thanks a lot!

>Solution :

Looks like you are accessing https://localhost:8000/ while you should be accessing http://localhost:8000/. Note: it should be http and not https.


Also, if the security features you added are https related, then maybe you have problems with the settings.

To fix the HTTPS error, you should check your settings.py file and make sure that the SECURE_SSL_REDIRECT setting is set to False. Also, make sure that your Docker container is set up to use HTTP on port 8000.

If the error keeps happening, you might want to rebuild your Docker container with the correct settings.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading