<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MangoOrange™ &#187; django-registration</title>
	<atom:link href="http://www.mangoorange.com/tag/django-registration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mangoorange.com</link>
	<description>Web Hosting Reviews &#38; Mac WordPress Theme</description>
	<lastBuildDate>Wed, 25 Jan 2012 18:31:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>django-registration tutorial</title>
		<link>http://www.mangoorange.com/2008/09/17/django-registration-tutorial/</link>
		<comments>http://www.mangoorange.com/2008/09/17/django-registration-tutorial/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 01:05:31 +0000</pubDate>
		<dc:creator>mangoorange</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[django-registration]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.mangoorange.com/?p=190</guid>
		<description><![CDATA[Django 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 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="http://ecx.images-amazon.com/images/I/51sBJoCpzHL.jpg" alt="Practical Django Projects" width="160" height="212" /><a title="Django Project" href="http://www.djangoproject.com" target="_blank">Django</a> has been my thing for the past few weeks. It's been a lot of fun reading the James Bennett's <a title="Practical Django Projects" href="http://www.amazon.com/Practical-Django-Projects-Pratical/dp/1590599969/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1221682241&amp;sr=8-1" target="_blank">Practical Django Projects</a>. Unfortunately, on Sept 3, the release of Django v1.0 has made many of the codes not compatible.</p>
<p>The new release of Django has given me a headache while I was trying to setup <a title="django-registration googlecode" href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fcode.google.com%2Fp%2Fdjango-registration%2F&amp;ei=qWXRSIetJoKMsAOe7ZyJBw&amp;usg=AFQjCNETsgzo4kHEbOHQxmn012kzVQHTFw&amp;sig2=LyJAIAQyVS8tJB3HHtyW3g" target="_blank">django-registration</a>. 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.</p>
<p>So I hope I can help by writing a tutorial for those who needs it. <a title="StoneMind Django-Registration tutorial" href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=3&amp;url=http%3A%2F%2Fwww.stonemind.net%2Fblog%2F2007%2F04%2F13%2Fdjango-registration-for-newbies%2F&amp;ei=qWXRSIetJoKMsAOe7ZyJBw&amp;usg=AFQjCNEDJTspoFwm_2jVAO9PoRaGk_DK_Q&amp;sig2=vDNQ7IwksJj96tqXdMoc0w" target="_blank">Stone Mind</a>, once wrote a tutorial on django-registration, but it's out-dated now.</p>
<p>Here it goes:</p>
<p><strong>Prerequisites:</strong><br />
django version 1.0<br />
django-registration version 0.6 (if possible, use the <a title="django-registration" href="http://django-registration.googlecode.com/svn/trunk/" target="_blank">trunk</a> copy)</p>
<p><strong>Step 1, unpack django-registration:</strong><br />
Put the app folder, <em>registration</em> into the project folder. (make sure that your PYTHONPATH is pointing to the project folder). <em>registration</em> folder is the folder that contains __init__.py.</p>
<p><strong>Step 2, setup the application:<br />
</strong>Add 'registration' into the list of INSTALLED_APPS. For example,</p>
<pre class="python">INSTALLED_APPS = <span style="color: black;">&#40;</span>
    <span style="color: #483d8b;">'django.contrib.auth'</span>,
    <span style="color: #483d8b;">'django.contrib.contenttypes'</span>,
    <span style="color: #483d8b;">'django.contrib.sessions'</span>,
    <span style="color: #483d8b;">'django.contrib.sites'</span>,
    <span style="color: #483d8b;">'django.contrib.admin'</span>,
    <span style="color: #483d8b;">'registration'</span>,
<span style="color: black;">&#41;</span></pre>
<p><strong>Step 3, setup the database</strong>:<br />
Run <code>python manage.py syncdb</code> 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,</p>
<pre class="python">DATABASE_ENGINE = <span style="color: #483d8b;">'sqlite3'</span>
DATABASE_NAME = <span style="color: #483d8b;">'reg.db'</span>
DATABASE_USER = <span style="color: #483d8b;">''</span>
DATABASE_PASSWORD = <span style="color: #483d8b;">''</span>
DATABASE_HOST = <span style="color: #483d8b;">''</span>
DATABASE_PORT = <span style="color: #483d8b;">''</span></pre>
<p><strong>Step 4, setup the url pointer:</strong><br />
Add <code>(r'accounts/', include('registration.urls'))</code> into the list of URLpatterns. For example,</p>
<pre class="python">urlpatterns = patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>,
    <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^admin/(.*)'</span>, admin.<span style="color: #dc143c;">site</span>.<span style="color: black;">root</span><span style="color: black;">&#41;</span>,
    <span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^accounts/'</span>, include<span style="color: black;">&#40;</span><span style="color: #483d8b;">'registration.urls'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>,
<span style="color: black;">&#41;</span></pre>
<p><strong>Step 5, setup the templates:</strong><br />
Setup the template path by adding /path/to/project/templates/ in TEMPLATE_DIRS. Example,</p>
<pre class="python">TEMPLATE_DIRS = <span style="color: black;">&#40;</span>
   <span style="color: #483d8b;">'/Users/mangoorange/Projects/Django/reg/templates/'</span>
<span style="color: black;">&#41;</span></pre>
<p><strong>Step 6, inserting the templates:<br />
</strong>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 <a title="Django Project Forms" href="http://docs.djangoproject.com/en/dev/topics/forms/#topics-forms-index" target="_blank">here</a>.</p>
<p><strong>Step 7, done:</strong><br />
Sorry to disappoint you. It's done. <img src='http://www.mangoorange.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Feel free to share any feedback and comments on the tutorial. Hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mangoorange.com/2008/09/17/django-registration-tutorial/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sending email via Gmail in Django</title>
		<link>http://www.mangoorange.com/2008/09/15/sending-email-via-gmail-in-django/</link>
		<comments>http://www.mangoorange.com/2008/09/15/sending-email-via-gmail-in-django/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 07:51:26 +0000</pubDate>
		<dc:creator>mangoorange</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[django-registration]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>

		<guid isPermaLink="false">http://www.mangoorange.com/?p=186</guid>
		<description><![CDATA[While 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 [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="http://media.djangoproject.com/img/badges/djangowish126x70.gif" alt="Django" width="126" height="70" />While I was learning how to use <a title="django-regisration" href="http://code.google.com/p/django-registration/">django-registration</a> app, I discover in the tutorial that I need to know how to send an email for the user to activate the registration.</p>
<p>Thanks to folk at the Django chatroom, they advice me to google '<strong>django gmail</strong>' and I discover a post at <a title="Nathan Ostgard" href="http://www.nathanostgard.com" target="_blank">nathanostgard.com</a> that show roughly how to do it. Here I'm going to extend a little on how to test it using shell.</p>
<ol>
<li>Create a project, <strong>django-admin.py startproject gmail</strong></li>
<li>Edit <strong>settings.py</strong> with code below:
<pre class="python">EMAIL_USE_TLS = <span style="color: #008000;">True</span>
EMAIL_HOST = <span style="color: #483d8b;">'smtp.gmail.com'</span>
EMAIL_HOST_USER = <span style="color: #483d8b;">'youremail@gmail.com'</span>
EMAIL_HOST_PASSWORD = <span style="color: #483d8b;">'yourpassword'</span>
EMAIL_PORT = <span style="color: #ff4500;">587</span></pre>
</li>
<li>Run interactive mode, <strong>python manage.py shell</strong></li>
<li>Import the EmailMessage module,<br />
<strong>from django.core.mail import EmailMessage</strong></li>
<li>Send the email,
<pre class="python"><span style="color: #dc143c;">email</span> = EmailMessage<span style="color: black;">&#40;</span><span style="color: #483d8b;">'Subject'</span>, <span style="color: #483d8b;">'Body'</span>, t=<span style="color: black;">&#91;</span><span style="color: #483d8b;">'mickeyckm@mangoorange.com'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">email</span>.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre>
</li>
</ol>
<p>Hope it help someone <img src='http://www.mangoorange.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Reference <a title="Gmail and Django" href="http://nathanostgard.com/archives/2007/7/2/gmail_and_django/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mangoorange.com/2008/09/15/sending-email-via-gmail-in-django/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

