Skip to content
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

Connection refused by localhost when trying to add a foreign key in new model #515

Closed
rust-floppy opened this issue Aug 2, 2022 · 2 comments

Comments

@rust-floppy
Copy link

I have 2 models, one has a foreign key pointing to the other model. When I press "Add item" in the first model, I can press the plus button next to the foreign key field to add another to that model, but when I click it, it says "Connection refused by localhost".

`class Currency(models.Model):
name = models.CharField(max_length=200, null=False, blank=False)

class Item(models.Model):
name = models.CharField(max_length=200, verbose_name="Megnevezés", blank=False)
curr = models.ForeignKey(Currency, max_length=50, blank=False, on_delete=models.CASCADE)
`

screenshot: https://imgur.com/a/f1AFAY1

django version: 4.0.6
jet version: newest.

@dresl
Copy link

dresl commented Sep 18, 2022

I had the same problem. Try add this to settings.py:

X_FRAME_OPTIONS = 'SAMEORIGIN'

@rust-floppy
Copy link
Author

Abandoned repo I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants