<?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>django &#8211; James Lin&#039;s Blog</title>
	<atom:link href="https://james.lin.net.nz/tag/django/feed/" rel="self" type="application/rss+xml" />
	<link>https://james.lin.net.nz</link>
	<description>Just bits and pieces of my life</description>
	<lastBuildDate>Fri, 19 Jan 2018 22:42:50 +0000</lastBuildDate>
	<language>en-NZ</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.2</generator>
<site xmlns="com-wordpress:feed-additions:1">22801464</site>	<item>
		<title>DRY recipe on Django pagination template</title>
		<link>https://james.lin.net.nz/2016/07/01/dry-recipe-on-django-pagination-template/</link>
		<comments>https://james.lin.net.nz/2016/07/01/dry-recipe-on-django-pagination-template/#respond</comments>
		<pubDate>Thu, 30 Jun 2016 21:11:16 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3797</guid>
		<description><![CDATA[Here is a quick recipe for Django templates, let&#8217;s say you are building a Django web which has many list views, and which has pagination, it&#8217;s wise to abstract the pagination template out to be reusable by all list view templates. My preference is to keep all reusable templates in a partials folder, and place the… <span class="read-more"><a href="https://james.lin.net.nz/2016/07/01/dry-recipe-on-django-pagination-template/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Here is a quick recipe for Django templates, let&#8217;s say you are building a Django web which has many list views, and which has pagination, it&#8217;s wise to abstract the pagination template out to be reusable by all list view templates.</p>
<p>My preference is to keep all reusable templates in a <code>partials</code> folder, and place the pagination template in there.</p><pre class="crayon-plain-tag">{% if is_paginated %}
&lt;nav&gt;
    &lt;ul class="pagination"&gt;
    {% for page_num in paginator.page_range %}
        {% if page_num == page_obj.number %}
          &lt;li class="active"&gt;&lt;a href="#"&gt;{{ page_num }}&lt;/a&gt;&lt;/li&gt;
        {% else %}
        &lt;li&gt;&lt;a href="{% url urlname page_num %}?{{ request.GET.urlencode }}"&gt;{{ page_num }}&lt;/a&gt;&lt;/li&gt;
        {% endif %}
    {% endfor %}
    &lt;/ul&gt;
&lt;/nav&gt;
{% endif %}</pre><p>The pagination template is switched by the <code>ListView</code> populated context var <code>is_paginated, also</code> makes use of <code>urlname</code> variable to construct the page links.</p>
<p>Then in each list view template to include the pagination:</p><pre class="crayon-plain-tag">{% include 'partials/pagination.html' with urlname='quick-admin:listing-job-list' %}</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2016/07/01/dry-recipe-on-django-pagination-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3797</post-id>	</item>
		<item>
		<title>Django Rest Framework QuerySet</title>
		<link>https://james.lin.net.nz/2016/06/24/django-rest-framework-queryset/</link>
		<comments>https://james.lin.net.nz/2016/06/24/django-rest-framework-queryset/#respond</comments>
		<pubDate>Thu, 23 Jun 2016 22:42:24 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3794</guid>
		<description><![CDATA[I have just created this python library so that you can query the remote api just like the Django queryset. It is particularly usefully when used in Django ListView with pagination. https://github.com/variable/django-rest-framework-queryset ]]></description>
				<content:encoded><![CDATA[<p>I have just created this python library so that you can query the remote api just like the Django queryset. It is particularly usefully when used in Django ListView with pagination.</p>
<p><a href="https://github.com/variable/django-rest-framework-queryset">https://github.com/variable/django-rest-framework-queryset </a></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2016/06/24/django-rest-framework-queryset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3794</post-id>	</item>
		<item>
		<title>Make sure you are closing the DB connections after accessing Django ORM in your threads</title>
		<link>https://james.lin.net.nz/2016/04/22/make-sure-you-are-closing-the-db-connections-after-accessing-django-orm-in-your-threads/</link>
		<comments>https://james.lin.net.nz/2016/04/22/make-sure-you-are-closing-the-db-connections-after-accessing-django-orm-in-your-threads/#respond</comments>
		<pubDate>Thu, 21 Apr 2016 21:07:47 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[threads]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3778</guid>
		<description><![CDATA[I was writing a service which import various feeds and then post to another RESTful API, simple enough as below: [crayon-5a6644b4ac281567211101/] Then the feed model: [crayon-5a6644b4ac296451314013/] Then run this feed in trivial code: [crayon-5a6644b4ac2a3795684915/] And you will quickly notice the threads complaining [crayon-5a6644b4ac2af700498557/] What it&#8217;s happening is Django will create a new connection per thread… <span class="read-more"><a href="https://james.lin.net.nz/2016/04/22/make-sure-you-are-closing-the-db-connections-after-accessing-django-orm-in-your-threads/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>I was writing a service which import various feeds and then post to another RESTful API, simple enough as below:</p><pre class="crayon-plain-tag">from django.db import connections
class Receiver(PolymorphicModel):
    ...

class Database(Receiver):
    name = models.CharField(max_length=255)
    def get_data_source(self):
        return connections[name]</pre><p>Then the feed model:</p><pre class="crayon-plain-tag">class Feed(models.Model):
    receiver = models.ForeignKey('Receiver')

    def get_data_source(self):
        return self.receiver.get_real_instance().get_data_source()</pre><p>Then run this feed in trivial code:</p><pre class="crayon-plain-tag">import threading

function transform_listing(feed):
    cursor = feed.get_data_source().cursor()
    ....

feed = Feed.objects.create(receiver=Database.objects.create(name='legacy'))

for i in range(100):
    th = threading.Thread(transform_listing, [feed])
    th.start()</pre><p></p>
<p>And you will quickly notice the threads complaining </p><pre class="crayon-plain-tag">Too many connections</pre><p></p>
<p>What it&#8217;s happening is Django will create a new connection per thread when you access the ORM, and connections are left open even the threads are terminated, in this case the culprit is</p><pre class="crayon-plain-tag">def get_data_source(self):
        return self.receiver.get_real_instance().get_data_source()</pre><p></p>
<p>So in this case, simply refactor the code to close the connection before return:</p><pre class="crayon-plain-tag">from django.db import connection
...

    def get_data_source(self):
        result = self.receiver.get_real_instance().get_data_source()
        connection.close()
        return result</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2016/04/22/make-sure-you-are-closing-the-db-connections-after-accessing-django-orm-in-your-threads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3778</post-id>	</item>
		<item>
		<title>A very useful reference website if you use django class based views</title>
		<link>https://james.lin.net.nz/2014/10/30/a-very-useful-reference-website-if-you-use-django-class-based-views/</link>
		<comments>https://james.lin.net.nz/2014/10/30/a-very-useful-reference-website-if-you-use-django-class-based-views/#respond</comments>
		<pubDate>Wed, 29 Oct 2014 22:00:37 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3548</guid>
		<description><![CDATA[A colleague of mine mentioned this site http://ccbv.co.uk/ which provides references and information about django class based views. Classy Class-Based Views. ccbv.co.uk The best way to understand Django&#8217;s class-based views is to see it in Classy CBV, so pick your version and jump in at the deep end.]]></description>
				<content:encoded><![CDATA[<div class="user-contributed">
<p class="discussion-body">A colleague of mine mentioned this site <a href="https://www.linkedin.com/redirect?url=http%3A%2F%2Fccbv%2Eco%2Euk%2F&amp;urlhash=lxw1&amp;_t=tracking_anet" target="blank" rel="nofollow">http://ccbv.co.uk/</a> which provides references and information about django class based views.</p>
</div>
<div class="referenced-item">
<div>
<h4 class="article-title"><a href="https://www.linkedin.com/redirect?url=http%3A%2F%2Fccbv%2Eco%2Euk%2F&amp;urlhash=lxw1" target="_blank">Classy Class-Based Views.</a> <span class="content-source">ccbv.co.uk</span></h4>
</div>
<p class="article-summary">The best way to understand Django&#8217;s class-based views is to see it in Classy CBV, so pick your version and jump in at the deep end.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2014/10/30/a-very-useful-reference-website-if-you-use-django-class-based-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3548</post-id>	</item>
		<item>
		<title>Django should have OneToManyField</title>
		<link>https://james.lin.net.nz/2014/09/17/django-should-have-onetomanyfield/</link>
		<comments>https://james.lin.net.nz/2014/09/17/django-should-have-onetomanyfield/#comments</comments>
		<pubDate>Wed, 17 Sep 2014 02:07:08 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[onetomany]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3537</guid>
		<description><![CDATA[A bit of background here about ForeignKey (many to one): If you have Order and OrderItem models, your order FK is in OrderItem model, from OrderItem model point of view, it&#8217;s Many OrderItem to One Order, in other words ManyToOne. What this implies is you need to have Order records before OrderItem records. Now, why… <span class="read-more"><a href="https://james.lin.net.nz/2014/09/17/django-should-have-onetomanyfield/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><strong>A bit of background here about ForeignKey (many to one):</strong></p>
<p>If you have Order and OrderItem models, your order FK is in OrderItem model, from OrderItem model point of view, it&#8217;s Many OrderItem to One Order, in other words ManyToOne. What this implies is you need to have Order records before OrderItem records.</p>
<p><strong>Now, why we need one to many:</strong></p>
<p>What if you have 2 different apps, say Settlement and Payment, which a payment can have multiple settlements, but settlements can only belong to one payment. Logically Payment app is built on top of Settlement app, in other words Settlement app doesn&#8217;t need to know about Payment app. But to make the constraint to work, you need to put the Payment foreignkey into the Settlement model (surely this makes sense in DB schema, but not in programming domain), which now Settlement app is required to know about the Payment app.</p>
<p>Not only the dependency is reversed, now you need to have payment record created before settlement record, WTF? Oh certainly you have the payment FK set to nullable, but then you will have an extra step to set the relationship.</p>
<p>Luckily there is a <a title="onetomany" href="https://github.com/adsworth/django-onetomany" target="_blank">3rd party package</a> that kind of solve this problem through ManyToMany relationship by adding unique constraint on the right hand column, but unluckily if you ever want to roll back to the normal ManyToManyField, the migration doesn&#8217;t remove the additional constraints that introduced by this package. See <a href="https://code.djangoproject.com/ticket/23498" target="_blank">django ticket</a>.</p>
<p>For relevant information:</p>
<p><a title="http://stackoverflow.com/questions/25635408/django-one-to-many-field-without-reversing-dependency" href="http://stackoverflow.com/questions/25635408/django-one-to-many-field-without-reversing-dependency" target="_blank">http://stackoverflow.com/questions/25635408/django-one-to-many-field-without-reversing-dependency</a></p>
<p><a title="http://blog.amir.rachum.com/blog/2013/06/15/a-case-for-a-onetomany-relationship-in-django/" href="http://blog.amir.rachum.com/blog/2013/06/15/a-case-for-a-onetomany-relationship-in-django/" target="_blank">http://blog.amir.rachum.com/blog/2013/06/15/a-case-for-a-onetomany-relationship-in-django/</a></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2014/09/17/django-should-have-onetomanyfield/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3537</post-id>	</item>
		<item>
		<title>django-rest-framework: api versioning</title>
		<link>https://james.lin.net.nz/2014/02/18/django-rest-framework-api-versioning/</link>
		<comments>https://james.lin.net.nz/2014/02/18/django-rest-framework-api-versioning/#comments</comments>
		<pubDate>Tue, 18 Feb 2014 00:39:10 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django-rest-framework]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3485</guid>
		<description><![CDATA[Django Rest Framework is a very solid api framework, but it doesn&#8217;t provide out-of-box versioning mechanism, here is my attempt to implement version specific APIs. The goal is to achieve something like http://localhost:8000/api/(resource)/ http://localhost:8000/api/v1/(resource)/ plus allowing clients to specify the version in request header (X-Version), here is how we did it. Structure in side the… <span class="read-more"><a href="https://james.lin.net.nz/2014/02/18/django-rest-framework-api-versioning/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Django Rest Framework is a very solid api framework, but it doesn&#8217;t provide out-of-box versioning mechanism, here is my attempt to implement version specific APIs.</p>
<p>The goal is to achieve something like</p>
<p><code><br />
http://localhost:8000/api/(resource)/<br />
http://localhost:8000/api/v1/(resource)/<br />
</code></p>
<p>plus allowing clients to specify the version in request header (X-Version), here is how we did it.</p>
<p><strong>Structure in side the API app:</strong></p>
<p><code><br />
├── __init__.py<br />
├── middlewares.py<br />
├── urls.py<br />
├── v1<br />
│   ├── __init__.py<br />
│   ├── account<br />
│   │   ├── __init__.py<br />
│   │   ├── serializers.py<br />
│   │   └── views.py<br />
│   └── urls.py<br />
└── v2<br />
    ├── __init__.py<br />
    ├── account<br />
    │   ├── __init__.py<br />
    │   ├── serializers.py<br />
    │   └── views.py<br />
    └── urls.py<br />
</code></p>
<p><strong>project urls.py:</strong></p>
<p></p><pre class="crayon-plain-tag">url(r'^api/', include('project.api.urls', namespace='api')),</pre><p></p>
<p><strong>api app level urls.py:</strong></p>
<p></p><pre class="crayon-plain-tag">from django.conf.urls import *

urlpatterns = patterns('',
    url(r'', include('project.api.v2.urls', namespace='default')),
    url(r'^v1/', include('project.api.v1.urls', namespace='v1')),
)</pre><p></p>
<p><strong>version level urls.py</strong></p>
<p></p><pre class="crayon-plain-tag">from django.conf.urls import *
from .account import views as account_views
from rest_framework.routers import DefaultRouter

router = DefaultRouter()
router.register('account', account_views.AccountView)
router.register('myaccount', account_views.MyAccountView)
urlpatterns = router.urls</pre><p></p>
<p>create a middleware to switch to the correct code by changing the path_info, please note there is a caveat that namespace (&#8216;api&#8217;) defined in project level urls is not flexible and needs to be known in middleware:</p>
<p></p><pre class="crayon-plain-tag">from django.core.urlresolvers import resolve
from django.core.urlresolvers import reverse


class VersionSwitch(object):

def process_request(self, request):
    r = resolve(request.path_info)
    version = request.META.get('HTTP_X_VERSION', False)
    if r.namespace.startswith('api:') and version:
        old_version = r.namespace.split(':')[-1]
        request.path_info = reverse('{}:{}'.format(r.namespace.replace(old_version, version), r.url_name), args=r.args, kwargs=r.kwargs)</pre><p></p>
<p>Sample url:</p>
<p></p><pre class="crayon-plain-tag">curl -H &quot;X-Version: v1&quot; http://your.domain:8000/api/myaccount/</pre><p></p>
<p>My original <a href="http://stackoverflow.com/questions/14269719/django-rest-framework-api-versioning/21839842#21839842" title="django-rest-framework versioning" target="_blank">answer</a> on stackoverflow.</p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2014/02/18/django-rest-framework-api-versioning/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3485</post-id>	</item>
		<item>
		<title>Django CMS Haystack 2.0 Search Index</title>
		<link>https://james.lin.net.nz/2013/11/06/django-cms-haystack-2-0-search-index/</link>
		<comments>https://james.lin.net.nz/2013/11/06/django-cms-haystack-2-0-search-index/#comments</comments>
		<pubDate>Wed, 06 Nov 2013 07:13:43 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django-cms]]></category>
		<category><![CDATA[haystack]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3448</guid>
		<description><![CDATA[Currently django-cms-search doesn&#8217;t support haystack 2.0 yet, so here is my modified version to work on haystack 2.0 based on [crayon-5a6644b4ad62f925401378/]]]></description>
				<content:encoded><![CDATA[<p>Currently django-cms-search doesn&#8217;t support haystack 2.0 yet, so here is my modified version to work on haystack 2.0 based on <a href="http://django-cms.readthedocs.org/en/2.1.3/extending_cms/searchdocs.html#id1" title="django cms documentation" target="_blank"></a></p>
<p></p><pre class="crayon-plain-tag">import datetime
from haystack import indexes   
from cms.models.managers import PageManager
from cms.models.pagemodel import Page
from cms.models.pluginmodel import CMSPlugin


class PageIndex(indexes.SearchIndex, indexes.Indexable):
    text = indexes.CharField(document=True, use_template=False)
    pub_date = indexes.DateTimeField(model_attr='publication_date', null=True)
    login_required = indexes.BooleanField(model_attr='login_required')
    url = indexes.CharField(model_attr='get_absolute_url')
    title = indexes.CharField(model_attr='get_title')

    def prepare(self, obj):    
        self.prepared_data = super(PageIndex, self).prepare(obj)
        plugins = CMSPlugin.objects.filter(placeholder__in=obj.placeholders.all())
        text = ''              
        for plugin in plugins: 
            instance, _ = plugin.get_plugin_instance()
            if hasattr(instance, 'search_fields'):
                text += ''.join(getattr(instance, field) for field in instance.search_fields)
        text += obj.get_meta_description() or u''
        text += obj.get_title() or u''
        text += obj.get_meta_keywords() if hasattr(obj, 'get_meta_keywords') and obj.get_meta_keywords() else u''
        self.prepared_data['text'] = text
        return self.prepared_data       

    def get_model(self):
        return Page

    def index_queryset(self, using=None):
        return Page.objects.published().filter(publisher_is_draft=False).distinct()</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2013/11/06/django-cms-haystack-2-0-search-index/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3448</post-id>	</item>
		<item>
		<title>Django admin UnicodeEncodeError</title>
		<link>https://james.lin.net.nz/2013/06/19/django-admin-unicodeencodeerror/</link>
		<comments>https://james.lin.net.nz/2013/06/19/django-admin-unicodeencodeerror/#respond</comments>
		<pubDate>Tue, 18 Jun 2013 21:59:24 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[unicode]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=1466</guid>
		<description><![CDATA[Don&#8217;t we all get confused by unicode encoding sometimes? Especially you wouldn&#8217;t expect this kind of error to happen in django admin. The problem is actually not in the admin section, the culprit is __unicode__ method in your model. when you have a unicode function like this: [crayon-5a6644b4ae6db046364140/] It is actually returning a ASCII string(which… <span class="read-more"><a href="https://james.lin.net.nz/2013/06/19/django-admin-unicodeencodeerror/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Don&#8217;t we all get confused by unicode encoding sometimes? Especially you wouldn&#8217;t expect this kind of error to happen in django admin. The problem is actually not in the admin section, the culprit is __unicode__ method in your model.</p>
<p>when you have a unicode function like this:</p>
<p></p><pre class="crayon-plain-tag">def __unicode__(self):
  return &quot;{0}&quot;.format(self.field_one)</pre><p></p>
<p>It is actually returning a ASCII string(which means, it will try to convert field_one to ASCII), if the field_one contains characters outside of ASCII, you will get the problem as above.</p>
<p>Now consider this unicode function:</p>
<p></p><pre class="crayon-plain-tag">def __unicode__(self):
      return self.field_one</pre><p></p>
<p>This works fine, because you are returning unicode string directly, no conversion needed.</p>
<p>Lets revisit the first unicode function, to make it work, you just need to add u to make it a unicode string</p>
<p></p><pre class="crayon-plain-tag">def __unicode__(self):
      return u&quot;{0}&quot;.format(self.field_one)</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2013/06/19/django-admin-unicodeencodeerror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">1466</post-id>	</item>
		<item>
		<title>Video: Django Rapid Development Demo</title>
		<link>https://james.lin.net.nz/2013/04/10/video-django-rapid-development-demo/</link>
		<comments>https://james.lin.net.nz/2013/04/10/video-django-rapid-development-demo/#respond</comments>
		<pubDate>Wed, 10 Apr 2013 08:15:10 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=1364</guid>
		<description><![CDATA[I think it&#8217;s necessary to create a video to demonstrate how quickly web application development can be. Enjoy! //www.youtube.com/watch?v=c3C3hYbo37c]]></description>
				<content:encoded><![CDATA[<p>I think it&#8217;s necessary to create a video to demonstrate how quickly web application development can be. Enjoy!</p>
<p><a href="//www.youtube.com/watch?v=c3C3hYbo37c">//www.youtube.com/watch?v=c3C3hYbo37c</a></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2013/04/10/video-django-rapid-development-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">1364</post-id>	</item>
		<item>
		<title>Useful Django Apps &#8211; TinyMCE &#038; File Browser</title>
		<link>https://james.lin.net.nz/2013/03/04/useful-django-apps-tinymce-file-browser/</link>
		<comments>https://james.lin.net.nz/2013/03/04/useful-django-apps-tinymce-file-browser/#respond</comments>
		<pubDate>Mon, 04 Mar 2013 06:36:27 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=1348</guid>
		<description><![CDATA[TinyMCE https://code.google.com/p/django-tinymce/ Want to add WYSIWYG editor to your TextFields? This app will sort you right out, basically this app will provide a HTMLField for you to use instead of just plain TextField and it will automatically render a rich text editor for you. It does require some basic configuration, here is a sample config in… <span class="read-more"><a href="https://james.lin.net.nz/2013/03/04/useful-django-apps-tinymce-file-browser/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><strong>TinyMCE</strong><br />
<a href="https://code.google.com/p/django-tinymce/">https://code.google.com/p/django-tinymce/</a></p>
<p>Want to add WYSIWYG editor to your TextFields? This app will sort you right out, basically this app will provide a HTMLField for you to use instead of just plain TextField and it will automatically render a rich text editor for you.</p>
<p>It does require some basic configuration, here is a sample config in settings.py</p>
<p></p><pre class="crayon-plain-tag">TINYMCE_DEFAULT_CONFIG = {
    &quot;relative_urls&quot;: &quot;false&quot;,
    &quot;theme&quot;: &quot;advanced&quot;,
    &quot;theme_advanced_buttons1&quot;: &quot;formatselect,bold,italic,underline,link,unlink,bullist,undo,code,image&quot;,
    &quot;theme_advanced_buttons2&quot;: &quot;&quot;,
    &quot;theme_advanced_buttons3&quot;: &quot;&quot;,
    &quot;plugins&quot;: &quot;paste&quot;,
    &quot;height&quot;: &quot;550px&quot;,
    &quot;width&quot;: &quot;750px&quot;,
}</pre><p></p>
<p><strong>File Browser</strong></p>
<p><a href="https://github.com/wardi/django-filebrowser-no-grappelli">https://github.com/wardi/django-filebrowser-no-grappelli</a></p>
<p>TinyMCE has integration with File Browser app, but the original File Browser app requires Grappelli to be installed, what if you don&#8217;t want to have Grappelli for your admin backend but still want to have File Browser within TinyMCE? There is a fork of that comes to rescue.</p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2013/03/04/useful-django-apps-tinymce-file-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">1348</post-id>	</item>
	</channel>
</rss>
