diff --git a/devapp/forms.py b/devapp/forms.py index c522a4a..4496900 100644 --- a/devapp/forms.py +++ b/devapp/forms.py @@ -9,6 +9,17 @@ from djing import MAC_ADDR_REGEX, IP_ADDR_REGEX class DeviceForm(forms.ModelForm): + + def __init__(self, *args, **kwargs): + """ + Move comment from value to placeholder in HTML form + """ + initial = kwargs.get('initial') + comment = initial.get('comment') + del initial['comment'] + super(DeviceForm, self).__init__(*args, **kwargs) + self.fields['comment'].widget.attrs['placeholder'] = comment + mac_addr = forms.CharField(widget=forms.TextInput(attrs={ 'pattern': MAC_ADDR_REGEX, 'required': True diff --git a/djing/local_settings.py.template b/djing/local_settings.py.template index cf26e13..dccee29 100644 --- a/djing/local_settings.py.template +++ b/djing/local_settings.py.template @@ -4,7 +4,7 @@ Custom settings for each system DEBUG = True -ALLOWED_HOSTS = ['*'] +ALLOWED_HOSTS = '*', DEFAULT_FROM_EMAIL = 'admin@yoursite.com'