This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
from django import forms | |
from models import User | |
class PasswordField(forms.CharField): | |
def __init__(self): | |
super(PasswordField, self).__init__(widget=forms.PasswordInput) | |
class LoginForm(forms.Form): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#views.py | |
from django.views.generic import UpdateView | |
class UpdateBook(UpdateView): | |
model = Book | |
form_class = BookForm | |
template_name = 'create_form.html' | |
success_url = '/books/' |