You'll need these libraries
- pip install Pillow
- pip install django-storages
- pip install boto
class UserProfile(models.Model): | |
user = models.OneToOneField(User) | |
avatar = models.ImageField(upload_to='profile_images', blank=True) | |
def __unicode__(self): | |
return self.user.username | |
class RegistrationForm(forms.Form): |
You'll need these libraries
#!/bin/bash | |
createuser -d -A -P $DB_USER | |
createdb -U $DB_USER -E utf8 -O $DB_USER $DB_NAME -T template0 |
I hereby claim:
To claim this, I am signing this object:
Working though some stuff with shell plus I had a multi-line function that I needed to debug. I came across %cpaste
which is a handy magic function exposing the capability to be able to drop a block of code into ipython
or shellPlus
.
from django.core.mail import EmailMessage | |
email = EmailMessage( | |
# subject='', | |
# body='', | |
from_email='[email protected]', | |
to=['[email protected]', '[email protected]'], | |
bcc=['[email protected]'], | |
headers={ | |
'X-MC-Template': 'template-slug', |
Field conversion using the django rest framework
has not been overly intuitive. This might help
Also see this example from the documentation.
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |