Home > Blockchain >  django web site URLS gets "?next=" randomly after deployed to heroku
django web site URLS gets "?next=" randomly after deployed to heroku

Time:02-11

after deploying django app on heroku the url after every form submittion or link in site been press resulting with "?next=" inserts into the URL address, i dont understand from where it comes and why heroku keep inserting them in a random way, running the application localy just working perfectly. i've deleted the application from heroku and upload it again, the fault persists. there's no http errors what so ever. if i keep submiting the form eventually will works. for example: pressing the log button in the django admin console results with this URL: https://appname.herokuapp.com/admin/login/?next=/admin/login/admin/, hitting it quite a bit will finnaly make it work with the correct url display: https://mishnayot.herokuapp.com/admin/.

  • switching from heroku postgres to AWS RDS postgres didn't help.

help will be very appreciated.

CodePudding user response:

When a user hits a page requiring authentication, they get redirected to the login URL with a ?next= indicating the page they were trying to access. This way, after they've logged in, they'll get the page they intended to access.

In your case, it seems like /admin/login/admin/ requires a login and the login is actually at /admin/login/. I'm guessing you have a bad link to /admin/login/admin/ somewhere when you intended to just have /admin/login/?

CodePudding user response:

Well, strugling for days just to understand it's heroku backend issue and there's not enough information that could help me solving it (i did try to contact heroku support directly but i'm on a free account). finnaly i decided to deploy it using elastic beanstalk. the implemntation took some time with long learning curve but now my site works and works great!

Thanks for trying to help Tim. Cheers!

  • Related