Tuesday, January 22, 2013

Designing Django, PHP and HTML Compatible

You may want to design a web site and sell or distribute it. Headers, navigation bars and footers of the pages will be the same for most of the pages. So you may want to re-use these fragments in each page so that when you make a change in the design, it's reflected in all of those pages. Template engines come in handy in these cases. I've been using Django for my projects. Django uses template engine similar to jinja2.

But when I wanted to create a static site, I used Hyde to compile the fragments into complete html files. But this required re-compilation of all the project whenever you make a change in one single file. Perhaps compiling only the changed is possible with some kind of console arguments. Then I thought that'd be nice if there were a hyde server like django development server which recognizes which file has changed and only compiles it and serves it on HTTP. Then I found Hyde web server. I was really excited. Then I thought if I wanted to use this design on a PHP-supporting server, what would I do? I found Twig for this purpose. Wonderful! These are excellent resources for a web designer.

Inmotion Hosting is excellent

I have been using Inmotion hosting for one year and have been very satisfied with their high quality service (speed, robustness, features, unlimited space) and fast, friendly and polite support staff. Their network access is very fast and I haven't noticed any downtime. I'd recommend inmotion for whoever wants a robust and fast hosting for PHP. Yes, it's a bit expensive for a simple web site but for high-performance sites, it's a good candidate. Another drawback is that they didn't notice that my hosting is about to expire and renewed my hosting automatically. I wish I had been noticed that. Since my site hosted there was a simple static site, I was going to move it to another cheaper solution. When I applied for cancellation they were really polite and helpful. They canceled my account with no problems and gave a refund. After the cancellation form sent, they showed me a list of alternative hosting providers. I admired that!. So I wanted to write this blog entry to show my satisfaction.

Monday, January 14, 2013

Using Sendgrid on Heroku with Django

If you'd like to send emails easily within your Django application on Heroku, you may use Sendgrid.Here are the steps: 1) Activate Sendgrid: heroku addons:add sendgrid:starter. 2) Your credentials will be listed when you type "heroku config" in SENDGRID_PASSWORD and SENDGRID_USERNAME sections. 2) Do the following configurations: heroku config:add EMAIL_HOST='smtp.sendgrid.net' heroku config:add EMAIL_HOST_USER='username_provided_above' heroku config:add EMAIL_HOST_PASSWORD='password_provided_above' and set DEFAULT_FROM_EMAIL as something like 'info@yoursite.com'. These can be done in either in settings.py or as heroku config (like above). These should be sufficient for email sending.