Skip to content

Instantly share code, notes, and snippets.

@skolo-online
Last active August 17, 2021 07:30
Show Gist options
  • Save skolo-online/7fe61343dff81f881bf70fd520cc1e62 to your computer and use it in GitHub Desktop.
Save skolo-online/7fe61343dff81f881bf70fd520cc1e62 to your computer and use it in GitHub Desktop.
Django Forms for Invoicing Application - forms.py
from django import forms
from django.contrib.auth.models import User
from django.forms import widgets
from .models import *
import json
class UserLoginForm(forms.ModelForm):
username = forms.CharField(
widget=forms.TextInput(attrs={'id': 'floatingInput', 'class': 'form-control mb-3'}),
required=True)
password = forms.CharField(
widget=forms.PasswordInput(attrs={'id': 'floatingPassword', 'class': 'form-control mb-3'}),
required=True)
class Meta:
model=User
fields=['username','password']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment