Thursday, May 24, 2012

Adding placeholders, autofocus and other attributes to Django forms

Placeholder is a short hint (a word or short phrase) intended to aid the user with data entry in forms. With HTML5, adding placeholders to forms is as simple as including a keyword: <label>Name: <input name="name" placeholder="John Doe" type="text" /></label> This would appear in the form as:   Name: To add placeholders to Django forms, simply specify...
Read More

Wednesday, May 23, 2012

Changing Django Password

Go to the directory where your settings.py resides: $ python manage.py shell >>from django.contrib.auth.models import User >> users = User.objects.all() >> users (output) [<User: foo>, <User: adminlogin>, <User: bar>] >> user = User.objects.filter(name='adminlogin') >> user.set_password('newpassword') >> user.save() This can be used to...
Read More