Srini's Point of View

My thoughts on technology, food and other fancies…

Send Email In Python Bugfix

I have been using this python function for a while to send html emails from within my python scripts -

def sendhtmlemail(emailbody, subject):
    """ Send html email with given subject and body """
    fromaddr = readconfig(EMAIL_FROM)
    toaddr = readconfig(EMAIL_TO)

    msg = MIMEMultipart('alternative')
    msg['From'] = fromaddr
    msg['To'] = toaddr
    msg['Subject'] = subject

    body …

Where is the sqlite file for my Flask app

I am really enjoying working with the Python Flask Web Framework. I won a O’Reilly book last year on Flask Web Development by Miguel Grinberg and am finally getting around to reading it and trying out what the book teaches. So far it’s been excellent!

From the start …

Installing homebrew MacVim with YouCompleteMe on Yosemite

I was pulling my hair to get my vim setup with YouCompleteMe on my macbook after I upgraded to Yosemite. On Mavericks it was pretty straight forward. The following used to work -

# install xcode and command line tools  
$ xcode-select --install  
# install homebrew  
$ ruby -e "$(curl -fsSL …

How to pip install python packages offline

You may wonder why would you even need to do that.. Well in my case, I was using virtualenv for a project I was working on and when it came time to install the needed python packages, I realized I was on a train with no internet connection. I had …

How to Reset Django’s admin password

I was working on a django application and because of getting busy at work and home, the project took a backseat. After getting back to the project, I realized I don’t remember what was the username/password I used to create the admin account.

Here is what I did …