Re: Invalid HTTP_HOST header when website being accessed by public IP

2018-07-01 Thread Tomasz Knapik
I don't think that's wise to set allowed hosts to a host you don't want your application to be accessed by. Django documentation shows you how you can mute the errors - https://docs.djangoproject.com/en/2.0/topics/logging/#django-security. It's not technically an error of your application. 'h

Re: limit the instances created by the current logged in user where the user is a foreign key in the model.

2018-07-01 Thread Tomasz Knapik
You probably have to validate it yourself. You probably should do this at the form level. I don't think there's a smart way to do that in Django. 1. Pass user into the form's __init__. 2. Check the number of user's feedback in the form's clean() method and raise ValidationError if user has lef

Re: Database

2018-07-01 Thread Tomasz Knapik
Django has support for Postgres-only features - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/ - if you need any of them. Also full text search is much easier to implement with Postgres in Django - https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/search/ Also I am not s

Re: Pass value from view to non-model form

2018-06-23 Thread Tomasz Knapik
You get that error because you use kwargs.pop (presumably that's why) and you pass OTHER_VALUE as a positional argument. E.g. MY_FORM(request.POST, OTHER_VALUE=OTHER_VALUE) would pass it as a keyword argument and then you can use kwargs.pop('OTHER_VALUE') in the form's init. On Fri, 2018-06-22

Re: Django Postgres Intermediary doesn't set ON DELETE CASCADE

2018-06-23 Thread Tomasz Knapik
If you search about it on the Internet many sources claim that Django does not set those constraints on the database level. If you look at the code of the base code for database backends, you'll notice that they don't mention on_delete at all. - https://github.com/d jango/django/blob/6dd4edb1b4f54