openchatai / OpenChat

LLMs custom-chatbots console ⚡
https://open.cx
MIT License
5.2k stars 640 forks source link

dj backend csfr error #212

Closed JuergenCornely closed 11 months ago

JuergenCornely commented 11 months ago

I try to use the new django. I got it installed, but when i try to conect i got a CSRF verification error from Django.. any hints for me

codebanesr commented 11 months ago

You should add the origin in settings.py file

On Fri, Dec 8, 2023, 17:54 JuergenCornely @.***> wrote:

I try to use the new django. I got it installed, but when i try to conect i got a CSRF verification error from Django.. any hints for me

— Reply to this email directly, view it on GitHub https://github.com/openchatai/OpenChat/issues/212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5ZGSWEH7WLBAVNNN2DEDYIMBJLAVCNFSM6AAAAABAMSSGAWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTENJWG4YDINQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JuergenCornely commented 11 months ago

Thanks a lot ill try it..

JuergenCornely commented 11 months ago

By the way it is listening on port 8001?

codebanesr commented 11 months ago

If allowed hosts is not defined in .env, it should be listening on 0.0.0.0:8000 by default

On Fri, Dec 8, 2023, 18:13 JuergenCornely @.***> wrote:

By the way it is listening on port 8001?

— Reply to this email directly, view it on GitHub https://github.com/openchatai/OpenChat/issues/212#issuecomment-1847104900, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5ZGRZJY23ULDT53HIVL3YIMDOHAVCNFSM6AAAAABAMSSGAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBXGEYDIOJQGA . You are receiving this because you commented.Message ID: @.***>

JuergenCornely commented 11 months ago

i thought so, but the web container is mapping 8001 to 8000.. I ve loaded the latest Version.. But its the same

codebanesr commented 11 months ago

Please update .env with the following and restart your containers

ALLOWED_HOSTS=localhost,0.0.0.0
APP_URL=http://0.0.0.0:8000

then navigate to http://0.0.0.0:8001/login

Default admin user user - admin password - admin_password

Please consider updating the readme.md if it fixes your problem

JuergenCornely commented 11 months ago

Same problem, i get the login Page. After pressing the login button i got the CSFR verification failed

JuergenCornely commented 11 months ago

in my envoirment the makefile at the force_migrate section goes to the docker Container web. But the installtion makes a container oc_web.. hope this can help

lvalics commented 11 months ago

Temporarelly you can bypass in settings.py

'django.middleware.csrf.CsrfViewMiddleware',

lvalics commented 11 months ago

Can you check now please? Get the latest release.

JuergenCornely commented 11 months ago

It works, thanks a lot...