`

Best Wordpress Hosting Providers - 2010

All three hosts offer FREE 1-click Wordpress installs making them the best Wordpress hosting providers. For more web hosting reviews be sure to check out AlreadyHosting.com.

 #1
#2 
 #3
#1 - Bluehost 
Bluehost Review
#2 - Hostmonster 
Hostmonster Review
#3 - iPage 
iPage Review

Sep 17

Practical Django ProjectsDjango has been my thing for the past few weeks. It's been a lot of fun reading the James Bennett's Practical Django Projects. Unfortunately, on Sept 3, the release of Django v1.0 has made many of the codes not compatible.

The new release of Django has given me a headache while I was trying to setup django-registration. The problem lies in the upgrading of Django to the latest build. The old Django codes cause a problem in setting the app. Thanks to the guys at the Django Channel that helped me out.

So I hope I can help by writing a tutorial for those who needs it. Stone Mind, once wrote a tutorial on django-registration, but it's out-dated now.

Here it goes:

Prerequisites:
django version 1.0
django-registration version 0.6 (if possible, use the trunk copy)

Step 1, unpack django-registration:
Put the app folder, registration into the project folder. (make sure that your PYTHONPATH is pointing to the project folder). registration folder is the folder that contains __init__.py.

Step 2, setup the application:
Add 'registration' into the list of INSTALLED_APPS. For example,

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'registration',
)

Step 3, setup the database:
Run python manage.py syncdb to populate the tables from the list of applications. Ensure you have filled in the relevant database settings before you run it. Example for sqlite3 database settings,

DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'reg.db'
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = ''

Step 4, setup the url pointer:
Add (r'accounts/', include('registration.urls')) into the list of URLpatterns. For example,

urlpatterns = patterns('',
    (r'^admin/(.*)', admin.site.root),
    (r'^accounts/', include('registration.urls')),
)

Step 5, setup the templates:
Setup the template path by adding /path/to/project/templates/ in TEMPLATE_DIRS. Example,

TEMPLATE_DIRS = (
   '/Users/mangoorange/Projects/Django/reg/templates/'
)

Step 6, inserting the templates:
This part is actually fairly simple. I have provided a copy of a working project, [download#74#nohits], that you can use. Just add in the django-registration app into the project folder. If you want to learn more about template form, you can check it out here.

Step 7, done:
Sorry to disappoint you. It's done. :)

Feel free to share any feedback and comments on the tutorial. Hope it helps.

written by mangoorange \\ tags: , ,

Sep 15

DjangoWhile I was learning how to use django-registration app, I discover in the tutorial that I need to know how to send an email for the user to activate the registration.

Thanks to folk at the Django chatroom, they advice me to google 'django gmail' and I discover a post at nathanostgard.com that show roughly how to do it. Here I'm going to extend a little on how to test it using shell.

  1. Create a project, django-admin.py startproject gmail
  2. Edit settings.py with code below:
    EMAIL_USE_TLS = True
    EMAIL_HOST = 'smtp.gmail.com'
    EMAIL_HOST_USER = 'youremail@gmail.com'
    EMAIL_HOST_PASSWORD = 'yourpassword'
    EMAIL_PORT = 587
  3. Run interactive mode, python manage.py shell
  4. Import the EmailMessage module,
    from django.core.mail import EmailMessage
  5. Send the email,
    email = EmailMessage('Subject', 'Body', t=['mickeyckm@mangoorange.com'])
    email.save()

Hope it help someone :) Reference here.

written by mangoorange \\ tags: , , ,