<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1173511580060553160</id><updated>2012-02-13T08:37:34.135-08:00</updated><title type='text'>Django talk</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default?start-index=101&amp;max-results=100'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25466</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8074991935979088962</id><published>2012-02-13T08:35:00.000-08:00</published><updated>2012-02-13T08:37:34.189-08:00</updated><title type='text'>Django setup on Win7 - can't import some things</title><content type='html'>I am trying to get started with Django and having some trouble. I&amp;#39;m&lt;br&gt;using Django 1.2 to reserve the ability to go to Google&amp;#39;s app engine&lt;br&gt;if I want. I have python 2.7 installed and working on Win7. I&lt;br&gt;unstalled Django 1.2 using the install script and it copied Django&lt;br&gt;into the site-packages directory.&lt;p&gt;I have been working through the tutorial and am just about finished.&lt;br&gt;However, in the last step, the tutorial uses generic views. When I run&lt;br&gt;it, I get &amp;quot;cannot import name DetailView&amp;quot;. The import command,&lt;br&gt;straight from the tutorial is &amp;quot;from django.views.generic import&lt;br&gt;DetailView, ListView&amp;quot;.&lt;p&gt;Early on, I could not execute django-admin.py. I had already installed&lt;br&gt;PIL and I had read about *.pth files in .../site-packages/*. So I&lt;br&gt;created a file django.pth. In it I put the single line &amp;quot;django\bin&amp;quot;.&lt;br&gt;After this, django-admin.py could be easily executed.&lt;p&gt;Do I have to add more lines to django.pth? Is there something else I&lt;br&gt;missed?&lt;p&gt;-Bob&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8074991935979088962?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8074991935979088962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-setup-on-win7-cant-import-some.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8074991935979088962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8074991935979088962'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-setup-on-win7-cant-import-some.html' title='Django setup on Win7 - can&apos;t import some things'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6042965634594373117</id><published>2012-02-13T08:34:00.002-08:00</published><updated>2012-02-13T08:35:13.687-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>On Mon, Feb 13, 2012 at 4:01 PM, Dennis Lee Bieber&lt;br&gt;&amp;lt;&lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; On Mon, 13 Feb 2012 01:50:12 -0800 (PST), Marcus Maximus&lt;br&gt;&amp;gt; &amp;lt;&lt;a href="mailto:marcus.presich@gmail.com"&gt;marcus.presich@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-&lt;br&gt;&amp;gt;&amp;gt;win32-x86-3071000\test.db&amp;#39;, &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;# Or path to database&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;Is that a typo? &amp;quot;Webseite&amp;quot; and not &amp;quot;Website&amp;quot;?&lt;br&gt;&amp;gt;&lt;p&gt;Webseite is German for web-site, so probably not.&lt;p&gt;Cheers&lt;p&gt;Tom&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6042965634594373117?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6042965634594373117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_2165.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6042965634594373117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6042965634594373117'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_2165.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7153269863305853224</id><published>2012-02-13T08:34:00.001-08:00</published><updated>2012-02-13T08:34:46.995-08:00</updated><title type='text'>Re: django-admin.py startproject doesn't work</title><content type='html'>Is &amp;quot;django-admin.py&amp;quot; file in the directory, &amp;quot;Django-1.3.1&amp;quot;??&lt;p&gt;&lt;p&gt;(If not copy or move the file from in &amp;quot;Django-1.3.1/django/bin/&amp;quot; to&lt;br&gt;&amp;quot;Django-1.3.1/&amp;quot;.)&lt;p&gt;&lt;p&gt;On 2월13일, 오후4시02분, raddy &amp;lt;&lt;a href="mailto:raddy.man...@gmail.com"&gt;raddy.man...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; I have windows7 OS and have installed Python27 and Django1.3.1&lt;br&gt;&amp;gt; I have also set the path in the environment variables to: C:&lt;br&gt;&amp;gt; \Python27\;C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib&lt;br&gt;&amp;gt; \site-packages\django\bin&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Commands like python and import django works well but&lt;br&gt;&amp;gt; when i try creating a new project I get the following error:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; C:\Python27\Django-1.3.1&amp;gt;django-admin.py startproject mysite&lt;br&gt;&amp;gt; &amp;#39;django-admin.py&amp;#39; is not recognized as an internal or external&lt;br&gt;&amp;gt; command,&lt;br&gt;&amp;gt; operable program or batch file.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; C:\Python27\Django-1.3.1&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Please help!!!&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7153269863305853224?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7153269863305853224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-adminpy-startproject-doesnt_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7153269863305853224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7153269863305853224'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-adminpy-startproject-doesnt_13.html' title='Re: django-admin.py startproject doesn&apos;t work'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4267904892959899449</id><published>2012-02-13T08:09:00.001-08:00</published><updated>2012-02-13T08:09:56.527-08:00</updated><title type='text'>Model field that links to a page ID, or external URL</title><content type='html'>Hi,&lt;p&gt;In CMS interfaces I generally encounter a problem with URL fields.&lt;br&gt;In most situations, the following options need to be supported:&lt;br&gt;- An URL to an external page  (Django&amp;#39;s URLField can handle that)&lt;br&gt;- An URL to an internal page (e.g. Django CMS)&lt;br&gt;- An URL to an other model (e.g. article)&lt;p&gt;How can I reasonably store this information in a model field?&lt;br&gt;I would love to store these values as foreign key, as it would allow more querying options.&lt;p&gt;I&amp;#39;ve written a solution for this before using a forms.MultiValueField / MultiWidget input,&lt;br&gt;which did involve the ugly hack of saving the contents as string, using the format:&lt;br&gt;- http://...external-page/&lt;br&gt;- pageid://##        -- the internal page&lt;br&gt;- articleid://##      -- link to an article.&lt;br&gt;This works, and did fit in the project deadline.&lt;br&gt;However, I would like to improve upon this.&lt;p&gt;Does anyone have a suggestion on how to store the various information properly?&lt;p&gt;Greetings,&lt;br&gt;Diederik&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4267904892959899449?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4267904892959899449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/model-field-that-links-to-page-id-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4267904892959899449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4267904892959899449'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/model-field-that-links-to-page-id-or.html' title='Model field that links to a page ID, or external URL'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6147406734900819060</id><published>2012-02-13T08:01:00.001-08:00</published><updated>2012-02-13T08:06:22.363-08:00</updated><title type='text'>Re: django-admin.py startproject doesn't work</title><content type='html'>On Sun, 12 Feb 2012 23:02:20 -0800 (PST), raddy &amp;lt;&lt;a href="mailto:raddy.mandra@gmail.com"&gt;raddy.mandra@gmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;p&gt;&amp;gt;I have windows7 OS and have installed Python27 and Django1.3.1&lt;br&gt;&amp;gt;I have also set the path in the environment variables to: C:&lt;br&gt;&amp;gt;\Python27\;C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib&lt;br&gt;&amp;gt;\site-packages\django\bin&lt;br&gt;&amp;gt;&lt;br&gt;	First off -- you can remove tghe python.exe section from the path...&lt;br&gt;PATH is a list of /directories/ in which executable file are expected to&lt;br&gt;be found, so there is nothing &amp;quot;in&amp;quot; c:\python27\python.exe to search&lt;br&gt;(python.exe will be found by the first c:\Python27\ entry.&lt;p&gt;&amp;gt;Commands like python and import django works well but&lt;br&gt;&amp;gt;when i try creating a new project I get the following error:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;C:\Python27\Django-1.3.1&amp;gt;django-admin.py startproject mysite&lt;br&gt;&amp;gt;&amp;#39;django-admin.py&amp;#39; is not recognized as an internal or external&lt;br&gt;&amp;gt;command,&lt;br&gt;&amp;gt;operable program or batch file.&lt;br&gt;&amp;gt;&lt;p&gt;	Can you run ANY python script (.py) file by typing its name on the&lt;br&gt;command line?... Say something that does nothing more than:&lt;p&gt;print &amp;quot;I&amp;#39;m running&amp;quot;&lt;p&gt;(test while /in/ the directory that has the file, first)&lt;p&gt;	My suspicion is that you don&amp;#39;t have .py defined as a valid &amp;quot;command&lt;br&gt;file extension&amp;quot; NOR do you have the associations set to run one. What&lt;br&gt;follows is a listing from Windows Powershell (I had a short cut for it,&lt;br&gt;but not for the old command shell). Note the last two entries on PATHEXT&lt;br&gt;-- those make .py and .pyw valid command extensions (supposedly, you&lt;br&gt;don&amp;#39;t even have to type &amp;quot;scriptname.py&amp;quot;, only &amp;quot;scriptname&amp;quot;, to have the&lt;br&gt;system find the .py file)[Interesting -- I don&amp;#39;t seem to have powershell&lt;br&gt;scripts on the extension list]&lt;p&gt;&lt;br&gt;PS C:\Users\Wulfraed&amp;gt; cd env:&lt;br&gt;PS Env:\&amp;gt; ls&lt;p&gt;Name                           Value&lt;br&gt;----                           -----&lt;br&gt;		&amp;lt;snip&amp;gt;&lt;br&gt;NUMBER_OF_PROCESSORS           8&lt;br&gt;OS                             Windows_NT&lt;br&gt;Path&lt;br&gt;%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\GNAT\2011\bin;C:\Python27_64\;C:\Pyt...&lt;br&gt;PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw&lt;br&gt;PROCESSOR_ARCHITECTURE         AMD64&lt;br&gt;PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 42 Stepping 7,&lt;br&gt;GenuineIntel&lt;br&gt;		&amp;lt;snip&amp;gt;&lt;br&gt;PS Env:\&amp;gt;&lt;p&gt;	The OTHER (more likely problem since you entered the extension) is&lt;br&gt;that you don&amp;#39;t have .py files associated with a python interpreter&lt;br&gt;(note: the &amp;quot;cmd /c&amp;quot; was needed here as they are internal to the old&lt;br&gt;command shell, not available in powershell itself)&lt;p&gt;PS Env:\&amp;gt; cmd /c assoc .py&lt;br&gt;.py=Python.File&lt;br&gt;PS Env:\&amp;gt; cmd /c ftype Python.File&lt;br&gt;Python.File=&amp;quot;C:\Python27\python.exe&amp;quot; &amp;quot;%1&amp;quot; %*&lt;br&gt;PS Env:\&amp;gt;&lt;p&gt;	If ASSOC and FTYPE don&amp;#39;t show entries, try creating them (may need&lt;br&gt;to be admin, or they may be stored on a per user basis)...&lt;p&gt;ftype Python.File=&amp;quot;C:\Python27\python.exe&amp;quot; &amp;quot;%1&amp;quot; %*&lt;br&gt;assoc .py=Python.File&lt;p&gt;(repeat with pythonw replacing all use of python to set up the &amp;quot;no&lt;br&gt;console&amp;quot; extension).&lt;p&gt;&lt;br&gt;	{Of course, the last option may just be that, regardless of what you&lt;br&gt;setup -- django-admin.py is NOT in one of the directories in the search&lt;br&gt;path}&lt;br&gt;-- &lt;br&gt;	Wulfraed                 Dennis Lee Bieber         AF6VN&lt;br&gt;        &lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;    &lt;a href="HTTP://wlfraed.home.netcom.com/"&gt;HTTP://wlfraed.home.netcom.com/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6147406734900819060?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6147406734900819060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-adminpy-startproject-doesnt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6147406734900819060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6147406734900819060'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-adminpy-startproject-doesnt.html' title='Re: django-admin.py startproject doesn&apos;t work'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2921261673192616252</id><published>2012-02-13T08:01:00.000-08:00</published><updated>2012-02-13T08:03:20.519-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>On Mon, 13 Feb 2012 01:50:12 -0800 (PST), Marcus Maximus&lt;br&gt;&amp;lt;&lt;a href="mailto:marcus.presich@gmail.com"&gt;marcus.presich@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&lt;br&gt;&amp;gt;        &amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-&lt;br&gt;&amp;gt;win32-x86-3071000\test.db&amp;#39;,                      # Or path to database&lt;p&gt;	Is that a typo? &amp;quot;Webseite&amp;quot; and not &amp;quot;Website&amp;quot;?&lt;p&gt;-- &lt;br&gt;	Wulfraed                 Dennis Lee Bieber         AF6VN&lt;br&gt;        &lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;    &lt;a href="HTTP://wlfraed.home.netcom.com/"&gt;HTTP://wlfraed.home.netcom.com/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2921261673192616252?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2921261673192616252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_2895.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2921261673192616252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2921261673192616252'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_2895.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4092119947971994833</id><published>2012-02-13T07:38:00.000-08:00</published><updated>2012-02-13T07:39:37.362-08:00</updated><title type='text'>Re: Comments Link- How to?</title><content type='html'>Oh ok. Just render the comments as usual then use jquery of pure&lt;br&gt;javascript to hide it by default. Tie the link to the onclick event&lt;br&gt;such that it triggers the unhiding of the comment div. Simple.&lt;p&gt;&lt;br&gt;On 2/13/12, coded kid &amp;lt;&lt;a href="mailto:duffleboi911@gmail.com"&gt;duffleboi911@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Okay. Just like this. &amp;lt;a href=&amp;quot;{% url django.comment %}&amp;quot;/&amp;gt; Comment&lt;br&gt;&amp;gt; Link Name &amp;lt;/a&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Where &amp;quot;Comment Link Name&amp;quot; is the name you want to give to your link.&lt;br&gt;&amp;gt; So when a user click on it, it should show the comment form on the&lt;br&gt;&amp;gt; same page.  I hope you now get my point?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Feb 13, 1:26&amp;#160;pm, Babatunde Akinyanmi &amp;lt;&lt;a href="mailto:tundeba...@gmail.com"&gt;tundeba...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&amp;gt; Please Rephrase. I don&amp;#39;t get the part of &amp;quot;comment link name&amp;quot;&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; On 2/13/12, coded kid &amp;lt;&lt;a href="mailto:duffleboi...@gmail.com"&gt;duffleboi...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; Hi Guys, How can I link to &amp;quot;Django Comment form&amp;quot;, so that when a user&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; clicks on the &amp;quot;Comment Link Name&amp;quot; It will display the Comment Form on&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; the same page with the post. I hope you get my point? If you do please&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; answer and if you don&amp;#39;t ask me to explain further.&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; --&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; You received this message because you are subscribed to the Google&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; Groups&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;&lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; --&lt;br&gt;&amp;gt;&amp;gt; Sent from my mobile device&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt;&amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4092119947971994833?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4092119947971994833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-link-how-to_7409.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4092119947971994833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4092119947971994833'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-link-how-to_7409.html' title='Re: Comments Link- How to?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2032264931230570612</id><published>2012-02-13T06:31:00.000-08:00</published><updated>2012-02-13T06:32:18.375-08:00</updated><title type='text'>Re: Mod_Wsgi + Apache 2.2 + Threads + httplib2</title><content type='html'>mod_wsgi doesn&amp;#39;t support print, does it? Its usage should raise an&lt;br&gt;exception.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2032264931230570612?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2032264931230570612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-apache-22-threads-httplib2_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2032264931230570612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2032264931230570612'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-apache-22-threads-httplib2_13.html' title='Re: Mod_Wsgi + Apache 2.2 + Threads + httplib2'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4706556599087161402</id><published>2012-02-13T05:50:00.001-08:00</published><updated>2012-02-13T05:50:46.162-08:00</updated><title type='text'>Re: Comments form customization</title><content type='html'>On 02/13/2012 11:12 AM, Fabio Natali wrote:&lt;br&gt;&amp;gt; &lt;a href="http://stackoverflow.com/questions/1456267/django-comments-want-to-remove-user-url-not-expand-the-model-how-to/4766543#4766543"&gt;http://stackoverflow.com/questions/1456267/django-comments-want-to-remove-user-url-not-expand-the-model-how-to/4766543#4766543&lt;/a&gt;&lt;p&gt;This link worked fine for me. :-)&lt;p&gt;-- &lt;br&gt;Fabio Natali FNstudio&lt;br&gt;&lt;a href="http://fnstudio.it"&gt;http://fnstudio.it&lt;/a&gt;&lt;br&gt;fabio_natali@skype&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4706556599087161402?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4706556599087161402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_2829.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4706556599087161402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4706556599087161402'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_2829.html' title='Re: Comments form customization'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1403130322996173557</id><published>2012-02-13T05:49:00.000-08:00</published><updated>2012-02-13T05:50:29.291-08:00</updated><title type='text'>Re: Comments form customization</title><content type='html'>On 02/13/2012 11:44 AM:&lt;br&gt;&amp;gt; Yeah, thanks for the reply. I followed the doc but it&amp;#39;s not working&lt;br&gt;&amp;gt; for me.&lt;br&gt;[...]&lt;p&gt;Hi there!&lt;p&gt;If you have an object my_object passed by your view to your template, I&lt;br&gt;think you can write:&lt;p&gt;{% load comments %}&lt;br&gt;{% get_comment_count for my_object as comment_count %}&lt;br&gt;{% get_comment_list for my_object as comment_list %}&lt;br&gt;{% get_comment_form for my_object as form %}&lt;p&gt;and then you can:&lt;p&gt;&amp;lt;form action=&amp;quot;{% comment_form_target %}&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br&gt;   {% csrf_token %}&lt;br&gt;   {{ form }}&lt;br&gt;   &amp;lt;tr&amp;gt;&lt;br&gt;     &amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br&gt;       &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;Post&amp;quot;&amp;gt;&lt;br&gt;       &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;preview&amp;quot; value=&amp;quot;Preview&amp;quot;&amp;gt;&lt;br&gt;     &amp;lt;/td&amp;gt;&lt;br&gt;   &amp;lt;/tr&amp;gt;&lt;br&gt;&amp;lt;/form&amp;gt;&lt;p&gt;Let me know it that&amp;#39;s of any help. In case, write me what kind of error&lt;br&gt;you get. Also, I can pass you my source code so you can have an example.&lt;p&gt;Cheers, Fabio.&lt;p&gt;-- &lt;br&gt;Fabio Natali&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1403130322996173557?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1403130322996173557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_9611.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1403130322996173557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1403130322996173557'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_9611.html' title='Re: Comments form customization'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-901209212771982798</id><published>2012-02-13T05:24:00.000-08:00</published><updated>2012-02-13T05:25:38.661-08:00</updated><title type='text'>Re: Comments Link- How to?</title><content type='html'>Okay. Just like this. &amp;lt;a href=&amp;quot;{% url django.comment %}&amp;quot;/&amp;gt; Comment&lt;br&gt;Link Name &amp;lt;/a&amp;gt;&lt;p&gt;Where &amp;quot;Comment Link Name&amp;quot; is the name you want to give to your link.&lt;br&gt;So when a user click on it, it should show the comment form on the&lt;br&gt;same page.  I hope you now get my point?&lt;p&gt;On Feb 13, 1:26&amp;#160;pm, Babatunde Akinyanmi &amp;lt;&lt;a href="mailto:tundeba...@gmail.com"&gt;tundeba...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Please Rephrase. I don&amp;#39;t get the part of &amp;quot;comment link name&amp;quot;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On 2/13/12, coded kid &amp;lt;&lt;a href="mailto:duffleboi...@gmail.com"&gt;duffleboi...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Hi Guys, How can I link to &amp;quot;Django Comment form&amp;quot;, so that when a user&lt;br&gt;&amp;gt; &amp;gt; clicks on the &amp;quot;Comment Link Name&amp;quot; It will display the Comment Form on&lt;br&gt;&amp;gt; &amp;gt; the same page with the post. I hope you get my point? If you do please&lt;br&gt;&amp;gt; &amp;gt; answer and if you don&amp;#39;t ask me to explain further.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; --&lt;br&gt;&amp;gt; &amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt;&amp;gt; &amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; &amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; &amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &amp;gt;&lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Sent from my mobile device&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-901209212771982798?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/901209212771982798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-link-how-to_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/901209212771982798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/901209212771982798'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-link-how-to_13.html' title='Re: Comments Link- How to?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1290274217131417819</id><published>2012-02-13T05:18:00.001-08:00</published><updated>2012-02-13T05:18:30.261-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>Also &amp;#39;Webseite&amp;#39; in your file path may be misspelled?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1290274217131417819?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1290274217131417819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_9251.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1290274217131417819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1290274217131417819'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_9251.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3379481173526905157</id><published>2012-02-13T05:10:00.003-08:00</published><updated>2012-02-13T05:10:48.744-08:00</updated><title type='text'>Re: error while testing</title><content type='html'>Lots of Thanks :)&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On 13 February 2012 13:52, Sandro Dutra &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:hexodin@gmail.com"&gt;hexodin@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;  Think it&amp;#39;s a name conflict with the model Location, probably it&amp;#39;s&lt;br&gt; registered 2 times in &amp;quot;admin.py&amp;quot; (line 4), or try to change the model&lt;br&gt; name.&lt;br&gt; &lt;br&gt; 2012/2/13 xina towner &amp;lt;&lt;a href="mailto:xinatowner@gmail.com"&gt;xinatowner@gmail.com&lt;/a&gt;&amp;gt;:&lt;br&gt; &lt;div class="HOEnZb"&gt;&lt;div class="h5"&gt;&amp;gt; I&amp;#39;m getting this error when I try to do my tests, can anybody help me&lt;br&gt; &amp;gt; please?&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; Traceback (most recent call last):&lt;br&gt; &amp;gt;   File &amp;quot;/home/xino/workspace/unnamedapp/accounts/tests.py&amp;quot;, line 209, in&lt;br&gt; &amp;gt; test_request_invitation&lt;br&gt; &amp;gt;     resp = self.client.get(&amp;#39;/accounts/invite/request/&amp;#39;)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt; &amp;gt; line 439, in get&lt;br&gt; &amp;gt;     response = super(Client, self).get(path, data=data, **extra)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt; &amp;gt; line 241, in get&lt;br&gt; &amp;gt;     return self.request(**r)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt; &amp;gt; line 381, in request&lt;br&gt; &amp;gt;     response = self.handler(environ)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt; &amp;gt; line 84, in __call__&lt;br&gt; &amp;gt;     response = self.get_response(request)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py&amp;quot;,&lt;br&gt; &amp;gt; line 169, in get_response&lt;br&gt; &amp;gt;     response = self.handle_uncaught_exception(request, resolver,&lt;br&gt; &amp;gt; sys.exc_info())&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py&amp;quot;,&lt;br&gt; &amp;gt; line 218, in handle_uncaught_exception&lt;br&gt; &amp;gt;     return callback(request, **param_dict)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py&amp;quot;,&lt;br&gt; &amp;gt; line 93, in _wrapped_view&lt;br&gt; &amp;gt;     response = view_func(request, *args, **kwargs)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/views/defaults.py&amp;quot;,&lt;br&gt; &amp;gt; line 31, in server_error&lt;br&gt; &amp;gt;     return http.HttpResponseServerError(t.render(Context({})))&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt; &amp;gt; line 123, in render&lt;br&gt; &amp;gt;     return self._render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/utils.py&amp;quot;,&lt;br&gt; &amp;gt; line 60, in instrumented_test_render&lt;br&gt; &amp;gt;     return self.nodelist.render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt; &amp;gt; line 744, in render&lt;br&gt; &amp;gt;     bits.append(self.render_node(node, context))&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;,&lt;br&gt; &amp;gt; line 73, in render_node&lt;br&gt; &amp;gt;     result = node.render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py&amp;quot;,&lt;br&gt; &amp;gt; line 127, in render&lt;br&gt; &amp;gt;     return compiled_parent._render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/utils.py&amp;quot;,&lt;br&gt; &amp;gt; line 60, in instrumented_test_render&lt;br&gt; &amp;gt;     return self.nodelist.render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt; &amp;gt; line 744, in render&lt;br&gt; &amp;gt;     bits.append(self.render_node(node, context))&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;,&lt;br&gt; &amp;gt; line 73, in render_node&lt;br&gt; &amp;gt;     result = node.render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py&amp;quot;,&lt;br&gt; &amp;gt; line 64, in render&lt;br&gt; &amp;gt;     result = block.nodelist.render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt; &amp;gt; line 744, in render&lt;br&gt; &amp;gt;     bits.append(self.render_node(node, context))&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;,&lt;br&gt; &amp;gt; line 73, in render_node&lt;br&gt; &amp;gt;     result = node.render(context)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/defaulttags.py&amp;quot;,&lt;br&gt; &amp;gt; line 437, in render&lt;br&gt; &amp;gt;     url = reverse(view_name, args=args, kwargs=kwargs,&lt;br&gt; &amp;gt; current_app=context.current_app)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 391, in reverse&lt;br&gt; &amp;gt;     *args, **kwargs)))&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 312, in reverse&lt;br&gt; &amp;gt;     possibilities = self.reverse_dict.getlist(lookup_view)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 229, in _get_reverse_dict&lt;br&gt; &amp;gt;     self._populate()&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 208, in _populate&lt;br&gt; &amp;gt;     for name in pattern.reverse_dict:&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 229, in _get_reverse_dict&lt;br&gt; &amp;gt;     self._populate()&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 197, in _populate&lt;br&gt; &amp;gt;     for pattern in reversed(self.url_patterns):&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 279, in _get_url_patterns&lt;br&gt; &amp;gt;     patterns = getattr(self.urlconf_module, &amp;quot;urlpatterns&amp;quot;,&lt;br&gt; &amp;gt; self.urlconf_module)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt; &amp;gt; line 274, in _get_urlconf_module&lt;br&gt; &amp;gt;     self._urlconf_module = import_module(self.urlconf_name)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/importlib.py&amp;quot;,&lt;br&gt; &amp;gt; line 35, in import_module&lt;br&gt; &amp;gt;     __import__(name)&lt;br&gt; &amp;gt;   File &amp;quot;/home/xino/workspace/unnamedapp/urls_web.py&amp;quot;, line 6, in &amp;lt;module&amp;gt;&lt;br&gt; &amp;gt;     admin.autodiscover()&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py&amp;quot;,&lt;br&gt; &amp;gt; line 26, in autodiscover&lt;br&gt; &amp;gt;     import_module(&amp;#39;%s.admin&amp;#39; % app)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/importlib.py&amp;quot;,&lt;br&gt; &amp;gt; line 35, in import_module&lt;br&gt; &amp;gt;     __import__(name)&lt;br&gt; &amp;gt;   File &amp;quot;/home/xino/workspace/unnamedapp/quests/admin.py&amp;quot;, line 4, in&lt;br&gt; &amp;gt; &amp;lt;module&amp;gt;&lt;br&gt; &amp;gt;     admin.site.register(Location)&lt;br&gt; &amp;gt;   File&lt;br&gt; &amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/contrib/admin/sites.py&amp;quot;,&lt;br&gt; &amp;gt; line 85, in register&lt;br&gt; &amp;gt;     raise AlreadyRegistered(&amp;#39;The model %s is already registered&amp;#39; %&lt;br&gt; &amp;gt; model.__name__)&lt;br&gt; &amp;gt; TemplateSyntaxError: Caught AlreadyRegistered while rendering: The model&lt;br&gt; &amp;gt; Location is already registered&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; Also when I try to run the server and acces with my browser I get this&lt;br&gt; &amp;gt; error:&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; AlreadyRegistered at /admin&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; The model Location is already registered&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; Does anyone knows how to fix it?&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; --&lt;br&gt; &amp;gt; Gràcies,&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; Rubén&lt;br&gt; &amp;gt;&lt;br&gt; &lt;/div&gt;&lt;/div&gt;&lt;span class="HOEnZb"&gt;&lt;font color="#888888"&gt;&amp;gt; --&lt;br&gt; &amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt; &amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt; &amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; &amp;gt; To unsubscribe from this group, send email to&lt;br&gt; &amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt; &amp;gt; For more options, visit this group at&lt;br&gt; &amp;gt; &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt; &lt;br&gt; --&lt;br&gt; You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt; For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear="all"&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;Gràcies,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Rubén&lt;/div&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3379481173526905157?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3379481173526905157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-error-while-testing_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3379481173526905157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3379481173526905157'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-error-while-testing_13.html' title='Re: error while testing'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6632879443137600174</id><published>2012-02-13T05:10:00.001-08:00</published><updated>2012-02-13T05:10:47.668-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>Try this:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote type="cite"&gt;&lt;div&gt;&lt;blockquote type="cite"&gt;DATABASES = {&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; 'default': {&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'ENGINE': 'django.db.backends.sqlite3', &amp;nbsp;# Add&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;font class="Apple-style-span" color="#fb3920"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'NAME': 'test.db', &lt;/b&gt;&amp;nbsp;&lt;/font&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Or path to database&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;file if using sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'USER': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PASSWORD': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'HOST': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Set to empty string for&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;localhost. Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PORT': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Set to empty string for&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;default. Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt; &lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "&gt;&lt;div&gt;Best Regards,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Stanwin Siow&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;&lt;br class="Apple-interchange-newline"&gt; &lt;/div&gt; &lt;br&gt;&lt;div&gt;&lt;div&gt;On Feb 13, 2012, at 9:03 PM, ajohnston wrote:&lt;/div&gt;&lt;br class="Apple-interchange-newline"&gt;&lt;blockquote type="cite"&gt;&lt;div&gt;Try changing the slashes form \ to /&lt;br&gt;&lt;br&gt;On Feb 13, 4:50&amp;nbsp;am, Marcus Maximus &amp;lt;marcus.pres...@gmail.com&amp;gt; wrote:&lt;br&gt;&lt;blockquote type="cite"&gt;Hey guys,&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;i am using sqlite3 for my django app. BUT I have problems installing&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;it. Here are my configs:&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;DATABASES = {&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; 'default': {&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'ENGINE': 'django.db.backends.sqlite3', &amp;nbsp;# Add&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'NAME': 'C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;win32-x86-3071000\test.db', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Or path to database&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;file if using sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'USER': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PASSWORD': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'HOST': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Set to empty string for&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;localhost. Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'PORT': '', &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Set to empty string for&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;default. Not used with sqlite3.&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; }&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;}&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;I tried this:&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;blockquote type="cite"&gt;&lt;blockquote type="cite"&gt;&lt;blockquote type="cite"&gt;from django.db import connection&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;blockquote type="cite"&gt;&lt;blockquote type="cite"&gt;&lt;blockquote type="cite"&gt;cursor = connection.cursor()&lt;br&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;But I got this error:&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;Traceback (most recent call last):&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; File "&amp;lt;console&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; File "C:\Python27\lib\site-packages\django\db\backends\__init__.py",&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;line 250,&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp;in cursor&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; cursor = self.make_debug_cursor(self._cursor())&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; File "C:\Python27\lib\site-packages\django\db\backends&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;\sqlite3\base.py", line&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;207, in _cursor&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp; self.connection = Database.connect(**kwargs)&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;OperationalError: unable to open database file&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;Can sb pls help me?&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;greetings&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;Maximus&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;PS.: I created my sqlite3 file like that:&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp;&amp;gt;sqlite3 test.db&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;...&amp;gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;...&amp;gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;...&amp;gt;);&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;...&amp;gt;Syntax error&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&amp;nbsp; &amp;nbsp;&amp;gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;blockquote type="cite"&gt;Can sb show me a better way to create an empty sqlite3 db file?&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users+unsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6632879443137600174?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6632879443137600174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_4826.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6632879443137600174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6632879443137600174'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_4826.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3664370489736190171</id><published>2012-02-13T05:09:00.001-08:00</published><updated>2012-02-13T05:09:26.273-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>Sorry. To be clearer, I should have said. In your db file name:&lt;p&gt;C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-win32-&lt;br&gt;x86-3071000\test.db&lt;p&gt;try changing the \ to /&lt;p&gt;See:&lt;br&gt;&lt;a href="https://docs.djangoproject.com/en/dev/ref/settings/#name"&gt;https://docs.djangoproject.com/en/dev/ref/settings/#name&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3664370489736190171?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3664370489736190171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_6688.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3664370489736190171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3664370489736190171'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_6688.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4558443091133052800</id><published>2012-02-13T05:03:00.001-08:00</published><updated>2012-02-13T05:03:57.527-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>Try changing the slashes form \ to /&lt;p&gt;On Feb 13, 4:50&amp;#160;am, Marcus Maximus &amp;lt;&lt;a href="mailto:marcus.pres...@gmail.com"&gt;marcus.pres...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hey guys,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; i am using sqlite3 for my django app. BUT I have problems installing&lt;br&gt;&amp;gt; it. Here are my configs:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; DATABASES = {&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#39;default&amp;#39;: {&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#39;ENGINE&amp;#39;: &amp;#39;django.db.backends.sqlite3&amp;#39;, &amp;#160;# Add&lt;br&gt;&amp;gt; &amp;#39;postgresql_psycopg2&amp;#39;, &amp;#39;postgresql&amp;#39;, &amp;#39;mysql&amp;#39;, &amp;#39;sqlite3&amp;#39; or &amp;#39;oracle&amp;#39;.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-&lt;br&gt;&amp;gt; win32-x86-3071000\test.db&amp;#39;, &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;# Or path to database&lt;br&gt;&amp;gt; file if using sqlite3.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#39;USER&amp;#39;: &amp;#39;&amp;#39;, &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;# Not used with sqlite3.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#39;PASSWORD&amp;#39;: &amp;#39;&amp;#39;, &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;# Not used with sqlite3.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#39;HOST&amp;#39;: &amp;#39;&amp;#39;, &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;# Set to empty string for&lt;br&gt;&amp;gt; localhost. Not used with sqlite3.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#39;PORT&amp;#39;: &amp;#39;&amp;#39;, &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;# Set to empty string for&lt;br&gt;&amp;gt; default. Not used with sqlite3.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; }&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; }&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I tried this:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; from django.db import connection&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; cursor = connection.cursor()&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; But I got this error:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Traceback (most recent call last):&lt;br&gt;&amp;gt; &amp;#160; File &amp;quot;&amp;lt;console&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; File &amp;quot;C:\Python27\lib\site-packages\django\db\backends\__init__.py&amp;quot;,&lt;br&gt;&amp;gt; line 250,&lt;br&gt;&amp;gt; &amp;#160;in cursor&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; cursor = self.make_debug_cursor(self._cursor())&lt;br&gt;&amp;gt; &amp;#160; File &amp;quot;C:\Python27\lib\site-packages\django\db\backends&lt;br&gt;&amp;gt; \sqlite3\base.py&amp;quot;, line&lt;br&gt;&amp;gt; 207, in _cursor&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; self.connection = Database.connect(**kwargs)&lt;br&gt;&amp;gt; OperationalError: unable to open database file&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Can sb pls help me?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; greetings&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Maximus&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; PS.: I created my sqlite3 file like that:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160;&amp;gt;sqlite3 test.db&lt;br&gt;&amp;gt; ...&amp;gt;&lt;br&gt;&amp;gt; ...&amp;gt;&lt;br&gt;&amp;gt; ...&amp;gt;);&lt;br&gt;&amp;gt; ...&amp;gt;Syntax error&lt;br&gt;&amp;gt; &amp;#160; &amp;#160;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Can sb show me a better way to create an empty sqlite3 db file?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4558443091133052800?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4558443091133052800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4558443091133052800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4558443091133052800'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error_13.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8217305331696903860</id><published>2012-02-13T04:52:00.000-08:00</published><updated>2012-02-13T04:53:18.178-08:00</updated><title type='text'>Re: error while testing</title><content type='html'>Think it&amp;#39;s a name conflict with the model Location, probably it&amp;#39;s&lt;br&gt;registered 2 times in &amp;quot;admin.py&amp;quot; (line 4), or try to change the model&lt;br&gt;name.&lt;p&gt;2012/2/13 xina towner &amp;lt;&lt;a href="mailto:xinatowner@gmail.com"&gt;xinatowner@gmail.com&lt;/a&gt;&amp;gt;:&lt;br&gt;&amp;gt; I&amp;#39;m getting this error when I try to do my tests, can anybody help me&lt;br&gt;&amp;gt; please?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Traceback (most recent call last):&lt;br&gt;&amp;gt; &amp;#160; File &amp;quot;/home/xino/workspace/unnamedapp/accounts/tests.py&amp;quot;, line 209, in&lt;br&gt;&amp;gt; test_request_invitation&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; resp = self.client.get(&amp;#39;/accounts/invite/request/&amp;#39;)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt;&amp;gt; line 439, in get&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; response = super(Client, self).get(path, data=data, **extra)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt;&amp;gt; line 241, in get&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return self.request(**r)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt;&amp;gt; line 381, in request&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; response = self.handler(environ)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;,&lt;br&gt;&amp;gt; line 84, in __call__&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; response = self.get_response(request)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py&amp;quot;,&lt;br&gt;&amp;gt; line 169, in get_response&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; response = self.handle_uncaught_exception(request, resolver,&lt;br&gt;&amp;gt; sys.exc_info())&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py&amp;quot;,&lt;br&gt;&amp;gt; line 218, in handle_uncaught_exception&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return callback(request, **param_dict)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py&amp;quot;,&lt;br&gt;&amp;gt; line 93, in _wrapped_view&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; response = view_func(request, *args, **kwargs)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/views/defaults.py&amp;quot;,&lt;br&gt;&amp;gt; line 31, in server_error&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return http.HttpResponseServerError(t.render(Context({})))&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt;&amp;gt; line 123, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return self._render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/utils.py&amp;quot;,&lt;br&gt;&amp;gt; line 60, in instrumented_test_render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return self.nodelist.render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt;&amp;gt; line 744, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; bits.append(self.render_node(node, context))&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;,&lt;br&gt;&amp;gt; line 73, in render_node&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; result = node.render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py&amp;quot;,&lt;br&gt;&amp;gt; line 127, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return compiled_parent._render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/utils.py&amp;quot;,&lt;br&gt;&amp;gt; line 60, in instrumented_test_render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return self.nodelist.render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt;&amp;gt; line 744, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; bits.append(self.render_node(node, context))&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;,&lt;br&gt;&amp;gt; line 73, in render_node&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; result = node.render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py&amp;quot;,&lt;br&gt;&amp;gt; line 64, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; result = block.nodelist.render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;,&lt;br&gt;&amp;gt; line 744, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; bits.append(self.render_node(node, context))&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;,&lt;br&gt;&amp;gt; line 73, in render_node&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; result = node.render(context)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/defaulttags.py&amp;quot;,&lt;br&gt;&amp;gt; line 437, in render&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; url = reverse(view_name, args=args, kwargs=kwargs,&lt;br&gt;&amp;gt; current_app=context.current_app)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 391, in reverse&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; *args, **kwargs)))&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 312, in reverse&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; possibilities = self.reverse_dict.getlist(lookup_view)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 229, in _get_reverse_dict&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; self._populate()&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 208, in _populate&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; for name in pattern.reverse_dict:&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 229, in _get_reverse_dict&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; self._populate()&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 197, in _populate&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; for pattern in reversed(self.url_patterns):&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 279, in _get_url_patterns&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; patterns = getattr(self.urlconf_module, &amp;quot;urlpatterns&amp;quot;,&lt;br&gt;&amp;gt; self.urlconf_module)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;,&lt;br&gt;&amp;gt; line 274, in _get_urlconf_module&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; self._urlconf_module = import_module(self.urlconf_name)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/importlib.py&amp;quot;,&lt;br&gt;&amp;gt; line 35, in import_module&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; __import__(name)&lt;br&gt;&amp;gt; &amp;#160; File &amp;quot;/home/xino/workspace/unnamedapp/urls_web.py&amp;quot;, line 6, in &amp;lt;module&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; admin.autodiscover()&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py&amp;quot;,&lt;br&gt;&amp;gt; line 26, in autodiscover&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; import_module(&amp;#39;%s.admin&amp;#39; % app)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/importlib.py&amp;quot;,&lt;br&gt;&amp;gt; line 35, in import_module&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; __import__(name)&lt;br&gt;&amp;gt; &amp;#160; File &amp;quot;/home/xino/workspace/unnamedapp/quests/admin.py&amp;quot;, line 4, in&lt;br&gt;&amp;gt; &amp;lt;module&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; admin.site.register(Location)&lt;br&gt;&amp;gt; &amp;#160; File&lt;br&gt;&amp;gt; &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/contrib/admin/sites.py&amp;quot;,&lt;br&gt;&amp;gt; line 85, in register&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; raise AlreadyRegistered(&amp;#39;The model %s is already registered&amp;#39; %&lt;br&gt;&amp;gt; model.__name__)&lt;br&gt;&amp;gt; TemplateSyntaxError: Caught AlreadyRegistered while rendering: The model&lt;br&gt;&amp;gt; Location is already registered&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Also when I try to run the server and acces with my browser I get this&lt;br&gt;&amp;gt; error:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; AlreadyRegistered at /admin&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; The model Location is already registered&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Does anyone knows how to fix it?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Gr&amp;#224;cies,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Rub&amp;#233;n&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt;&amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8217305331696903860?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8217305331696903860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-error-while-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8217305331696903860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8217305331696903860'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-error-while-testing.html' title='Re: error while testing'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6554227346826966968</id><published>2012-02-13T04:35:00.001-08:00</published><updated>2012-02-13T04:35:55.428-08:00</updated><title type='text'>Re: sqlite3 database error</title><content type='html'>After specifying the path to where you want your sqlite database to be&lt;br&gt;i.e db name setting, after your syncdb, the database will be created&lt;br&gt;automatically if it doesn&amp;#39;t already exist in the path you stated.&lt;p&gt;On 2/13/12, Marcus Maximus &amp;lt;&lt;a href="mailto:marcus.presich@gmail.com"&gt;marcus.presich@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hey guys,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; i am using sqlite3 for my django app. BUT I have problems installing&lt;br&gt;&amp;gt; it. Here are my configs:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; DATABASES = {&lt;br&gt;&amp;gt;     &amp;#39;default&amp;#39;: {&lt;br&gt;&amp;gt;         &amp;#39;ENGINE&amp;#39;: &amp;#39;django.db.backends.sqlite3&amp;#39;,  # Add&lt;br&gt;&amp;gt; &amp;#39;postgresql_psycopg2&amp;#39;, &amp;#39;postgresql&amp;#39;, &amp;#39;mysql&amp;#39;, &amp;#39;sqlite3&amp;#39; or &amp;#39;oracle&amp;#39;.&lt;br&gt;&amp;gt;         &amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-&lt;br&gt;&amp;gt; win32-x86-3071000\test.db&amp;#39;,                      # Or path to database&lt;br&gt;&amp;gt; file if using sqlite3.&lt;br&gt;&amp;gt;         &amp;#39;USER&amp;#39;: &amp;#39;&amp;#39;,                      # Not used with sqlite3.&lt;br&gt;&amp;gt;         &amp;#39;PASSWORD&amp;#39;: &amp;#39;&amp;#39;,                  # Not used with sqlite3.&lt;br&gt;&amp;gt;         &amp;#39;HOST&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt;&amp;gt; localhost. Not used with sqlite3.&lt;br&gt;&amp;gt;         &amp;#39;PORT&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt;&amp;gt; default. Not used with sqlite3.&lt;br&gt;&amp;gt;     }&lt;br&gt;&amp;gt; }&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I tried this:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; from django.db import connection&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; cursor = connection.cursor()&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; But I got this error:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Traceback (most recent call last):&lt;br&gt;&amp;gt;   File &amp;quot;&amp;lt;console&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br&gt;&amp;gt;   File &amp;quot;C:\Python27\lib\site-packages\django\db\backends\__init__.py&amp;quot;,&lt;br&gt;&amp;gt; line 250,&lt;br&gt;&amp;gt;  in cursor&lt;br&gt;&amp;gt;     cursor = self.make_debug_cursor(self._cursor())&lt;br&gt;&amp;gt;   File &amp;quot;C:\Python27\lib\site-packages\django\db\backends&lt;br&gt;&amp;gt; \sqlite3\base.py&amp;quot;, line&lt;br&gt;&amp;gt; 207, in _cursor&lt;br&gt;&amp;gt;     self.connection = Database.connect(**kwargs)&lt;br&gt;&amp;gt; OperationalError: unable to open database file&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Can sb pls help me?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; greetings&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Maximus&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; PS.: I created my sqlite3 file like that:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;    &amp;gt;sqlite3 test.db&lt;br&gt;&amp;gt; ...&amp;gt;&lt;br&gt;&amp;gt; ...&amp;gt;&lt;br&gt;&amp;gt; ...&amp;gt;);&lt;br&gt;&amp;gt; ...&amp;gt;Syntax error&lt;br&gt;&amp;gt;    &amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Can sb show me a better way to create an empty sqlite3 db file?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt;&amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;p&gt;-- &lt;br&gt;Sent from my mobile device&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6554227346826966968?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6554227346826966968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6554227346826966968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6554227346826966968'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-database-error.html' title='Re: sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8830598984087128232</id><published>2012-02-13T04:26:00.000-08:00</published><updated>2012-02-13T04:27:35.275-08:00</updated><title type='text'>Re: Comments Link- How to?</title><content type='html'>Please Rephrase. I don&amp;#39;t get the part of &amp;quot;comment link name&amp;quot;&lt;p&gt;On 2/13/12, coded kid &amp;lt;&lt;a href="mailto:duffleboi911@gmail.com"&gt;duffleboi911@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hi Guys, How can I link to &amp;quot;Django Comment form&amp;quot;, so that when a user&lt;br&gt;&amp;gt; clicks on the &amp;quot;Comment Link Name&amp;quot; It will display the Comment Form on&lt;br&gt;&amp;gt; the same page with the post. I hope you get my point? If you do please&lt;br&gt;&amp;gt; answer and if you don&amp;#39;t ask me to explain further.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;quot;Django users&amp;quot; group.&lt;br&gt;&amp;gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;p&gt;-- &lt;br&gt;Sent from my mobile device&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8830598984087128232?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8830598984087128232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-link-how-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8830598984087128232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8830598984087128232'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-link-how-to.html' title='Re: Comments Link- How to?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1448610572341545951</id><published>2012-02-13T04:07:00.001-08:00</published><updated>2012-02-13T04:07:39.556-08:00</updated><title type='text'>Re: complete for dropdown box in admin</title><content type='html'>On Mon, 2012-02-13 at 17:15 +0530, Anoop Thomas Mathew wrote:&lt;br&gt;&amp;gt; &lt;a href="http://harvesthq.github.com/chosen/"&gt;http://harvesthq.github.com/chosen/&lt;/a&gt;&lt;br&gt;&amp;gt; Hope this helps.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;p&gt;looks just like what I wanted. And this helps too:&lt;p&gt;&lt;a href="http://bradmontgomery.net/blog/chosenjs-in-the-django-admin/"&gt;http://bradmontgomery.net/blog/chosenjs-in-the-django-admin/&lt;/a&gt;&lt;br&gt;-- &lt;br&gt;regards&lt;br&gt;Kenneth Gonsalves&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1448610572341545951?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1448610572341545951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-complete-for-dropdown-box-in-admin_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1448610572341545951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1448610572341545951'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-complete-for-dropdown-box-in-admin_13.html' title='Re: complete for dropdown box in admin'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8296658233789776907</id><published>2012-02-13T04:04:00.000-08:00</published><updated>2012-02-13T04:05:08.489-08:00</updated><title type='text'>Comments Link- How to?</title><content type='html'>Hi Guys, How can I link to &amp;quot;Django Comment form&amp;quot;, so that when a user&lt;br&gt;clicks on the &amp;quot;Comment Link Name&amp;quot; It will display the Comment Form on&lt;br&gt;the same page with the post. I hope you get my point? If you do please&lt;br&gt;answer and if you don&amp;#39;t ask me to explain further.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8296658233789776907?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8296658233789776907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/comments-link-how-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8296658233789776907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8296658233789776907'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/comments-link-how-to.html' title='Comments Link- How to?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7708353449504956818</id><published>2012-02-13T04:02:00.000-08:00</published><updated>2012-02-13T04:06:07.228-08:00</updated><title type='text'>django admin templates: filter&lt;div&gt; hides table contents</title><content type='html'>Hi,&lt;p&gt;I wanted to know whether anybody modified the django admin templates such,&lt;br&gt;that the filter div could be hidden.&lt;p&gt;At the moment the &amp;lt;div&amp;gt; containing the filters may hide the&lt;br&gt;contents of the table.&lt;p&gt;&lt;br&gt;As I can imagine, that I&amp;#39;m not the only one who might  have large tables&lt;br&gt;and doesn&amp;#39;t like, that part of the table data is hidden behind these&lt;br&gt;filters I wanted to know whether anybody changed the templates / style&lt;br&gt;sheets / javascript such, that it is possible to&lt;br&gt;show / hide the filter window (similiar to how it is done for the&lt;br&gt;django debug tool bar.&lt;p&gt;Usage of jquery for showing / hiding is no wroblem as I juse jquery&lt;br&gt;already for other pages.&lt;p&gt;Thanks in advance for your answers.&lt;p&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7708353449504956818?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7708353449504956818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-admin-templates-filter-hides.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7708353449504956818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7708353449504956818'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-admin-templates-filter-hides.html' title='django admin templates: filter&amp;lt;div&amp;gt; hides table contents'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5670563730474531779</id><published>2012-02-13T03:51:00.001-08:00</published><updated>2012-02-13T03:51:41.632-08:00</updated><title type='text'>error</title><content type='html'>Hi, I get this message when I try to acces to the admin page:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;h1 style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-weight:normal;font-family:sans-serif;background-color:rgb(255,255,204)"&gt;  AlreadyRegistered at /admin&lt;/h1&gt;&lt;pre class="exception_value" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:10px;margin-bottom:10px;font-size:1.5em;font-family:sans-serif;color:rgb(102,102,102);background-color:rgb(255,255,204)"&gt;  The model Location is already registered&lt;/pre&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;does anybody know which is the problem?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;Gràcies,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Rubén&lt;/div&gt;&lt;br&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5670563730474531779?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5670563730474531779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/error_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5670563730474531779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5670563730474531779'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/error_13.html' title='error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2228088991882911054</id><published>2012-02-13T03:45:00.000-08:00</published><updated>2012-02-13T03:46:45.393-08:00</updated><title type='text'>Re: complete for dropdown box in admin</title><content type='html'>&lt;font face="georgia,serif"&gt;Hi,&lt;br&gt;&lt;br&gt;&lt;a href="http://harvesthq.github.com/chosen/"&gt;http://harvesthq.github.com/chosen/&lt;/a&gt;&lt;br&gt;Hope this helps.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Anoop Thomas Mathew&lt;br&gt;&lt;br clear="all"&gt;&lt;/font&gt;atm&lt;br&gt;___&lt;br&gt;  Life is short, Live it hard.&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On 13 February 2012 12:17, kenneth gonsalves &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:lawgon@thenilgiris.com"&gt;lawgon@thenilgiris.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;  hi,&lt;br&gt; &lt;br&gt; I need a widget in admin to autoselect (I do not know what it is called)&lt;br&gt; a foreign key - that is if I type &amp;#39;f&amp;#39; it goes to the first occurrence of&lt;br&gt; &amp;#39;f&amp;#39; and so on. I hope I am clear.&lt;br&gt; &lt;span class="HOEnZb"&gt;&lt;font color="#888888"&gt;--&lt;br&gt; regards&lt;br&gt; Kenneth Gonsalves&lt;br&gt; &lt;br&gt; --&lt;br&gt; You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt; For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2228088991882911054?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2228088991882911054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-complete-for-dropdown-box-in-admin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2228088991882911054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2228088991882911054'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-complete-for-dropdown-box-in-admin.html' title='Re: complete for dropdown box in admin'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6002760745431493542</id><published>2012-02-13T03:12:00.000-08:00</published><updated>2012-02-13T03:13:31.003-08:00</updated><title type='text'>error while testing</title><content type='html'>&lt;div&gt;I&amp;#39;m getting this error when I try to do my tests, can anybody help me please?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Traceback (most recent call last):&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/accounts/tests.py&amp;quot;, line 209, in test_request_invitation&lt;/div&gt;  &lt;div&gt;    resp = self.client.get(&amp;#39;/accounts/invite/request/&amp;#39;)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;, line 439, in get&lt;/div&gt;&lt;div&gt;      response = super(Client, self).get(path, data=data, **extra)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;, line 241, in get&lt;/div&gt;&lt;div&gt;    return self.request(**r)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;, line 381, in request&lt;/div&gt;&lt;div&gt;    response = self.handler(environ)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/client.py&amp;quot;, line 84, in __call__&lt;/div&gt;  &lt;div&gt;    response = self.get_response(request)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py&amp;quot;, line 169, in get_response&lt;/div&gt;&lt;div&gt;    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py&amp;quot;, line 218, in handle_uncaught_exception&lt;/div&gt;&lt;div&gt;    return callback(request, **param_dict)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py&amp;quot;, line 93, in _wrapped_view&lt;/div&gt;&lt;div&gt;    response = view_func(request, *args, **kwargs)&lt;/div&gt;&lt;div&gt;    File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/views/defaults.py&amp;quot;, line 31, in server_error&lt;/div&gt;&lt;div&gt;    return http.HttpResponseServerError(t.render(Context({})))&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;, line 123, in render&lt;/div&gt;&lt;div&gt;    return self._render(context)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/utils.py&amp;quot;, line 60, in instrumented_test_render&lt;/div&gt;  &lt;div&gt;    return self.nodelist.render(context)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;, line 744, in render&lt;/div&gt;&lt;div&gt;    bits.append(self.render_node(node, context))&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;, line 73, in render_node&lt;/div&gt;&lt;div&gt;    result = node.render(context)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py&amp;quot;, line 127, in render&lt;/div&gt;  &lt;div&gt;    return compiled_parent._render(context)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/test/utils.py&amp;quot;, line 60, in instrumented_test_render&lt;/div&gt;&lt;div&gt;     return self.nodelist.render(context)&lt;/div&gt; &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;, line 744, in render&lt;/div&gt;&lt;div&gt;    bits.append(self.render_node(node, context))&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;, line 73, in render_node&lt;/div&gt;  &lt;div&gt;    result = node.render(context)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/loader_tags.py&amp;quot;, line 64, in render&lt;/div&gt;&lt;div&gt;    result = block.nodelist.render(context)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/base.py&amp;quot;, line 744, in render&lt;/div&gt;&lt;div&gt;    bits.append(self.render_node(node, context))&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/debug.py&amp;quot;, line 73, in render_node&lt;/div&gt;  &lt;div&gt;    result = node.render(context)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/template/defaulttags.py&amp;quot;, line 437, in render&lt;/div&gt;&lt;div&gt;    url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 391, in reverse&lt;/div&gt;&lt;div&gt;    *args, **kwargs)))&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 312, in reverse&lt;/div&gt;  &lt;div&gt;    possibilities = self.reverse_dict.getlist(lookup_view)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 229, in _get_reverse_dict&lt;/div&gt;  &lt;div&gt;    self._populate()&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 208, in _populate&lt;/div&gt;&lt;div&gt;    for name in pattern.reverse_dict:&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 229, in _get_reverse_dict&lt;/div&gt;&lt;div&gt;    self._populate()&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 197, in _populate&lt;/div&gt;  &lt;div&gt;    for pattern in reversed(self.url_patterns):&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 279, in _get_url_patterns&lt;/div&gt; &lt;div&gt;     patterns = getattr(self.urlconf_module, &amp;quot;urlpatterns&amp;quot;, self.urlconf_module)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py&amp;quot;, line 274, in _get_urlconf_module&lt;/div&gt;  &lt;div&gt;    self._urlconf_module = import_module(self.urlconf_name)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/importlib.py&amp;quot;, line 35, in import_module&lt;/div&gt;  &lt;div&gt;    __import__(name)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/urls_web.py&amp;quot;, line 6, in &amp;lt;module&amp;gt;&lt;/div&gt;&lt;div&gt;    admin.autodiscover()&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py&amp;quot;, line 26, in autodiscover&lt;/div&gt;  &lt;div&gt;    import_module(&amp;#39;%s.admin&amp;#39; % app)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/utils/importlib.py&amp;quot;, line 35, in import_module&lt;/div&gt;&lt;div&gt;    __import__(name)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/quests/admin.py&amp;quot;, line 4, in &amp;lt;module&amp;gt;&lt;/div&gt;&lt;div&gt;    admin.site.register(Location)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/.virtualenvs/xinovirtualenv/local/lib/python2.7/site-packages/django/contrib/admin/sites.py&amp;quot;, line 85, in register&lt;/div&gt;  &lt;div&gt;    raise AlreadyRegistered(&amp;#39;The model %s is already registered&amp;#39; % model.__name__)&lt;/div&gt;&lt;div&gt;TemplateSyntaxError: Caught AlreadyRegistered while rendering: The model Location is already registered&lt;/div&gt;&lt;div&gt; &lt;br&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Also when I try to run the server and acces with my browser I get this error:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;h1 style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-weight:normal;font-family:sans-serif;background-color:rgb(255,255,204)"&gt;  AlreadyRegistered at /admin&lt;/h1&gt;&lt;pre class="exception_value" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;margin-top:10px;margin-bottom:10px;font-size:1.5em;font-family:sans-serif;color:rgb(102,102,102);background-color:rgb(255,255,204)"&gt;  The model Location is already registered&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;Does anyone knows how to fix it?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;Gràcies,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Rubén&lt;/div&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6002760745431493542?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6002760745431493542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/error-while-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6002760745431493542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6002760745431493542'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/error-while-testing.html' title='error while testing'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8694310136023778799</id><published>2012-02-13T02:44:00.000-08:00</published><updated>2012-02-13T02:45:30.774-08:00</updated><title type='text'>Re: Admin inline for inherited model cant find pointer to parent model</title><content type='html'>Looking more into this,&lt;p&gt;my parent model has a primary key field named &amp;#39;code&amp;#39;. The inline forms&lt;br&gt;do show the &amp;#39;code&amp;#39; field for the child model instances, and the data&lt;br&gt;is in the formset&amp;#39;s querydict:&lt;br&gt;QueryDict &amp;lt;... u&amp;#39;childmodel_set-0-code&amp;#39;: [u&amp;#39;...&amp;#39;] ...&amp;gt;&lt;p&gt;However the table column name for the one-to-one relationship between&lt;br&gt;parent and child is called &amp;#39;parendmodel__ptr__id&amp;#39;, and the admin is&lt;br&gt;looking for &amp;#39;childmodel_set-0-parentmodel_ptr&amp;#39; in the formset data.&lt;br&gt;Why?&lt;p&gt;On Mon, Feb 13, 2012 at 10:43 AM, Demetrio Girardi&lt;br&gt;&amp;lt;&lt;a href="mailto:demetrio.girardi@gmail.com"&gt;demetrio.girardi@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; I have a child model that I wish edit inline in the admin site. When&lt;br&gt;&amp;gt; trying to save edits I get a MultiValueDictKeyError:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;quot;Key &amp;#39;childmodel_set-0-parentmodel_ptr&amp;#39; not found in &amp;lt;QueryDict: ..&amp;gt;&amp;quot;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; It seems to me the admin is trying to get the reference to the parent&lt;br&gt;&amp;gt; model from the form data. How can I fix this? Do I need a custom form?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8694310136023778799?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8694310136023778799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-admin-inline-for-inherited-model.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8694310136023778799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8694310136023778799'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-admin-inline-for-inherited-model.html' title='Re: Admin inline for inherited model cant find pointer to parent model'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2859385492321558927</id><published>2012-02-13T02:33:00.000-08:00</published><updated>2012-02-13T02:34:05.425-08:00</updated><title type='text'>Re: Comments form customization</title><content type='html'>Hey Fabio,&lt;br&gt;How do you get your comment form to display? Been fighting with this&lt;br&gt;for the past 5hrs. Please any idea? Thanks.&lt;p&gt;On Feb 13, 11:12&amp;#160;am, Fabio Natali &amp;lt;&lt;a href="mailto:fa...@fnstudio.it"&gt;fa...@fnstudio.it&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; On 02/13/2012 10:52 AM, Vovk Donets wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; It&amp;#39;s not really great solution, but maybe it will give you a hint: you&lt;br&gt;&amp;gt; &amp;gt; can add/remove fileds to the form on the fly. And for not logged in&lt;br&gt;&amp;gt; &amp;gt; users show all fields, but for authenticated only subset of the all form&lt;br&gt;&amp;gt; &amp;gt; fields.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Ehi Vladimir, thank you for your quick reply!&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I found a couple of interesting links.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &lt;a href="http://mitchfournier.com/2010/08/12/customizing-django-comments-remov...http://stackoverflow.com/questions/1456267/django-comments-want-to-re."&gt;http://mitchfournier.com/2010/08/12/customizing-django-comments-remov...http://stackoverflow.com/questions/1456267/django-comments-want-to-re.&lt;/a&gt;..&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; The first deals with writing your own comment templates, so to remove&lt;br&gt;&amp;gt; unnecessary fields (name, url, email).&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; The latter deals with writing your own custom comment form, no need to&lt;br&gt;&amp;gt; hack template stuff. This looks nicer to me, I think I&amp;#39;ll try it first.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Vladimir, is that the approach you meant?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I am still not sure this is the best solution for me. So, those of you&lt;br&gt;&amp;gt; who are listening, if you have any further advice/hint, don&amp;#39;t hesitate&lt;br&gt;&amp;gt; to email me! :-)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Cheers, Fabio.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Fabio Natali&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2859385492321558927?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2859385492321558927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_4040.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2859385492321558927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2859385492321558927'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_4040.html' title='Re: Comments form customization'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-478193100617321947</id><published>2012-02-13T02:12:00.001-08:00</published><updated>2012-02-13T02:12:43.709-08:00</updated><title type='text'>Re: Comments form customization</title><content type='html'>On 02/13/2012 10:52 AM, Vovk Donets wrote:&lt;br&gt;&amp;gt; It&amp;#39;s not really great solution, but maybe it will give you a hint: you&lt;br&gt;&amp;gt; can add/remove fileds to the form on the fly. And for not logged in&lt;br&gt;&amp;gt; users show all fields, but for authenticated only subset of the all form&lt;br&gt;&amp;gt; fields.&lt;p&gt;Ehi Vladimir, thank you for your quick reply!&lt;p&gt;I found a couple of interesting links.&lt;p&gt;&lt;a href="http://mitchfournier.com/2010/08/12/customizing-django-comments-remove-unwanted-fields/"&gt;http://mitchfournier.com/2010/08/12/customizing-django-comments-remove-unwanted-fields/&lt;/a&gt;&lt;br&gt;&lt;a href="http://stackoverflow.com/questions/1456267/django-comments-want-to-remove-user-url-not-expand-the-model-how-to/4766543#4766543"&gt;http://stackoverflow.com/questions/1456267/django-comments-want-to-remove-user-url-not-expand-the-model-how-to/4766543#4766543&lt;/a&gt;&lt;p&gt;The first deals with writing your own comment templates, so to remove &lt;br&gt;unnecessary fields (name, url, email).&lt;p&gt;The latter deals with writing your own custom comment form, no need to &lt;br&gt;hack template stuff. This looks nicer to me, I think I&amp;#39;ll try it first.&lt;p&gt;Vladimir, is that the approach you meant?&lt;p&gt;I am still not sure this is the best solution for me. So, those of you &lt;br&gt;who are listening, if you have any further advice/hint, don&amp;#39;t hesitate &lt;br&gt;to email me! :-)&lt;p&gt;Cheers, Fabio.&lt;p&gt;-- &lt;br&gt;Fabio Natali&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-478193100617321947?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/478193100617321947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/478193100617321947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/478193100617321947'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization_13.html' title='Re: Comments form customization'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8668685136734770621</id><published>2012-02-13T01:52:00.000-08:00</published><updated>2012-02-13T01:53:06.848-08:00</updated><title type='text'>Re: Comments form customization</title><content type='html'>It&amp;#39;s not really great solution, but maybe it will give you a hint: you can add/remove fileds to the form on the fly. And for not logged in users show all fields, but for authenticated only subset of the all form fields. &lt;br&gt; &lt;br&gt;&lt;div class="gmail_quote"&gt;2012/2/13 Fabio Natali &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:fabio@fnstudio.it"&gt;fabio@fnstudio.it&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt; Hi everybody,&lt;br&gt; &lt;br&gt; I am using comments app from contrib in Django 1.3.&lt;br&gt; &lt;br&gt; In my website I let only authenticated users to leave a comment so I&amp;#39;d like to get rid of those &amp;quot;name&amp;quot;, &amp;quot;email&amp;quot; and &amp;quot;url&amp;quot; fields that come with the standard comment form. Indeed, I already know the name and email of current logged user, there&amp;#39;s no need for the user to submit his/her name and email again.&lt;br&gt;  &lt;br&gt; So, I&amp;#39;d just like a FK field to the user that left the comment. More of that, I would like that field to be automatically populated while the user submit the comment.&lt;br&gt; &lt;br&gt; Could you give me some hints for such customization?&lt;br&gt; &lt;br&gt; Thank you very much,&lt;br&gt; Fabio.&lt;span class="HOEnZb"&gt;&lt;font color="#888888"&gt;&lt;br&gt; &lt;br&gt; -- &lt;br&gt; Fabio Natali&lt;br&gt; &lt;br&gt;&lt;/font&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;&lt;b&gt;&lt;span style="font-family:garamond,serif"&gt;Vovk Donets&lt;/span&gt;&lt;/b&gt;&lt;br&gt;&lt;span style="color:rgb(102,102,102)"&gt; &lt;font size="1"&gt;python developer&lt;/font&gt;&lt;/span&gt;&lt;div&gt;&lt;font color="#333333"&gt;&lt;br&gt; &lt;/font&gt; &lt;/div&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8668685136734770621?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8668685136734770621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8668685136734770621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8668685136734770621'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-comments-form-customization.html' title='Re: Comments form customization'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7199712114059879437</id><published>2012-02-13T01:50:00.000-08:00</published><updated>2012-02-13T04:07:50.064-08:00</updated><title type='text'>sqlite3 database error</title><content type='html'>Hey guys,&lt;p&gt;i am using sqlite3 for my django app. BUT I have problems installing&lt;br&gt;it. Here are my configs:&lt;p&gt;DATABASES = {&lt;br&gt;    &amp;#39;default&amp;#39;: {&lt;br&gt;        &amp;#39;ENGINE&amp;#39;: &amp;#39;django.db.backends.sqlite3&amp;#39;,  # Add&lt;br&gt;&amp;#39;postgresql_psycopg2&amp;#39;, &amp;#39;postgresql&amp;#39;, &amp;#39;mysql&amp;#39;, &amp;#39;sqlite3&amp;#39; or &amp;#39;oracle&amp;#39;.&lt;br&gt;        &amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\Maximus\Desktop\Webseite\Django\sqlite-shell-&lt;br&gt;win32-x86-3071000\test.db&amp;#39;,                      # Or path to database&lt;br&gt;file if using sqlite3.&lt;br&gt;        &amp;#39;USER&amp;#39;: &amp;#39;&amp;#39;,                      # Not used with sqlite3.&lt;br&gt;        &amp;#39;PASSWORD&amp;#39;: &amp;#39;&amp;#39;,                  # Not used with sqlite3.&lt;br&gt;        &amp;#39;HOST&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt;localhost. Not used with sqlite3.&lt;br&gt;        &amp;#39;PORT&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt;default. Not used with sqlite3.&lt;br&gt;    }&lt;br&gt;}&lt;p&gt;I tried this:&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; from django.db import connection&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cursor = connection.cursor()&lt;p&gt;But I got this error:&lt;p&gt;Traceback (most recent call last):&lt;br&gt;  File &amp;quot;&amp;lt;console&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br&gt;  File &amp;quot;C:\Python27\lib\site-packages\django\db\backends\__init__.py&amp;quot;,&lt;br&gt;line 250,&lt;br&gt; in cursor&lt;br&gt;    cursor = self.make_debug_cursor(self._cursor())&lt;br&gt;  File &amp;quot;C:\Python27\lib\site-packages\django\db\backends&lt;br&gt;\sqlite3\base.py&amp;quot;, line&lt;br&gt;207, in _cursor&lt;br&gt;    self.connection = Database.connect(**kwargs)&lt;br&gt;OperationalError: unable to open database file&lt;p&gt;Can sb pls help me?&lt;p&gt;greetings&lt;p&gt;Maximus&lt;p&gt;PS.: I created my sqlite3 file like that:&lt;p&gt;   &amp;gt;sqlite3 test.db&lt;br&gt;...&amp;gt;&lt;br&gt;...&amp;gt;&lt;br&gt;...&amp;gt;);&lt;br&gt;...&amp;gt;Syntax error&lt;br&gt;   &amp;gt;&lt;p&gt;Can sb show me a better way to create an empty sqlite3 db file?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7199712114059879437?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7199712114059879437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/sqlite3-database-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7199712114059879437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7199712114059879437'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/sqlite3-database-error.html' title='sqlite3 database error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3650943591452751032</id><published>2012-02-13T01:43:00.001-08:00</published><updated>2012-02-13T01:44:45.019-08:00</updated><title type='text'>Admin inline for inherited model cant find pointer to parent model</title><content type='html'>I have a child model that I wish edit inline in the admin site. When&lt;br&gt;trying to save edits I get a MultiValueDictKeyError:&lt;p&gt;&amp;quot;Key &amp;#39;childmodel_set-0-parentmodel_ptr&amp;#39; not found in &amp;lt;QueryDict: ..&amp;gt;&amp;quot;&lt;p&gt;It seems to me the admin is trying to get the reference to the parent&lt;br&gt;model from the form data. How can I fix this? Do I need a custom form?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3650943591452751032?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3650943591452751032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/admin-inline-for-inherited-model-cant.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3650943591452751032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3650943591452751032'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/admin-inline-for-inherited-model-cant.html' title='Admin inline for inherited model cant find pointer to parent model'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6364112274773956971</id><published>2012-02-13T01:43:00.000-08:00</published><updated>2012-02-13T01:44:30.898-08:00</updated><title type='text'>Comments form customization</title><content type='html'>Hi everybody,&lt;p&gt;I am using comments app from contrib in Django 1.3.&lt;p&gt;In my website I let only authenticated users to leave a comment so I&amp;#39;d &lt;br&gt;like to get rid of those &amp;quot;name&amp;quot;, &amp;quot;email&amp;quot; and &amp;quot;url&amp;quot; fields that come with &lt;br&gt;the standard comment form. Indeed, I already know the name and email of &lt;br&gt;current logged user, there&amp;#39;s no need for the user to submit his/her name &lt;br&gt;and email again.&lt;p&gt;So, I&amp;#39;d just like a FK field to the user that left the comment. More of &lt;br&gt;that, I would like that field to be automatically populated while the &lt;br&gt;user submit the comment.&lt;p&gt;Could you give me some hints for such customization?&lt;p&gt;Thank you very much,&lt;br&gt;Fabio.&lt;p&gt;-- &lt;br&gt;Fabio Natali&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6364112274773956971?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6364112274773956971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/comments-form-customization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6364112274773956971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6364112274773956971'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/comments-form-customization.html' title='Comments form customization'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-593173913589038346</id><published>2012-02-13T01:28:00.000-08:00</published><updated>2012-02-13T01:29:02.954-08:00</updated><title type='text'>Comment post not allowed (400)</title><content type='html'>Hey guys, when I include the django comments form in the template I&lt;br&gt;want to use it, After visting the page, I can only see &amp;quot;POST&amp;quot; and&lt;br&gt;&amp;quot;PREVIEW&amp;quot; button and the form itself is not showing. So I clicked on&lt;br&gt;the &amp;#39;POST&amp;quot; button to see what&amp;#39;s next.&lt;p&gt;After clicking it, I get this:&lt;p&gt;Comment post not allowed (400)&lt;br&gt;Why: 	Missing content_type or object_pk field.&lt;p&gt;The comment you tried to post to this view wasn&amp;#39;t saved because&lt;br&gt;something tampered with the security information in the comment form.&lt;br&gt;The message above should explain the problem, or you can check the&lt;br&gt;comment documentation for more help.&lt;p&gt;You&amp;#39;re seeing this error because you have DEBUG = True in your Django&lt;br&gt;settings file. Change that to False, and Django will display a&lt;br&gt;standard 400 error page.&lt;p&gt;Django Documents aint helping in this case. Please What I&amp;#39;m I missing?&lt;br&gt;below is the codes in my form.html&lt;p&gt;{% load comments i18n %}&lt;br&gt;&amp;lt;form action=&amp;quot;{% comment_form_target %}&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;{% csrf_token&lt;br&gt;%}&lt;br&gt;  {% if next %}&amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;next&amp;quot;&lt;br&gt;value=&amp;quot;{{ next }}&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;{% endif %}&lt;br&gt;  {% for field in form %}&lt;br&gt;    {% if field.is_hidden %}&lt;br&gt;      &amp;lt;div&amp;gt;{{ field }}&amp;lt;/div&amp;gt;&lt;br&gt;    {% else %}&lt;br&gt;      {% if field.errors %}{{ field.errors }}{% endif %}&lt;br&gt;      &amp;lt;p&lt;br&gt;        {% if field.errors %} class=&amp;quot;error&amp;quot;{% endif %}&lt;br&gt;        {% ifequal &lt;a href="http://field.name"&gt;field.name&lt;/a&gt; &amp;quot;honeypot&amp;quot; %} style=&amp;quot;display:none;&amp;quot;{%&lt;br&gt;endifequal %}&amp;gt;&lt;br&gt;        {{ field.label_tag }} {{ field }}&lt;br&gt;      &amp;lt;/p&amp;gt;&lt;br&gt;    {% endif %}&lt;br&gt;  {% endfor %}&lt;br&gt;  &amp;lt;p class=&amp;quot;submit&amp;quot;&amp;gt;&lt;br&gt;    &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;post&amp;quot; class=&amp;quot;submit-post&amp;quot; value=&amp;quot;{%&lt;br&gt;trans &amp;quot;Post&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;    {# &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;preview&amp;quot; class=&amp;quot;submit-preview&amp;quot;&lt;br&gt;value=&amp;quot;{% trans &amp;quot;Preview&amp;quot; %}&amp;quot; /&amp;gt; #}&lt;br&gt;  &amp;lt;/p&amp;gt;&lt;br&gt;&amp;lt;/form&amp;gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-593173913589038346?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/593173913589038346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/comment-post-not-allowed-400.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/593173913589038346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/593173913589038346'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/comment-post-not-allowed-400.html' title='Comment post not allowed (400)'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3971903211234091514</id><published>2012-02-13T01:09:00.000-08:00</published><updated>2012-02-13T01:27:05.271-08:00</updated><title type='text'>Database test error</title><content type='html'>Hello, I still get this error:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Traceback (most recent call last):&lt;/div&gt;&lt;div&gt;  File &amp;quot;manage.py&amp;quot;, line 14, in &amp;lt;module&amp;gt;&lt;/div&gt;&lt;div&gt;    execute_manager(settings)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py&amp;quot;, line 438, in execute_manager&lt;/div&gt;  &lt;div&gt;    utility.execute()&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py&amp;quot;, line 379, in execute&lt;/div&gt;&lt;div&gt;    self.fetch_command(subcommand).run_from_argv(self.argv)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/core/management/base.py&amp;quot;, line 191, in run_from_argv&lt;/div&gt;&lt;div&gt;    self.execute(*args, **options.__dict__)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/core/management/base.py&amp;quot;, line 220, in execute&lt;/div&gt;  &lt;div&gt;    output = self.handle(*args, **options)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/south/management/commands/test.py&amp;quot;, line 8, in handle&lt;/div&gt;&lt;div&gt;    super(Command, self).handle(*args, **kwargs)&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/core/management/commands/test.py&amp;quot;, line 37, in handle&lt;/div&gt;&lt;div&gt;    failures = test_runner.run_tests(test_labels)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/test/simple.py&amp;quot;, line 358, in run_tests&lt;/div&gt;  &lt;div&gt;    suite = self.build_suite(test_labels, extra_tests)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/test/simple.py&amp;quot;, line 248, in build_suite&lt;/div&gt;&lt;div&gt;    suite.addTest(build_suite(app))&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/test/simple.py&amp;quot;, line 77, in build_suite&lt;/div&gt;&lt;div&gt;    test_module = get_tests(app_module)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/test/simple.py&amp;quot;, line 35, in get_tests&lt;/div&gt;  &lt;div&gt;    test_module = __import__(&amp;#39;.&amp;#39;.join(app_path + [TEST_MODULE]), {}, {}, TEST_MODULE)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/quests/tests.py&amp;quot;, line 9, in &amp;lt;module&amp;gt;&lt;/div&gt;&lt;div&gt;    from views_web import *&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/quests/views_web.py&amp;quot;, line 6, in &amp;lt;module&amp;gt;&lt;/div&gt;&lt;div&gt;    from quests import views_generic&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/quests/views_generic.py&amp;quot;, line 3, in &amp;lt;module&amp;gt;&lt;/div&gt;  &lt;div&gt;    from quests.forms import *&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/quests/forms.py&amp;quot;, line 487, in &amp;lt;module&amp;gt;&lt;/div&gt;&lt;div&gt;    class SearchQuestForm(forms.Form):&lt;/div&gt;&lt;div&gt;  File &amp;quot;/home/xino/workspace/unnamedapp/quests/forms.py&amp;quot;, line 494, in SearchQuestForm&lt;/div&gt;  &lt;div&gt;    [CATEGORY_CHOICES.append((&lt;a href="http://c.id"&gt;c.id&lt;/a&gt;, &lt;a href="http://c.name"&gt;c.name&lt;/a&gt;)) for c in Category.objects.all()]    &lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/db/models/query.py&amp;quot;, line 107, in _result_iter&lt;/div&gt;  &lt;div&gt;    self._fill_cache()&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/db/models/query.py&amp;quot;, line 772, in _fill_cache&lt;/div&gt;&lt;div&gt;    self._result_cache.append(self._iter.next())&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/db/models/query.py&amp;quot;, line 273, in iterator&lt;/div&gt;  &lt;div&gt;    for row in compiler.results_iter():&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py&amp;quot;, line 680, in results_iter&lt;/div&gt;&lt;div&gt;    for rows in self.execute_sql(MULTI):&lt;/div&gt;  &lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py&amp;quot;, line 735, in execute_sql&lt;/div&gt;&lt;div&gt;    cursor.execute(sql, params)&lt;/div&gt;&lt;div&gt;  File &amp;quot;/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py&amp;quot;, line 234, in execute&lt;/div&gt;  &lt;div&gt;    return Database.Cursor.execute(self, query, params)&lt;/div&gt;&lt;div&gt;django.db.utils.DatabaseError: no such table: quests_category&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The problem es the order that django creates the tables in the database. Can I change this?&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;Gràcies,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Rubén&lt;/div&gt;&lt;br&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3971903211234091514?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3971903211234091514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/database-test-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3971903211234091514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3971903211234091514'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/database-test-error.html' title='Database test error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7249017231138215200</id><published>2012-02-12T23:53:00.000-08:00</published><updated>2012-02-12T23:54:18.697-08:00</updated><title type='text'>Re: same code runs on two machines and barfs on the third [solved]</title><content type='html'>On Wed, 2012-02-08 at 12:45 +0530, kenneth gonsalves wrote:&lt;br&gt;&amp;gt; On Tue, 2012-02-07 at 19:29 +1100, Mike Dewhirst wrote:&lt;br&gt;&amp;gt; &amp;gt; On 7/02/2012 6:14pm, kenneth gonsalves wrote:&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; On Tue, 2012-02-07 at 08:06 +0100, Babatunde Akinyanmi wrote:&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;&amp;gt; Perhaps you made a change to a model and forgot to syncdb on your&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;&amp;gt; Fedora 15 machine.....&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &lt;br&gt;&amp;gt; &amp;gt; When you have eliminated all the possibilities what remains must be&lt;br&gt;&amp;gt; &amp;gt; the &lt;br&gt;&amp;gt; &amp;gt; problem :)&lt;br&gt;&amp;gt; &amp;gt; &lt;br&gt;&amp;gt; &amp;gt; The trick is to confirm your assumptions one by one.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; code: all three machines are running code pulled from the same repo.&lt;br&gt;&amp;gt; django version: all three are on r 17461&lt;br&gt;&amp;gt; database: the table structure on all three is identical. (in fact two&lt;br&gt;&amp;gt; machines have the same data also). Postgresql versions differ, but&lt;br&gt;&amp;gt; this&lt;br&gt;&amp;gt; is a django error - not a database error.&lt;br&gt;&amp;gt; The offending line of code worked fine on the F15 machine when it was&lt;br&gt;&amp;gt; running F14&lt;br&gt;&amp;gt; Altitude: two of the machines are at 7200 feet above sea level, but&lt;br&gt;&amp;gt; the&lt;br&gt;&amp;gt; offending machine is at 3400 feet. &lt;p&gt;I finally deleted the whole django-trunk and made a fresh svn checkout.&lt;br&gt;Then it works. Must have been some stale .pyc file or some file got&lt;br&gt;corrupted.&lt;br&gt;-- &lt;br&gt;regards&lt;br&gt;Kenneth Gonsalves&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7249017231138215200?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7249017231138215200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-same-code-runs-on-two-machines-and_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7249017231138215200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7249017231138215200'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-same-code-runs-on-two-machines-and_12.html' title='Re: same code runs on two machines and barfs on the third [solved]'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7380412506542735541</id><published>2012-02-12T23:02:00.001-08:00</published><updated>2012-02-12T23:02:38.708-08:00</updated><title type='text'>django-admin.py startproject doesn't work</title><content type='html'>I have windows7 OS and have installed Python27 and Django1.3.1&lt;br&gt;I have also set the path in the environment variables to: C:&lt;br&gt;\Python27\;C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib&lt;br&gt;\site-packages\django\bin&lt;p&gt;Commands like python and import django works well but&lt;br&gt;when i try creating a new project I get the following error:&lt;p&gt;C:\Python27\Django-1.3.1&amp;gt;django-admin.py startproject mysite&lt;br&gt;&amp;#39;django-admin.py&amp;#39; is not recognized as an internal or external&lt;br&gt;command,&lt;br&gt;operable program or batch file.&lt;p&gt;C:\Python27\Django-1.3.1&amp;gt;&lt;p&gt;Please help!!!&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7380412506542735541?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7380412506542735541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-adminpy-startproject-doesnt-work.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7380412506542735541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7380412506542735541'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-adminpy-startproject-doesnt-work.html' title='django-admin.py startproject doesn&apos;t work'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5197929103882484559</id><published>2012-02-12T22:54:00.000-08:00</published><updated>2012-02-12T22:55:10.189-08:00</updated><title type='text'>Re: Django Comments Form not Displaying</title><content type='html'>Thanks guys. @matias I tried your solution, and the post button&lt;br&gt;appeared. After clicking on it, I get &amp;#39;COMMENT POST NOT ALLOWED (404)&amp;#39;&lt;br&gt;Please whats wrong?&lt;p&gt;&lt;p&gt;On Feb 12, 4:37&amp;#160;pm, Mat&amp;#237;as Aguirre &amp;lt;&lt;a href="mailto:matiasagui...@gmail.com"&gt;matiasagui...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Excerpts from Michael P. Soulier&amp;#39;s message of 2012-02-12 14:16:26 -0200:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; On 12/02/12 coded kid said:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Below is the codes in my comments/form.html&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; {% load comments i18n %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;lt;form action=&amp;quot;{% comment_form_target %}&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;{% csrf_token&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; {% if next %}&amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;next&amp;quot;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; value=&amp;quot;{{ next }}&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;{% endif %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; {% for field in form %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; {% if field.is_hidden %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;lt;div&amp;gt;{{ field }}&amp;lt;/div&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; {% else %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; {% if field.errors %}{{ field.errors }}{% endif %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;lt;p&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; {% if field.errors %} class=&amp;quot;error&amp;quot;{% endif %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; {% ifequal &lt;a href="http://field.name"&gt;field.name&lt;/a&gt; &amp;quot;honeypot&amp;quot; %} style=&amp;quot;display:none;&amp;quot;{%&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; endifequal %}&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; {{ field.label_tag }} {{ field }}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;lt;/p&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; {% endif %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; {% endfor %}&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;lt;p class=&amp;quot;submit&amp;quot;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;post&amp;quot; class=&amp;quot;submit-post&amp;quot; value=&amp;quot;{%&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; trans &amp;quot;Post&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;preview&amp;quot; class=&amp;quot;submit-preview&amp;quot;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; value=&amp;quot;{% trans &amp;quot;Preview&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;lt;/p&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;lt;/form&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; You have conditionals on all output. If you&amp;#39;re seeing a blank page, perhaps&lt;br&gt;&amp;gt; &amp;gt; those conditionals are all false. Put in some unconditional content and see if&lt;br&gt;&amp;gt; &amp;gt; it renders, and then start testing your conditionals.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;quot;/comments/post&amp;quot; is decorated by require_POST, that means that POST is the only&lt;br&gt;&amp;gt; method allowed to access that view, check your response, you should be getting&lt;br&gt;&amp;gt; a 405 response.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; You should include the form in the page you want it to display, let&amp;#39;s say&lt;br&gt;&amp;gt; a blog post page, but if you want the form on a single page, then you need to&lt;br&gt;&amp;gt; define a different URL and view to render the template.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Regards,&lt;br&gt;&amp;gt; Mat&amp;#237;as&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Mat&amp;#237;as Aguirre (&lt;a href="mailto:matiasagui...@gmail.com"&gt;matiasagui...@gmail.com&lt;/a&gt;)&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5197929103882484559?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5197929103882484559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-comments-form-not-displaying_2599.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5197929103882484559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5197929103882484559'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-comments-form-not-displaying_2599.html' title='Re: Django Comments Form not Displaying'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1428412879504031417</id><published>2012-02-12T22:47:00.001-08:00</published><updated>2012-02-12T22:47:55.028-08:00</updated><title type='text'>complete for dropdown box in admin</title><content type='html'>hi,&lt;p&gt;I need a widget in admin to autoselect (I do not know what it is called)&lt;br&gt;a foreign key - that is if I type &amp;#39;f&amp;#39; it goes to the first occurrence of&lt;br&gt;&amp;#39;f&amp;#39; and so on. I hope I am clear.&lt;br&gt;-- &lt;br&gt;regards&lt;br&gt;Kenneth Gonsalves&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1428412879504031417?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1428412879504031417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/complete-for-dropdown-box-in-admin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1428412879504031417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1428412879504031417'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/complete-for-dropdown-box-in-admin.html' title='complete for dropdown box in admin'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4393124912180612602</id><published>2012-02-12T18:37:00.000-08:00</published><updated>2012-02-12T18:40:59.526-08:00</updated><title type='text'>Re: Thread timeout</title><content type='html'>On Sun, 12 Feb 2012 18:30:41 -0300, Phyllipe Medeiros&lt;br&gt;&amp;lt;&lt;a href="mailto:phyllipecesar@gmail.com"&gt;phyllipecesar@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&amp;gt;Then I have a view that calls Teste().start(), the message that I receive&lt;br&gt;&amp;gt;on error log is only &amp;quot;BEGIN&amp;quot;.&lt;br&gt;&amp;gt;But if I do no use a thread, the &amp;quot;error log&amp;quot; will work correctly &amp;quot;Begin,&lt;br&gt;&amp;gt;PASSED SLEEP&amp;quot; and &amp;quot;OUT&amp;quot;.&lt;br&gt;&amp;gt;I think it is something related to Apache2/Mod_wsgi or even permissions in&lt;br&gt;&amp;gt;my system, because if run it with sudo using runserver it will work&lt;br&gt;&amp;gt;perfectly.&lt;br&gt;&amp;gt;In my house it works perfectly too.&lt;p&gt;	And what happens if, in your view, you replace&lt;p&gt;		Teste().start()&lt;p&gt;with&lt;p&gt;		t = Teste()&lt;br&gt;		t.start()&lt;br&gt;		t.join()&lt;p&gt;?&lt;p&gt;	&amp;quot;runserver&amp;quot; is a continuously running Python program, as I recall&lt;br&gt;and your application essentially runs within it. Apache/mod_wsgi (based&lt;br&gt;on &lt;a href="http://code.google.com/p/modwsgi/"&gt;http://code.google.com/p/modwsgi/&lt;/a&gt; ) apparently can be configured in&lt;br&gt;two modes. I suspect one of those modes is seeing the application&lt;br&gt;&amp;quot;shutting down&amp;quot; before it captures the output (Or... it receives the&lt;br&gt;&amp;quot;begin&amp;quot; output, and then nothing for a period of time, and may presume&lt;br&gt;the process is hung or has no further output). Using .join() would, at&lt;br&gt;the least, keep the main process from initiating shutdown until the&lt;br&gt;thread completes (this could be an alternative hypothesis -- the main&lt;br&gt;process starts shutdown, closing stdout /before/ waiting for the thread&lt;br&gt;to complete)&lt;br&gt;-- &lt;br&gt;	Wulfraed                 Dennis Lee Bieber         AF6VN&lt;br&gt;        &lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;    &lt;a href="HTTP://wlfraed.home.netcom.com/"&gt;HTTP://wlfraed.home.netcom.com/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4393124912180612602?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4393124912180612602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-thread-timeout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4393124912180612602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4393124912180612602'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-thread-timeout.html' title='Re: Thread timeout'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7578763138194140483</id><published>2012-02-12T15:54:00.000-08:00</published><updated>2012-02-12T15:55:01.793-08:00</updated><title type='text'>Re: Problem with encoding in unit tests</title><content type='html'>How did you get the name into your fixtures? Did you type it in &lt;br&gt;manually, or enter it in Django admin and then use dumpdata?&lt;p&gt;It looks like the value in your fixtures got its encoding mangled. It &lt;br&gt;should work properly if the unicode is correct in your database and you &lt;br&gt;use manage.py dumpdata to dump it to json.&lt;p&gt;If none of this helps, please post the relevant portion of your fixtures.&lt;p&gt;&lt;br&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7578763138194140483?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7578763138194140483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-problem-with-encoding-in-unit-tests.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7578763138194140483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7578763138194140483'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-problem-with-encoding-in-unit-tests.html' title='Re: Problem with encoding in unit tests'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1453252115820992188</id><published>2012-02-12T14:51:00.000-08:00</published><updated>2012-02-12T14:52:04.962-08:00</updated><title type='text'>Django Gigs - Why so few gigs?</title><content type='html'>A year or so (may be more) back when I looked at Django Gigs and there&lt;br&gt;were quite a lot of gigs( I mean in 100s). After a while I checked&lt;br&gt;again today just to see how the market is doing and I see very few&lt;br&gt;jobs on django gigs.&lt;p&gt;What happened, what changed?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1453252115820992188?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1453252115820992188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-gigs-why-so-few-gigs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1453252115820992188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1453252115820992188'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-gigs-why-so-few-gigs.html' title='Django Gigs - Why so few gigs?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2547895798890123320</id><published>2012-02-12T14:44:00.000-08:00</published><updated>2012-02-12T14:46:42.318-08:00</updated><title type='text'>Problem with encoding in unit tests</title><content type='html'>Hi everyone,&lt;p&gt;I am having some problems with unit tests in Django.&lt;p&gt;If I run this code in the django shell, I got the expected result:&lt;br&gt;In [2]: actividades = ActividadExtracurricular.objects.order_by(&amp;quot;id&amp;quot;)&lt;p&gt;In [3]: print (actividades[1].nombre == u&amp;quot;So&amp;#241;ar despierto&amp;quot;,&lt;br&gt;actividades[1].nombre)&lt;br&gt;Out[3]: (True, u&amp;#39;So\xc3\xb1ar despierto&amp;#39;)&lt;p&gt;But when I put the same code in the tests.py file, the following&lt;br&gt;happens:&lt;br&gt;Creating test database for alias &amp;#39;default&amp;#39;...&lt;br&gt;(False, u&amp;#39;So\xc3\xb1ar despierto&amp;#39;)&lt;p&gt;Does anyone know how to solve this problem?&lt;p&gt;Thanks in advance =),&lt;br&gt;David G&amp;#243;mez.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2547895798890123320?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2547895798890123320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/problem-with-encoding-in-unit-tests.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2547895798890123320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2547895798890123320'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/problem-with-encoding-in-unit-tests.html' title='Problem with encoding in unit tests'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6103595442875497020</id><published>2012-02-12T14:37:00.001-08:00</published><updated>2012-02-12T14:37:59.509-08:00</updated><title type='text'>Re: [modwsgi] Thread timeout</title><content type='html'>On 13 February 2012 08:30, Phyllipe Medeiros &amp;lt;&lt;a href="mailto:phyllipecesar@gmail.com"&gt;phyllipecesar@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; I have made this class:&lt;br&gt;&amp;gt; &amp;quot;class Teste(Thread):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; def __init__(self):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; Thread.__init__(self)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; def run(self):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; try:&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; print &amp;quot;Begin&amp;quot;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; from httplib2 import Http&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; import time&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; time.sleep(20)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; print &amp;quot;PASSED SLEEP&amp;quot;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; response, content = Http().request(&amp;quot;&lt;a href="http://www.spoj.pl"&gt;http://www.spoj.pl&lt;/a&gt;&amp;quot;)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; print &amp;quot;OUT&amp;quot;&lt;br&gt;&amp;gt; except:&lt;p&gt;Within the except add:&lt;p&gt;  import sys&lt;br&gt;  import traceback&lt;br&gt;  traceback.print_exception(*sys.exc_info())&lt;p&gt;If you aren&amp;#39;t going to re raise the exception, then how else are you&lt;br&gt;going to know what the actual problem is.&lt;p&gt;Graham&lt;p&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; print &amp;quot;EXCEPTION :(&amp;quot;&lt;br&gt;&amp;gt; &amp;quot;&lt;br&gt;&amp;gt; Then I have a view that calls Teste().start(), the message that I receive on&lt;br&gt;&amp;gt; error log is only &amp;quot;BEGIN&amp;quot;.&lt;br&gt;&amp;gt; But if I do no use a thread, the &amp;quot;error log&amp;quot; will work correctly &amp;quot;Begin,&lt;br&gt;&amp;gt; PASSED SLEEP&amp;quot; and &amp;quot;OUT&amp;quot;.&lt;br&gt;&amp;gt; I think it is something related to Apache2/Mod_wsgi or even permissions in&lt;br&gt;&amp;gt; my system, because if run it with sudo using runserver it will work&lt;br&gt;&amp;gt; perfectly.&lt;br&gt;&amp;gt; In my house it works perfectly too.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;quot;modwsgi&amp;quot; group.&lt;br&gt;&amp;gt; To post to this group, send email to &lt;a href="mailto:modwsgi@googlegroups.com"&gt;modwsgi@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &lt;a href="mailto:modwsgi%2Bunsubscribe@googlegroups.com"&gt;modwsgi+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &lt;a href="http://groups.google.com/group/modwsgi?hl=en"&gt;http://groups.google.com/group/modwsgi?hl=en&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6103595442875497020?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6103595442875497020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-thread-timeout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6103595442875497020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6103595442875497020'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-thread-timeout.html' title='Re: [modwsgi] Thread timeout'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4928088989418416685</id><published>2012-02-12T13:30:00.000-08:00</published><updated>2012-02-12T13:31:24.695-08:00</updated><title type='text'>Thread timeout</title><content type='html'>I have made this class:&lt;div&gt;&amp;quot;class Teste(Thread):&lt;/div&gt;&lt;div&gt;    def __init__(self):&lt;/div&gt;&lt;div&gt;        Thread.__init__(self)&lt;/div&gt;&lt;div&gt;    def run(self):&lt;/div&gt;&lt;div&gt;        try:&lt;/div&gt;&lt;div&gt;            print &amp;quot;Begin&amp;quot;&lt;/div&gt; &lt;div&gt;            from httplib2 import Http&lt;/div&gt;&lt;div&gt;            import time&lt;/div&gt;&lt;div&gt;            time.sleep(20)&lt;/div&gt;&lt;div&gt;            print &amp;quot;PASSED SLEEP&amp;quot;&lt;/div&gt;&lt;div&gt;            response, content = Http().request(&amp;quot;&lt;a href="http://www.spoj.pl"&gt;http://www.spoj.pl&lt;/a&gt;&amp;quot;)&lt;/div&gt; &lt;div&gt;            print &amp;quot;OUT&amp;quot;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;except:&lt;/div&gt;&lt;div&gt;            print &amp;quot;EXCEPTION :(&amp;quot;&lt;/div&gt;&lt;div&gt;&amp;quot;&lt;/div&gt;&lt;div&gt;Then I have a view that calls Teste().start(), the message that I receive on error log is only &amp;quot;BEGIN&amp;quot;.&lt;/div&gt; &lt;div&gt;But if I do no use a thread, the &amp;quot;error log&amp;quot; will work correctly &amp;quot;Begin, PASSED SLEEP&amp;quot; and &amp;quot;OUT&amp;quot;.&lt;/div&gt;&lt;div&gt;I think it is something related to Apache2/Mod_wsgi or even permissions in my system, because if run it with sudo using runserver it will work perfectly.&lt;/div&gt; &lt;div&gt;In my house it works perfectly too.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4928088989418416685?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4928088989418416685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/thread-timeout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4928088989418416685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4928088989418416685'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/thread-timeout.html' title='Thread timeout'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5619530699652767629</id><published>2012-02-12T13:25:00.001-08:00</published><updated>2012-02-12T13:25:55.354-08:00</updated><title type='text'>Re: accessing foreign key value in template select related</title><content type='html'>sorry left something out which was actually causing the lookup to&lt;br&gt;fail. I have overidden the Select that gets given by default with a&lt;br&gt;foreign key to a CharField for ajax autocomple.&lt;br&gt;So i guess is how to i get the relationship lookup to work with the&lt;br&gt;select changed to a CharField?&lt;p&gt;class ProfileEditForm(ModelForm):&lt;br&gt;    city_id = forms.CharField(max_length=200,required=False)&lt;p&gt;    class Meta:&lt;br&gt;        model = UserProfile&lt;p&gt;On Feb 12, 8:32&amp;#160;pm, richard &amp;lt;&lt;a href="mailto:pullenjenn...@gmail.com"&gt;pullenjenn...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hi i have a UserProfile that has a city_id as a foreign key to cities&lt;br&gt;&amp;gt; table. when i use {{ profile_edit_form.city_id}} in the template i get&lt;br&gt;&amp;gt; the id of the city that is stored in my userprofile showing as the&lt;br&gt;&amp;gt; value instead of the city name. Would the select related fix this&lt;br&gt;&amp;gt; issue and lookup the city name form the city table based on the city&lt;br&gt;&amp;gt; id in the userprofile? ive tried useing select related on my queries&lt;br&gt;&amp;gt; but it gives me an error saying userprofile has no select related. any&lt;br&gt;&amp;gt; help would be much appreciated.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; code&lt;br&gt;&amp;gt; models.py&lt;br&gt;&amp;gt; #this class was genrated using inspectdb&lt;br&gt;&amp;gt; class Cities(models.Model):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; id = models.IntegerField(primary_key=True, db_column=&amp;#39;ID&amp;#39;) # Field&lt;br&gt;&amp;gt; name made lowercase.&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; country = models.CharField(unique=True, max_length=6)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; region = models.CharField(unique=True, max_length=9)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; url = models.CharField(max_length=150)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; name = models.CharField(unique=True, max_length=150)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; latitude = models.FloatField()&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; longitude = models.FloatField()&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; class Meta:&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; db_table = u&amp;#39;cities&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; class UserProfile(models.Model):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; user = models.OneToOneField(User)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; city_id =&lt;br&gt;&amp;gt; models.ForeignKey(Cities,blank=True,db_column=&amp;#39;city_id&amp;#39;)#tried adding&lt;br&gt;&amp;gt; this too related_name=&amp;#39;cities&amp;#39;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; forms.py&lt;br&gt;&amp;gt; class ProfileEditForm(ModelForm):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; class Meta:&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; model = UserProfile&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; views.py&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; def edit(request):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; c = {}&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; c.update(csrf(request))&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; profile_edit_form =&lt;br&gt;&amp;gt; ProfileEditForm(instance=request.user.get_profile()) #tried&lt;br&gt;&amp;gt; adding .select_related() here&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; if request.method == &amp;quot;POST&amp;quot;:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; profile_edit_form =&lt;br&gt;&amp;gt; ProfileEditForm(request.POST,request.FILES,instance=request.user.get_profile())&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if profile_edit_form.is_valid():&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; p = profile_edit_form.save()&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; city = Cities.objects.get(pk=request.POST[&amp;#39;cid&amp;#39;])&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; p.city_id = city&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; p.save()&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; c[&amp;#39;profile_edit_form&amp;#39;] = profile_edit_form&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; return render_to_response(&amp;#39;profile/edit.html&amp;#39;, c,&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;context_instance=RequestContext(request))&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; template&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; in my template {{ profile_edit_form }} #shows the city id not the&lt;br&gt;&amp;gt; actual city name refered to by the id ?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; thanks&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5619530699652767629?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5619530699652767629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-accessing-foreign-key-value-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5619530699652767629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5619530699652767629'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-accessing-foreign-key-value-in.html' title='Re: accessing foreign key value in template select related'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-174784381074940984</id><published>2012-02-12T12:32:00.000-08:00</published><updated>2012-02-12T12:33:31.448-08:00</updated><title type='text'>accessing foreign key value in template select related</title><content type='html'>Hi i have a UserProfile that has a city_id as a foreign key to cities&lt;br&gt;table. when i use {{ profile_edit_form.city_id}} in the template i get&lt;br&gt;the id of the city that is stored in my userprofile showing as the&lt;br&gt;value instead of the city name. Would the select related fix this&lt;br&gt;issue and lookup the city name form the city table based on the city&lt;br&gt;id in the userprofile? ive tried useing select related on my queries&lt;br&gt;but it gives me an error saying userprofile has no select related. any&lt;br&gt;help would be much appreciated.&lt;p&gt;code&lt;br&gt;models.py&lt;br&gt;#this class was genrated using inspectdb&lt;br&gt;class Cities(models.Model):&lt;br&gt;    id = models.IntegerField(primary_key=True, db_column=&amp;#39;ID&amp;#39;) # Field&lt;br&gt;name made lowercase.&lt;br&gt;    country = models.CharField(unique=True, max_length=6)&lt;br&gt;    region = models.CharField(unique=True, max_length=9)&lt;br&gt;    url = models.CharField(max_length=150)&lt;br&gt;    name = models.CharField(unique=True, max_length=150)&lt;br&gt;    latitude = models.FloatField()&lt;br&gt;    longitude = models.FloatField()&lt;br&gt;    class Meta:&lt;br&gt;        db_table = u&amp;#39;cities&lt;p&gt;class UserProfile(models.Model):&lt;br&gt;    user = models.OneToOneField(User)&lt;br&gt;    city_id =&lt;br&gt;models.ForeignKey(Cities,blank=True,db_column=&amp;#39;city_id&amp;#39;)#tried adding&lt;br&gt;this too related_name=&amp;#39;cities&amp;#39;&lt;p&gt;forms.py&lt;br&gt;class ProfileEditForm(ModelForm):&lt;br&gt;    class Meta:&lt;br&gt;        model = UserProfile&lt;p&gt;views.py&lt;p&gt;def edit(request):&lt;br&gt;    c = {}&lt;br&gt;    c.update(csrf(request))&lt;br&gt;    profile_edit_form =&lt;br&gt;ProfileEditForm(instance=request.user.get_profile()) #tried&lt;br&gt;adding .select_related() here&lt;br&gt;    if request.method == &amp;quot;POST&amp;quot;:&lt;p&gt;        profile_edit_form =&lt;br&gt;ProfileEditForm(request.POST,request.FILES,instance=request.user.get_profile())&lt;br&gt;        if profile_edit_form.is_valid():&lt;br&gt;            p = profile_edit_form.save()&lt;br&gt;            city = Cities.objects.get(pk=request.POST[&amp;#39;cid&amp;#39;])&lt;br&gt;            p.city_id = city&lt;br&gt;            p.save()&lt;p&gt;    c[&amp;#39;profile_edit_form&amp;#39;] = profile_edit_form&lt;br&gt;    return render_to_response(&amp;#39;profile/edit.html&amp;#39;, c,&lt;br&gt;           context_instance=RequestContext(request))&lt;p&gt;template&lt;p&gt;in my template {{ profile_edit_form }} #shows the city id not the&lt;br&gt;actual city name refered to by the id ?&lt;p&gt;thanks&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-174784381074940984?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/174784381074940984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/accessing-foreign-key-value-in-template.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/174784381074940984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/174784381074940984'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/accessing-foreign-key-value-in-template.html' title='accessing foreign key value in template select related'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2453310493583460502</id><published>2012-02-12T12:15:00.000-08:00</published><updated>2012-02-12T12:16:30.778-08:00</updated><title type='text'>Re: is my UserProfile ManyToMany wrong?</title><content type='html'>Thanks Patrick and Daniel i got it working with adding the unicode&lt;br&gt;method. much appreciated.&lt;p&gt;&lt;br&gt;On Feb 12, 3:49&amp;#160;pm, Patrick Wellever &amp;lt;&lt;a href="mailto:pwelle...@gmail.com"&gt;pwelle...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hi,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Is that code all that&amp;#39;s in your model classes, or just an excerpt? If you&lt;br&gt;&amp;gt; don&amp;#39;t already have a __unicode__() method defined on your model, I think&lt;br&gt;&amp;gt; that would cause the problem you are referring to. That method would be&lt;br&gt;&amp;gt; called by Django in various places, wherever it needs to represent a model&lt;br&gt;&amp;gt; object as a string.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Try:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; class Interests(models.Model):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160;# eg hockey, gaming, etc&lt;br&gt;&amp;gt; &amp;#160; &amp;#160;interest = models.CharField(max_length=100)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160;class Meta:&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;db_table = u&amp;#39;interests&amp;#39;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; def __unicode__(self):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; return self.interest&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Hope that&amp;#39;s helpful.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Best,&lt;br&gt;&amp;gt; Patrick&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Sun, Feb 12, 2012 at 6:06 AM, richard &amp;lt;&lt;a href="mailto:pullenjenn...@gmail.com"&gt;pullenjenn...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; &amp;gt; Hi im having difficulty looping over my mantomany in my template. A&lt;br&gt;&amp;gt; &amp;gt; user has a 1to1 with UserProfile and the UserProfile has a manytomany&lt;br&gt;&amp;gt; &amp;gt; with interests. But displaying the form field without looping over it&lt;br&gt;&amp;gt; &amp;gt; displays a model multiple select with just a list of object result&lt;br&gt;&amp;gt; &amp;gt; sets. displaying interests object in the list.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; code&lt;br&gt;&amp;gt; &amp;gt; models.py&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; class Interests(models.Model):&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160;# eg hockey, gaming, etc&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160;interest = models.CharField(max_length=100)&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160;class Meta:&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160;db_table = u&amp;#39;interests&amp;#39;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; class UserProfile(models.Model):&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160;user = models.OneToOneField(User)&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160;interests = models.ManyToManyField(Interests)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; ...&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2453310493583460502?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2453310493583460502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-is-my-userprofile-manytomany-wrong_2948.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2453310493583460502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2453310493583460502'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-is-my-userprofile-manytomany-wrong_2948.html' title='Re: is my UserProfile ManyToMany wrong?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5502858792115883748</id><published>2012-02-12T11:03:00.000-08:00</published><updated>2012-02-12T11:04:26.580-08:00</updated><title type='text'>Re: is my UserProfile ManyToMany wrong?</title><content type='html'>On Sunday, 12 February 2012 11:06:32 UTC, richard  wrote:&lt;blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"&gt;Hi im having difficulty looping over my mantomany in my template. A &lt;br&gt;user has a 1to1 with UserProfile and the UserProfile has a manytomany &lt;br&gt;with interests. But displaying the form field without looping over it &lt;br&gt;displays a model multiple select with just a list of object result &lt;br&gt;sets. displaying interests object in the list. &lt;br&gt; &lt;br&gt;code &lt;br&gt;models.py &lt;br&gt; &lt;br&gt;class Interests(models.Model): &lt;br&gt;&amp;nbsp; &amp;nbsp; # eg hockey, gaming, etc &lt;br&gt;&amp;nbsp; &amp;nbsp; interest = models.CharField(max_length=&lt;wbr&gt;100) &lt;br&gt;&amp;nbsp; &amp;nbsp; class Meta: &lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; db_table = u'interests' &lt;br&gt; &lt;br&gt;class UserProfile(models.Model): &lt;br&gt;&amp;nbsp; &amp;nbsp; user = models.OneToOneField(User) &lt;br&gt;&amp;nbsp; &amp;nbsp; interests = models.ManyToManyField(&lt;wbr&gt;Interests) &lt;br&gt; &lt;br&gt;forms.py &lt;br&gt;class ProfileEditForm(ModelForm): &lt;br&gt;&amp;nbsp; &amp;nbsp; class Meta: &lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; model = UserProfile &lt;br&gt; &lt;br&gt;views.py &lt;br&gt;def edit(request): &lt;br&gt;&amp;nbsp; &amp;nbsp; c = {} &lt;br&gt;&amp;nbsp; &amp;nbsp; c.update(csrf(request)) &lt;br&gt;&amp;nbsp; &amp;nbsp; profile_edit_form = &lt;br&gt;ProfileEditForm(instance=&lt;wbr&gt;request.user.get_profile()) &lt;br&gt;&amp;nbsp; &amp;nbsp; if request.method == "POST": &lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pass &lt;br&gt; &lt;br&gt;&amp;nbsp; &amp;nbsp; c['profile_edit_form'] = profile_edit_form &lt;br&gt;&amp;nbsp; &amp;nbsp; return render_to_response('profile.&lt;wbr&gt;html', c, &lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;context_instance=&lt;wbr&gt;RequestContext(request)) &lt;br&gt; &lt;br&gt;template &lt;br&gt;{{ profile_edit_form.interests}} # which displays multipleselect with &lt;br&gt;values as 'interests object' becuase i cant loop over it to get &lt;br&gt;interest &lt;br&gt; &lt;br&gt;heres my attempts to loop over it &lt;br&gt;attempt 1 &lt;br&gt;{% for interest in profile_edit_form.interests.&lt;wbr&gt;all %} # seems to be no &lt;br&gt;results in all &lt;br&gt;&amp;nbsp; &amp;nbsp; {{ interest.interest }} &lt;br&gt;{ % endfor %} &lt;br&gt; &lt;br&gt;attempt2 &lt;br&gt;{% for interest in profile_edit_form.interests_&lt;wbr&gt;set.all %} # seems to &lt;br&gt;be no results in all &lt;br&gt;&amp;nbsp; &amp;nbsp; {{ interest.interest }} &lt;br&gt;{ % endfor %} &lt;br&gt; &lt;br&gt;attempt3 &lt;br&gt;{% for interest in profile_edit_form.userprofile_&lt;wbr&gt;interests.all %} # &lt;br&gt;seems to be no results in all &lt;br&gt;&amp;nbsp; &amp;nbsp; {{ interest.interest }} &lt;br&gt;{ % endfor %} &lt;br&gt; &lt;br&gt;Am i going wrong somehow.? &lt;br&gt; &lt;br&gt;thanks. &lt;br&gt; &lt;br&gt;     &lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;You're trying to iterate over a form field as if it's a model field or a queryset, which it isn't. `user_profile.interests` has an `.all()` manager, but `profile_form.interests` doesn't.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;As pw points out, if you define a `unicode` on the interests class, its value will be used when rendering the field. Otherwise, as the documentation[1] states, you can subclass ModelChoiceField to override `label_from_instance` to return a custom value.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;[1]:&amp;nbsp;https://docs.djangoproject.com/en/1.3/ref/forms/fields/#modelchoicefield&lt;/div&gt;&lt;div&gt;&lt;div style="border-style: initial; border-color: initial; "&gt;--&lt;/div&gt;&lt;div style="border-style: initial; border-color: initial; "&gt;DR.&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To view this discussion on the web visit &lt;a href="https://groups.google.com/d/msg/django-users/-/ghs43wOja1kJ"&gt;https://groups.google.com/d/msg/django-users/-/ghs43wOja1kJ&lt;/a&gt;.&lt;br /&gt;  To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5502858792115883748?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5502858792115883748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-is-my-userprofile-manytomany-wrong_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5502858792115883748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5502858792115883748'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-is-my-userprofile-manytomany-wrong_12.html' title='Re: is my UserProfile ManyToMany wrong?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7373796067402394115</id><published>2012-02-12T10:02:00.001-08:00</published><updated>2012-02-12T10:02:53.277-08:00</updated><title type='text'>Re: Where is linebreaksbr function ?</title><content type='html'>&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; What&amp;#39;s so difficult about&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;.join(data.split(&amp;quot;\n&amp;quot;))&lt;p&gt;&lt;br&gt;Nothing ? But that&amp;#39;s not what I wanted.&lt;br&gt;1) It can&amp;#39;t escape.&lt;br&gt;2) If I would have wanted something like that I would have use&lt;br&gt;data.replace(&amp;#39;\n&amp;#39;, &amp;#39;&amp;lt;br /&amp;gt;&amp;#39;) which is a whole lot faster than your&lt;br&gt;solution.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7373796067402394115?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7373796067402394115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-where-is-linebreaksbr-function_749.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7373796067402394115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7373796067402394115'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-where-is-linebreaksbr-function_749.html' title='Re: Where is linebreaksbr function ?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4804726306039708387</id><published>2012-02-12T10:00:00.001-08:00</published><updated>2012-02-12T10:00:49.521-08:00</updated><title type='text'>Re: pysqlite installation</title><content type='html'>&lt;br&gt;Actually, If you&amp;#39;re using the the sqlite3 backend for Django, you DO NOT have to use any `pysqlite&amp;#39;. The sqlite3 db-API has been a part of the Python standard library for long, and even if we ignore that, if you stick to Django&amp;#39;s wonderful ORM, you shouldn&amp;#39;t really have to work directly with pysqlite. I can understand if the DB was something like MongoDB or Redis, but SQLite3 should not bother  you much. &lt;br&gt; &lt;br&gt;&lt;div class="gmail_quote"&gt;On Sun, Feb 12, 2012 at 10:17 PM, Dennis Lee Bieber &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt; &lt;div class="im"&gt;On Sun, 12 Feb 2012 06:17:23 -0800 (PST), Marcus Maximus&lt;br&gt; &amp;lt;&lt;a href="mailto:marcus.presich@gmail.com"&gt;marcus.presich@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt; &lt;br&gt; &lt;br&gt; &amp;gt;My python version:&lt;br&gt; &amp;gt;ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2&lt;br&gt; &amp;gt;(default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win 32&lt;br&gt; &lt;br&gt; &lt;/div&gt;        SQLite3, and the Python DB-API for it have been a part of Python&amp;#39;s&lt;br&gt; standard library since, what, Python 2.5?&lt;br&gt; &lt;br&gt;         There is nothing that needs to be installed to use it.&lt;br&gt; &lt;div class="im"&gt;&amp;gt;&lt;br&gt; &amp;gt;and my db:&lt;br&gt; &amp;gt;postgresql 1.14.1 also on win 7&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt;can sb help me to install the pysqlite database adapter?&lt;br&gt; &amp;gt;&lt;br&gt; &lt;br&gt; &lt;/div&gt;        I suspect you are confused about what you need to install. Pysqlite&lt;br&gt; works with SQLite3 database engine.&lt;br&gt; &lt;br&gt;         For use with PostgreSQL you need to install a PostgreSQL adapter:&lt;br&gt; psycopg2 seems to be the common package, there are others which may or&lt;br&gt; may not be as complete a match for the DB-API 2 specification.&lt;br&gt; &lt;span class="HOEnZb"&gt;&lt;font color="#888888"&gt;--&lt;br&gt;         Wulfraed                 Dennis Lee Bieber         AF6VN&lt;br&gt;         &lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;    &lt;a href="HTTP://wlfraed.home.netcom.com/" target="_blank"&gt;HTTP://wlfraed.home.netcom.com/&lt;/a&gt;&lt;br&gt; &lt;/font&gt;&lt;/span&gt;&lt;div class="HOEnZb"&gt;&lt;div class="h5"&gt;&lt;br&gt; --&lt;br&gt; You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt; For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt; &lt;br&gt; &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear="all"&gt;&lt;br&gt;-- &lt;br&gt;&lt;font face="courier new,monospace"&gt;Yati Sagade&lt;a href="http://twitter.com/yati_itay" target="_blank"&gt; &lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href="http://twitter.com/yati_itay" target="_blank"&gt;(@yati_itay&lt;/a&gt;)&lt;br&gt; &lt;br&gt;&lt;/font&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4804726306039708387?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4804726306039708387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-pysqlite-installation_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4804726306039708387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4804726306039708387'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-pysqlite-installation_12.html' title='Re: pysqlite installation'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8430312796071165479</id><published>2012-02-12T08:47:00.001-08:00</published><updated>2012-02-12T08:50:31.815-08:00</updated><title type='text'>Re: Where is linebreaksbr function ?</title><content type='html'>On Sun, 12 Feb 2012 07:53:43 -0800 (PST), Nolhian &amp;lt;&lt;a href="mailto:Eldurian@hotmail.com"&gt;Eldurian@hotmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;p&gt;&amp;gt;Hello,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;I&amp;#39;ve found linebreaks, urlize and so on in django.utils.html but&lt;br&gt;&amp;gt;linebreaksbr is not there. I need it to format my data inside my view&lt;br&gt;&amp;gt;instead of the template.&lt;br&gt;&amp;gt;&lt;p&gt;	What&amp;#39;s so difficult about&lt;p&gt;		&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;.join(data.split(&amp;quot;\n&amp;quot;))&lt;br&gt;-- &lt;br&gt;	Wulfraed                 Dennis Lee Bieber         AF6VN&lt;br&gt;        &lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;    &lt;a href="HTTP://wlfraed.home.netcom.com/"&gt;HTTP://wlfraed.home.netcom.com/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8430312796071165479?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8430312796071165479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-where-is-linebreaksbr-function_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8430312796071165479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8430312796071165479'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-where-is-linebreaksbr-function_12.html' title='Re: Where is linebreaksbr function ?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7196749863376915267</id><published>2012-02-12T08:47:00.000-08:00</published><updated>2012-02-12T08:48:31.075-08:00</updated><title type='text'>Re: pysqlite installation</title><content type='html'>On Sun, 12 Feb 2012 06:17:23 -0800 (PST), Marcus Maximus&lt;br&gt;&amp;lt;&lt;a href="mailto:marcus.presich@gmail.com"&gt;marcus.presich@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&lt;br&gt;&amp;gt;My python version:&lt;br&gt;&amp;gt;ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2&lt;br&gt;&amp;gt;(default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win 32&lt;p&gt;	SQLite3, and the Python DB-API for it have been a part of Python&amp;#39;s&lt;br&gt;standard library since, what, Python 2.5?&lt;p&gt;	There is nothing that needs to be installed to use it.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;and my db:&lt;br&gt;&amp;gt;postgresql 1.14.1 also on win 7&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;can sb help me to install the pysqlite database adapter?&lt;br&gt;&amp;gt;&lt;p&gt;	I suspect you are confused about what you need to install. Pysqlite&lt;br&gt;works with SQLite3 database engine.&lt;p&gt;	For use with PostgreSQL you need to install a PostgreSQL adapter:&lt;br&gt;psycopg2 seems to be the common package, there are others which may or&lt;br&gt;may not be as complete a match for the DB-API 2 specification.&lt;br&gt;-- &lt;br&gt;	Wulfraed                 Dennis Lee Bieber         AF6VN&lt;br&gt;        &lt;a href="mailto:wlfraed@ix.netcom.com"&gt;wlfraed@ix.netcom.com&lt;/a&gt;    &lt;a href="HTTP://wlfraed.home.netcom.com/"&gt;HTTP://wlfraed.home.netcom.com/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7196749863376915267?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7196749863376915267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-pysqlite-installation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7196749863376915267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7196749863376915267'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-pysqlite-installation.html' title='Re: pysqlite installation'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4166452837023706466</id><published>2012-02-12T08:37:00.000-08:00</published><updated>2012-02-12T08:38:20.304-08:00</updated><title type='text'>Re: Django Comments Form not Displaying</title><content type='html'>Excerpts from Michael P. Soulier&amp;#39;s message of 2012-02-12 14:16:26 -0200:&lt;br&gt;&amp;gt; On 12/02/12 coded kid said:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &amp;gt; Below is the codes in my comments/form.html&lt;br&gt;&amp;gt; &amp;gt; {% load comments i18n %}&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;form action=&amp;quot;{% comment_form_target %}&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;{% csrf_token&lt;br&gt;&amp;gt; &amp;gt; %}&lt;br&gt;&amp;gt; &amp;gt;   {% if next %}&amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;next&amp;quot;&lt;br&gt;&amp;gt; &amp;gt; value=&amp;quot;{{ next }}&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;{% endif %}&lt;br&gt;&amp;gt; &amp;gt;   {% for field in form %}&lt;br&gt;&amp;gt; &amp;gt;     {% if field.is_hidden %}&lt;br&gt;&amp;gt; &amp;gt;       &amp;lt;div&amp;gt;{{ field }}&amp;lt;/div&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;     {% else %}&lt;br&gt;&amp;gt; &amp;gt;       {% if field.errors %}{{ field.errors }}{% endif %}&lt;br&gt;&amp;gt; &amp;gt;       &amp;lt;p&lt;br&gt;&amp;gt; &amp;gt;         {% if field.errors %} class=&amp;quot;error&amp;quot;{% endif %}&lt;br&gt;&amp;gt; &amp;gt;         {% ifequal &lt;a href="http://field.name"&gt;field.name&lt;/a&gt; &amp;quot;honeypot&amp;quot; %} style=&amp;quot;display:none;&amp;quot;{%&lt;br&gt;&amp;gt; &amp;gt; endifequal %}&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;         {{ field.label_tag }} {{ field }}&lt;br&gt;&amp;gt; &amp;gt;       &amp;lt;/p&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;     {% endif %}&lt;br&gt;&amp;gt; &amp;gt;   {% endfor %}&lt;br&gt;&amp;gt; &amp;gt;   &amp;lt;p class=&amp;quot;submit&amp;quot;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;     &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;post&amp;quot; class=&amp;quot;submit-post&amp;quot; value=&amp;quot;{%&lt;br&gt;&amp;gt; &amp;gt; trans &amp;quot;Post&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;     &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;preview&amp;quot; class=&amp;quot;submit-preview&amp;quot;&lt;br&gt;&amp;gt; &amp;gt; value=&amp;quot;{% trans &amp;quot;Preview&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;&amp;gt; &amp;gt;   &amp;lt;/p&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;/form&amp;gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; You have conditionals on all output. If you&amp;#39;re seeing a blank page, perhaps&lt;br&gt;&amp;gt; those conditionals are all false. Put in some unconditional content and see if&lt;br&gt;&amp;gt; it renders, and then start testing your conditionals.&lt;p&gt;&amp;quot;/comments/post&amp;quot; is decorated by require_POST, that means that POST is the only&lt;br&gt;method allowed to access that view, check your response, you should be getting&lt;br&gt;a 405 response.&lt;p&gt;You should include the form in the page you want it to display, let&amp;#39;s say&lt;br&gt;a blog post page, but if you want the form on a single page, then you need to&lt;br&gt;define a different URL and view to render the template.&lt;p&gt;Regards,&lt;br&gt;Mat&amp;#237;as&lt;br&gt;-- &lt;br&gt;Mat&amp;#237;as Aguirre (&lt;a href="mailto:matiasaguirre@gmail.com"&gt;matiasaguirre@gmail.com&lt;/a&gt;)&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4166452837023706466?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4166452837023706466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-comments-form-not-displaying_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4166452837023706466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4166452837023706466'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-comments-form-not-displaying_12.html' title='Re: Django Comments Form not Displaying'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7209275246609430531</id><published>2012-02-12T08:16:00.000-08:00</published><updated>2012-02-12T08:17:15.293-08:00</updated><title type='text'>Re: Django Comments Form not Displaying</title><content type='html'>On 12/02/12 coded kid said:&lt;p&gt;&amp;gt; Below is the codes in my comments/form.html&lt;br&gt;&amp;gt; {% load comments i18n %}&lt;br&gt;&amp;gt; &amp;lt;form action=&amp;quot;{% comment_form_target %}&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;{% csrf_token&lt;br&gt;&amp;gt; %}&lt;br&gt;&amp;gt;   {% if next %}&amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;next&amp;quot;&lt;br&gt;&amp;gt; value=&amp;quot;{{ next }}&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;{% endif %}&lt;br&gt;&amp;gt;   {% for field in form %}&lt;br&gt;&amp;gt;     {% if field.is_hidden %}&lt;br&gt;&amp;gt;       &amp;lt;div&amp;gt;{{ field }}&amp;lt;/div&amp;gt;&lt;br&gt;&amp;gt;     {% else %}&lt;br&gt;&amp;gt;       {% if field.errors %}{{ field.errors }}{% endif %}&lt;br&gt;&amp;gt;       &amp;lt;p&lt;br&gt;&amp;gt;         {% if field.errors %} class=&amp;quot;error&amp;quot;{% endif %}&lt;br&gt;&amp;gt;         {% ifequal &lt;a href="http://field.name"&gt;field.name&lt;/a&gt; &amp;quot;honeypot&amp;quot; %} style=&amp;quot;display:none;&amp;quot;{%&lt;br&gt;&amp;gt; endifequal %}&amp;gt;&lt;br&gt;&amp;gt;         {{ field.label_tag }} {{ field }}&lt;br&gt;&amp;gt;       &amp;lt;/p&amp;gt;&lt;br&gt;&amp;gt;     {% endif %}&lt;br&gt;&amp;gt;   {% endfor %}&lt;br&gt;&amp;gt;   &amp;lt;p class=&amp;quot;submit&amp;quot;&amp;gt;&lt;br&gt;&amp;gt;     &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;post&amp;quot; class=&amp;quot;submit-post&amp;quot; value=&amp;quot;{%&lt;br&gt;&amp;gt; trans &amp;quot;Post&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;&amp;gt;     &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;preview&amp;quot; class=&amp;quot;submit-preview&amp;quot;&lt;br&gt;&amp;gt; value=&amp;quot;{% trans &amp;quot;Preview&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;&amp;gt;   &amp;lt;/p&amp;gt;&lt;br&gt;&amp;gt; &amp;lt;/form&amp;gt;&lt;p&gt;You have conditionals on all output. If you&amp;#39;re seeing a blank page, perhaps&lt;br&gt;those conditionals are all false. Put in some unconditional content and see if&lt;br&gt;it renders, and then start testing your conditionals.&lt;p&gt;Mike&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7209275246609430531?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7209275246609430531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-comments-form-not-displaying.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7209275246609430531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7209275246609430531'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-comments-form-not-displaying.html' title='Re: Django Comments Form not Displaying'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8665088611638154950</id><published>2012-02-12T08:09:00.001-08:00</published><updated>2012-02-12T08:09:19.946-08:00</updated><title type='text'>Django Comments Form not Displaying</title><content type='html'>Hi guys, please help me out with django-comments form. I added :&lt;br&gt;&amp;#39;django.contrib.comments&amp;#39;,  to INSTALLED APPS&lt;p&gt;(r&amp;#39;^comments/&amp;#39;, include(&amp;#39;django.contrib.comments.urls&amp;#39;)), to urls.py&lt;br&gt;and I copied the default templates from&lt;br&gt;django.contrib.comments.templates.comments to my app templates&lt;br&gt;directory.&lt;p&gt; After doing that, I visit localhost:8000/comments/posts and the page&lt;br&gt;is not showing me any comments form, it just showing me a white blank&lt;br&gt;page. What I&amp;#39;m I doing wrong?&lt;p&gt;Below is the codes in my comments/form.html&lt;br&gt;{% load comments i18n %}&lt;br&gt;&amp;lt;form action=&amp;quot;{% comment_form_target %}&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;{% csrf_token&lt;br&gt;%}&lt;br&gt;  {% if next %}&amp;lt;div&amp;gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;next&amp;quot;&lt;br&gt;value=&amp;quot;{{ next }}&amp;quot; /&amp;gt;&amp;lt;/div&amp;gt;{% endif %}&lt;br&gt;  {% for field in form %}&lt;br&gt;    {% if field.is_hidden %}&lt;br&gt;      &amp;lt;div&amp;gt;{{ field }}&amp;lt;/div&amp;gt;&lt;br&gt;    {% else %}&lt;br&gt;      {% if field.errors %}{{ field.errors }}{% endif %}&lt;br&gt;      &amp;lt;p&lt;br&gt;        {% if field.errors %} class=&amp;quot;error&amp;quot;{% endif %}&lt;br&gt;        {% ifequal &lt;a href="http://field.name"&gt;field.name&lt;/a&gt; &amp;quot;honeypot&amp;quot; %} style=&amp;quot;display:none;&amp;quot;{%&lt;br&gt;endifequal %}&amp;gt;&lt;br&gt;        {{ field.label_tag }} {{ field }}&lt;br&gt;      &amp;lt;/p&amp;gt;&lt;br&gt;    {% endif %}&lt;br&gt;  {% endfor %}&lt;br&gt;  &amp;lt;p class=&amp;quot;submit&amp;quot;&amp;gt;&lt;br&gt;    &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;post&amp;quot; class=&amp;quot;submit-post&amp;quot; value=&amp;quot;{%&lt;br&gt;trans &amp;quot;Post&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;    &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;preview&amp;quot; class=&amp;quot;submit-preview&amp;quot;&lt;br&gt;value=&amp;quot;{% trans &amp;quot;Preview&amp;quot; %}&amp;quot; /&amp;gt;&lt;br&gt;  &amp;lt;/p&amp;gt;&lt;br&gt;&amp;lt;/form&amp;gt;&lt;br&gt;Hope to hear from you soon.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8665088611638154950?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8665088611638154950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-comments-form-not-displaying.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8665088611638154950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8665088611638154950'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/django-comments-form-not-displaying.html' title='Django Comments Form not Displaying'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-615262912529875113</id><published>2012-02-12T08:08:00.001-08:00</published><updated>2012-02-12T08:08:47.704-08:00</updated><title type='text'>Re: Where is linebreaksbr function ?</title><content type='html'>autoreponsse : Found it ! It&amp;#39;s in django.template.defaultfilters,&lt;br&gt;linebreaks is there too !&lt;p&gt;On Feb 12, 4:53&amp;#160;pm, Nolhian &amp;lt;&lt;a href="mailto:Eldur...@hotmail.com"&gt;Eldur...@hotmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hello,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I&amp;#39;ve found linebreaks, urlize and so on in django.utils.html but&lt;br&gt;&amp;gt; linebreaksbr is not there. I need it to format my data inside my view&lt;br&gt;&amp;gt; instead of the template.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Any idea of its location ?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Thanks in advance,&lt;br&gt;&amp;gt; Nolhian&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-615262912529875113?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/615262912529875113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-where-is-linebreaksbr-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/615262912529875113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/615262912529875113'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-where-is-linebreaksbr-function.html' title='Re: Where is linebreaksbr function ?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8094859921767005339</id><published>2012-02-12T07:53:00.000-08:00</published><updated>2012-02-12T07:54:13.391-08:00</updated><title type='text'>Where is linebreaksbr function ?</title><content type='html'>Hello,&lt;p&gt;I&amp;#39;ve found linebreaks, urlize and so on in django.utils.html but&lt;br&gt;linebreaksbr is not there. I need it to format my data inside my view&lt;br&gt;instead of the template.&lt;p&gt;Any idea of its location ?&lt;p&gt;Thanks in advance,&lt;br&gt;Nolhian&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8094859921767005339?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8094859921767005339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/where-is-linebreaksbr-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8094859921767005339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8094859921767005339'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/where-is-linebreaksbr-function.html' title='Where is linebreaksbr function ?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7245402270008806415</id><published>2012-02-12T07:49:00.000-08:00</published><updated>2012-02-12T07:50:44.343-08:00</updated><title type='text'>Re: is my UserProfile ManyToMany wrong?</title><content type='html'>&lt;div&gt;Hi,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Is that code all that&amp;#39;s in your model classes, or just an excerpt? If you don&amp;#39;t already have a &lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;__unicode__() &lt;/font&gt;method defined on your model, I think that would cause the problem you are referring to. That method would be called by Django in various places, wherever it needs to represent a model object as a string.&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Try:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;class Interests(models.Model):&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   # eg hockey, gaming, etc&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   interest = models.CharField(max_length=100)&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;   class Meta:&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;       db_table = u&amp;#39;interests&amp;#39;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt; &lt;div&gt; &lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    def __unicode__(self):&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;            return self.interest&lt;/font&gt;&lt;/div&gt;  &lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;Hope that&amp;#39;s helpful.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;Best,&lt;div&gt;Patrick&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Sun, Feb 12, 2012 at 6:06 AM, richard &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:pullenjenna10@gmail.com"&gt;pullenjenna10@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;  &lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;Hi im having difficulty looping over my mantomany in my template. A&lt;br&gt; user has a 1to1 with UserProfile and the UserProfile has a manytomany&lt;br&gt; with interests. But displaying the form field without looping over it&lt;br&gt; displays a model multiple select with just a list of object result&lt;br&gt; sets. displaying interests object in the list.&lt;br&gt; &lt;br&gt; code&lt;br&gt; models.py&lt;br&gt; &lt;br&gt; class Interests(models.Model):&lt;br&gt;     # eg hockey, gaming, etc&lt;br&gt;     interest = models.CharField(max_length=100)&lt;br&gt;     class Meta:&lt;br&gt;         db_table = u&amp;#39;interests&amp;#39;&lt;br&gt; &lt;br&gt; class UserProfile(models.Model):&lt;br&gt;     user = models.OneToOneField(User)&lt;br&gt;     interests = models.ManyToManyField(Interests)&lt;br&gt; &lt;br&gt;&lt;/blockquote&gt;&lt;blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"&gt;  ...&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7245402270008806415?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7245402270008806415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-is-my-userprofile-manytomany-wrong.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7245402270008806415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7245402270008806415'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-is-my-userprofile-manytomany-wrong.html' title='Re: is my UserProfile ManyToMany wrong?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6238975306842614431</id><published>2012-02-12T07:45:00.000-08:00</published><updated>2012-02-12T07:46:23.281-08:00</updated><title type='text'>Is django-syncr dead?</title><content type='html'>Good day Djangonauts!&lt;br&gt;&lt;br&gt;I&amp;#39;m wondering if anyone knows anything about django-syncr (&lt;a href="http://code.google.com/p/django-syncr/"&gt;http://code.google.com/p/django-syncr/&lt;/a&gt;). The PyPI page hasn&amp;#39;t been updated for a year, and I think some of the YouTube API has changed. I&amp;#39;m bringing an old project that relied pretty heavily on django-sycr up to Django 1.3.1, and it&amp;#39;s not playing very nicely. I&amp;#39;m able to hack my way through the code to get it to work, but there&amp;#39;s always a better way than that, right? Questions:&lt;br&gt;  &lt;ul&gt;&lt;li&gt;Is there something out there that I should be using besides django-syncr? Always interested in best practices.&lt;/li&gt;&lt;li&gt;If not, is there any interest in reviving this project? I&amp;#39;d be happy to contribute.&lt;/li&gt;&lt;li&gt;  Any code out there that hasn&amp;#39;t been committed that could be?&lt;/li&gt;&lt;li&gt;Anyone using django-syncr (particularly the YouTube parts) and new syncs are working properly? It seems to be trying non-exisitent URLs.&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;  --&lt;br&gt;Kevin Harvey&lt;br&gt;Web Developer&lt;br&gt;&lt;a href="mailto:kcharvey@gmail.com" target="_blank"&gt;kcharvey@gmail.com&lt;/a&gt;&lt;br&gt;&lt;a href="https://twitter.com/#%21/kevinharvey"&gt;@kevinharvey&lt;/a&gt;&lt;br&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6238975306842614431?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6238975306842614431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/is-django-syncr-dead.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6238975306842614431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6238975306842614431'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/is-django-syncr-dead.html' title='Is django-syncr dead?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1897707384727854918</id><published>2012-02-12T06:42:00.000-08:00</published><updated>2012-02-12T06:43:59.561-08:00</updated><title type='text'>Re: sqlite3 error</title><content type='html'>On 12-02-12 15:31, Marcus Maximus wrote:&lt;br&gt;&amp;gt; I tried to change the setting.py on line  &amp;#39;ENGINE&amp;#39;: &amp;#39;sqlite3&amp;#39;, but&lt;br&gt;&amp;gt; this seems ok in my eyes...&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; so whats wrong?&lt;p&gt;Try the full dotted path, so including django.db.backends:&lt;p&gt;&amp;#39;ENGINE&amp;#39;: &amp;#39;django.db.backends.sqlite3&amp;#39;,&lt;p&gt;Just &amp;quot;sqlite3&amp;quot; by itself was fine in older django versions, so you might &lt;br&gt;have picked up an example from there.&lt;p&gt;Reinout&lt;p&gt;-- &lt;br&gt;Reinout van Rees                    &lt;a href="http://reinout.vanrees.org/"&gt;http://reinout.vanrees.org/&lt;/a&gt;&lt;br&gt;&lt;a href="mailto:reinout@vanrees.org"&gt;reinout@vanrees.org&lt;/a&gt;             &lt;a href="http://www.nelen-schuurmans.nl/"&gt;http://www.nelen-schuurmans.nl/&lt;/a&gt;&lt;br&gt;&amp;quot;If you&amp;#39;re not sure what to do, make something. -- Paul Graham&amp;quot;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1897707384727854918?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1897707384727854918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1897707384727854918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1897707384727854918'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-error.html' title='Re: sqlite3 error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-908213203328962240</id><published>2012-02-12T06:36:00.000-08:00</published><updated>2012-02-12T08:41:34.273-08:00</updated><title type='text'>Re: sqlite3 error</title><content type='html'>&lt;div&gt;&lt;span style&gt;Try:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style&gt;django.db.backends.&lt;/span&gt;sqlite3&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;instead of just&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;sqlite3&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Sun, Feb 12, 2012 at 3:31 PM, Marcus Maximus &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:marcus.presich@gmail.com"&gt;marcus.presich@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt; &lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;Hey guys,&lt;br&gt; &lt;br&gt; i am trying to configure sqlite3(cause it seems to be easier than&lt;br&gt; postgresql) for django:&lt;br&gt; &lt;br&gt; my setting.py file is:&lt;br&gt; &lt;br&gt; DATABASES = {&lt;br&gt;     &amp;#39;default&amp;#39;: {&lt;br&gt;         &amp;#39;ENGINE&amp;#39;: &amp;#39;sqlite3&amp;#39;, #&amp;#39;django.db.backends.&amp;#39;,  # Add&lt;br&gt; &amp;#39;postgresql_psycopg2&amp;#39;, &amp;#39;postgresql&amp;#39;, &amp;#39;mysql&amp;#39;, &amp;#39;sqlite3&amp;#39; or &amp;#39;oracle&amp;#39;.&lt;br&gt;         &amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\PythonUser\Desktop\Webseite\Django\sqlite-&lt;br&gt; shell-win32-x86-3071000\test.db&amp;#39;,                      # Or path to&lt;br&gt; database file if using sqlite3.&lt;br&gt;         &amp;#39;USER&amp;#39;: &amp;#39;&amp;#39;,                      # Not used with sqlite3.&lt;br&gt;         &amp;#39;PASSWORD&amp;#39;: &amp;#39;&amp;#39;,                  # Not used with sqlite3.&lt;br&gt;         &amp;#39;HOST&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt; localhost. Not used with sqlite3.&lt;br&gt;         &amp;#39;PORT&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt; default. Not used with sqlite3.&lt;br&gt;     }&lt;br&gt; }&lt;br&gt; &lt;br&gt; I am getting this error:&lt;br&gt; [quote]&lt;br&gt; &lt;br&gt; &amp;gt;&amp;gt;&amp;gt; from django.db import connection&lt;br&gt; &amp;gt;&amp;gt;&amp;gt; cursor = connection.cursor()&lt;br&gt; Traceback (most recent call last):&lt;br&gt;   File &amp;quot;&amp;lt;console&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br&gt;   File &amp;quot;C:\Python27\lib\site-packages\django\db\backends\dummy&lt;br&gt; \base.py&amp;quot;, line 15&lt;br&gt; , in complain&lt;br&gt;     raise ImproperlyConfigured(&amp;quot;You haven&amp;#39;t set the database ENGINE&lt;br&gt; setting yet.&lt;br&gt; &amp;quot;)&lt;br&gt; ImproperlyConfigured: You haven&amp;#39;t set the database ENGINE setting yet.&lt;br&gt; &lt;br&gt; [/quote]&lt;br&gt; &lt;br&gt; I tried to change the setting.py on line  &amp;#39;ENGINE&amp;#39;: &amp;#39;sqlite3&amp;#39;, but&lt;br&gt; this seems ok in my eyes...&lt;br&gt; &lt;br&gt; so whats wrong?&lt;br&gt; &lt;br&gt; grettings and a BIG THX in advance&lt;br&gt; &lt;span class="HOEnZb"&gt;&lt;font color="#888888"&gt;&lt;br&gt; --&lt;br&gt; You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt; For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear="all"&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;&lt;div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;b&gt;&lt;font face="tahoma, sans-serif"&gt;&lt;font color="#333333"&gt;&lt;u&gt;Nevio Vesić&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;/div&gt; &lt;div&gt;&lt;font color="#333333" face="tahoma, sans-serif"&gt;Web Application Developer @ TelTech Systems, Inc.&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font color="#333333" face="tahoma, sans-serif"&gt;IT Consulting | Coaching | Mentoring&lt;/font&gt;&lt;/div&gt;&lt;div&gt; &lt;span style="color:rgb(51,51,51);font-family:tahoma,sans-serif"&gt;Executive Board Member at &lt;b&gt;WeeYou.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;font color="#333333" face="tahoma, sans-serif"&gt;&lt;br&gt; &lt;/font&gt;&lt;/div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;font color="#333333" face="tahoma, sans-serif"&gt;&lt;a href="http://www.facebook.com/noxten" target="_blank"&gt;http://www.facebook.com/noxten&lt;/a&gt;&lt;/font&gt;&lt;/div&gt; &lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;font color="#333333" face="tahoma, sans-serif"&gt;&lt;a href="http://twitter.com/vesicnevio" target="_blank"&gt;http://twitter.com/vesicnevio&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt; &lt;font color="#333333" face="tahoma, sans-serif"&gt;&lt;span style="color:rgb(0,0,0);font-family:Arial,Helvetica,&amp;#39;Nimbus Sans L&amp;#39;,sans-serif;font-size:13px;line-height:15px"&gt;&lt;a href="http://hr.linkedin.com/in/neviovesic" title="View public profile" name="SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_webProfileURL" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;outline-width:initial;outline-style:none;outline-color:initial;font-weight:inherit;font-style:inherit;font-size:13px;font-family:inherit;vertical-align:baseline;text-decoration:underline;color:rgb(0,102,153)" target="_blank"&gt;http://hr.linkedin.com/in/neviovesic&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt; &lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;font face="tahoma, sans-serif"&gt;&lt;font color="#333333"&gt;&lt;u&gt;&lt;br&gt;&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;font face="tahoma, sans-serif"&gt;&lt;font color="#333333"&gt;&lt;u&gt;Skype:&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color:rgb(51,51,51);font-family:tahoma,sans-serif"&gt; &lt;/span&gt;&lt;/div&gt; &lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt;&lt;span style="color:rgb(51,51,51);font-family:tahoma,sans-serif"&gt;nevio.vesic&lt;/span&gt;&lt;/div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt; &lt;span style="color:rgb(51,51,51);font-family:tahoma,sans-serif"&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="font-weight:normal"&gt;&lt;span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"&gt;&lt;div style="font-family:arial"&gt; &lt;font face="tahoma, sans-serif"&gt;&lt;font&gt;&lt;span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"&gt;&lt;u&gt;Mobile:&lt;/u&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma, sans-serif"&gt;&lt;font&gt;&lt;span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;div style="font-family:arial"&gt;&lt;span style="font-family:arial,sans-serif;font-size:13px"&gt;&lt;b&gt;&lt;span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"&gt;(Croatia) &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"&gt;&lt;b&gt;00385 91-&lt;span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"&gt;525-6970 &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,sans-serif"&gt;&lt;b&gt;(US)        &lt;/b&gt;&lt;/span&gt;&lt;font face="arial, sans-serif"&gt;&lt;b&gt;&lt;a value="+13105106911" style="color:rgb(17,85,204)"&gt;001 (310) 510-6911&lt;/a&gt; &lt;/b&gt;&lt;/font&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color:rgb(0,0,0);font-family:arial;font-weight:normal"&gt; &lt;font face="tahoma, sans-serif"&gt;&lt;font color="#333333"&gt;&lt;span style="border-collapse:collapse;color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"&gt;&lt;span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"&gt;&lt;br&gt; &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style="font-weight:normal"&gt;&lt;font face="arial, sans-serif" size="1" color="#333333"&gt;&lt;span style="border-collapse:collapse"&gt;----------------------------------&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style="font-weight:normal"&gt; &lt;font color="#500050" face="arial, sans-serif"&gt;&lt;span style="border-collapse:collapse"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style="font-weight:normal"&gt;&lt;font face="arial, sans-serif" size="1" color="#333333"&gt;&lt;span style="border-collapse:collapse"&gt;This e-mail contains confidential data. Treat it as such. Do not forward it nor share with anyone without my permission. If you choose so, you are violating my rules and breaking my privacy. &lt;/span&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;br&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-908213203328962240?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/908213203328962240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-error_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/908213203328962240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/908213203328962240'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-sqlite3-error_12.html' title='Re: sqlite3 error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5645243566852615176</id><published>2012-02-12T06:31:00.000-08:00</published><updated>2012-02-12T06:34:32.814-08:00</updated><title type='text'>sqlite3 error</title><content type='html'>Hey guys,&lt;p&gt;i am trying to configure sqlite3(cause it seems to be easier than&lt;br&gt;postgresql) for django:&lt;p&gt;my setting.py file is:&lt;p&gt;DATABASES = {&lt;br&gt;    &amp;#39;default&amp;#39;: {&lt;br&gt;        &amp;#39;ENGINE&amp;#39;: &amp;#39;sqlite3&amp;#39;, #&amp;#39;django.db.backends.&amp;#39;,  # Add&lt;br&gt;&amp;#39;postgresql_psycopg2&amp;#39;, &amp;#39;postgresql&amp;#39;, &amp;#39;mysql&amp;#39;, &amp;#39;sqlite3&amp;#39; or &amp;#39;oracle&amp;#39;.&lt;br&gt;        &amp;#39;NAME&amp;#39;: &amp;#39;C:\Users\PythonUser\Desktop\Webseite\Django\sqlite-&lt;br&gt;shell-win32-x86-3071000\test.db&amp;#39;,                      # Or path to&lt;br&gt;database file if using sqlite3.&lt;br&gt;        &amp;#39;USER&amp;#39;: &amp;#39;&amp;#39;,                      # Not used with sqlite3.&lt;br&gt;        &amp;#39;PASSWORD&amp;#39;: &amp;#39;&amp;#39;,                  # Not used with sqlite3.&lt;br&gt;        &amp;#39;HOST&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt;localhost. Not used with sqlite3.&lt;br&gt;        &amp;#39;PORT&amp;#39;: &amp;#39;&amp;#39;,                      # Set to empty string for&lt;br&gt;default. Not used with sqlite3.&lt;br&gt;    }&lt;br&gt;}&lt;p&gt;I am getting this error:&lt;br&gt;[quote]&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; from django.db import connection&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cursor = connection.cursor()&lt;br&gt;Traceback (most recent call last):&lt;br&gt;  File &amp;quot;&amp;lt;console&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br&gt;  File &amp;quot;C:\Python27\lib\site-packages\django\db\backends\dummy&lt;br&gt;\base.py&amp;quot;, line 15&lt;br&gt;, in complain&lt;br&gt;    raise ImproperlyConfigured(&amp;quot;You haven&amp;#39;t set the database ENGINE&lt;br&gt;setting yet.&lt;br&gt;&amp;quot;)&lt;br&gt;ImproperlyConfigured: You haven&amp;#39;t set the database ENGINE setting yet.&lt;p&gt;[/quote]&lt;p&gt;I tried to change the setting.py on line  &amp;#39;ENGINE&amp;#39;: &amp;#39;sqlite3&amp;#39;, but&lt;br&gt;this seems ok in my eyes...&lt;p&gt;so whats wrong?&lt;p&gt;grettings and a BIG THX in advance&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5645243566852615176?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5645243566852615176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/sqlite3-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5645243566852615176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5645243566852615176'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/sqlite3-error.html' title='sqlite3 error'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8508351618691740535</id><published>2012-02-12T06:17:00.000-08:00</published><updated>2012-02-12T06:25:50.268-08:00</updated><title type='text'>pysqlite installation</title><content type='html'>Hey guys,&lt;p&gt;i am trying to install pysqlite under win 7, but the installation&lt;br&gt;routine always terminates...(I always have to kill the process ,cause&lt;br&gt;the installation routine always hangs on)&lt;p&gt;My python version:&lt;br&gt;ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2&lt;br&gt;(default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win 32&lt;p&gt;and my db:&lt;br&gt;postgresql 1.14.1 also on win 7&lt;p&gt;can sb help me to install the pysqlite database adapter?&lt;p&gt;I thank you in advance for your time and attention and look forward to&lt;br&gt;your reply;D&lt;p&gt;greetings&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8508351618691740535?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8508351618691740535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/pysqlite-installation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8508351618691740535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8508351618691740535'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/pysqlite-installation.html' title='pysqlite installation'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-9150782032818264332</id><published>2012-02-12T03:06:00.001-08:00</published><updated>2012-02-12T03:06:56.829-08:00</updated><title type='text'>is my UserProfile ManyToMany wrong?</title><content type='html'>Hi im having difficulty looping over my mantomany in my template. A&lt;br&gt;user has a 1to1 with UserProfile and the UserProfile has a manytomany&lt;br&gt;with interests. But displaying the form field without looping over it&lt;br&gt;displays a model multiple select with just a list of object result&lt;br&gt;sets. displaying interests object in the list.&lt;p&gt;code&lt;br&gt;models.py&lt;p&gt;class Interests(models.Model):&lt;br&gt;    # eg hockey, gaming, etc&lt;br&gt;    interest = models.CharField(max_length=100)&lt;br&gt;    class Meta:&lt;br&gt;        db_table = u&amp;#39;interests&amp;#39;&lt;p&gt;class UserProfile(models.Model):&lt;br&gt;    user = models.OneToOneField(User)&lt;br&gt;    interests = models.ManyToManyField(Interests)&lt;p&gt;forms.py&lt;br&gt;class ProfileEditForm(ModelForm):&lt;br&gt;    class Meta:&lt;br&gt;        model = UserProfile&lt;p&gt;views.py&lt;br&gt;def edit(request):&lt;br&gt;    c = {}&lt;br&gt;    c.update(csrf(request))&lt;br&gt;    profile_edit_form =&lt;br&gt;ProfileEditForm(instance=request.user.get_profile())&lt;br&gt;    if request.method == &amp;quot;POST&amp;quot;:&lt;br&gt;        pass&lt;p&gt;    c[&amp;#39;profile_edit_form&amp;#39;] = profile_edit_form&lt;br&gt;    return render_to_response(&amp;#39;profile.html&amp;#39;, c,&lt;br&gt;           context_instance=RequestContext(request))&lt;p&gt;template&lt;br&gt;{{ profile_edit_form.interests}} # which displays multipleselect with&lt;br&gt;values as &amp;#39;interests object&amp;#39; becuase i cant loop over it to get&lt;br&gt;interest&lt;p&gt;heres my attempts to loop over it&lt;br&gt;attempt 1&lt;br&gt;{% for interest in profile_edit_form.interests.all %} # seems to be no&lt;br&gt;results in all&lt;br&gt;    {{ interest.interest }}&lt;br&gt;{ % endfor %}&lt;p&gt;attempt2&lt;br&gt;{% for interest in profile_edit_form.interests_set.all %} # seems to&lt;br&gt;be no results in all&lt;br&gt;    {{ interest.interest }}&lt;br&gt;{ % endfor %}&lt;p&gt;attempt3&lt;br&gt;{% for interest in profile_edit_form.userprofile_interests.all %} #&lt;br&gt;seems to be no results in all&lt;br&gt;    {{ interest.interest }}&lt;br&gt;{ % endfor %}&lt;p&gt;Am i going wrong somehow.?&lt;p&gt;thanks.&lt;p&gt;&lt;p&gt;&lt;p&gt;&lt;br&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-9150782032818264332?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/9150782032818264332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/is-my-userprofile-manytomany-wrong.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/9150782032818264332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/9150782032818264332'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/is-my-userprofile-manytomany-wrong.html' title='is my UserProfile ManyToMany wrong?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-637578644472505220</id><published>2012-02-12T02:27:00.001-08:00</published><updated>2012-02-12T02:27:46.394-08:00</updated><title type='text'>Re: Automatically block requests from bad IP addresses</title><content type='html'>That&amp;#39;s pretty cute, we use a similar type of DDoS protection method in our webapps too, along with an abusive IP register (albeit ours isn&amp;#39;t based on RPM - requests per minute).&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;You might also want to consider looking at CloudFlare (free for even huge amounts of traffic), as they maintain a *huge* list like this as well.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;If you wanted to extend on this even further, you could look at potentially offering a free/public abusive IP register... (we actually maintain several private abusive IP registers for our clients, they are invaluable!) - you just need to make sure every restriction is categorized. I might even consider donating to the cause by giving out some of our registers in the future - as a project like that would depend solely on user contributions from high traffic/attention sites.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Either way, cool work, thanks for sharing!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Cal&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Sat, Feb 11, 2012 at 8:26 AM, Addy Yeow &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:ayeowch@gmail.com"&gt;ayeowch@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt; &lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;&lt;div&gt;I was looking for a Django solution to automatically block requests from bad IP addresses to some of my apps.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;After searching for a while without much luck, I attempted to write a simple Python script that:&lt;/div&gt; &lt;div&gt;- parses my Apache access log&lt;/div&gt;&lt;div&gt;- block IP that made too many requests within a set interval&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I have made the script with the associated Django app available on Github for those who may find it useful:&lt;/div&gt;  &lt;div&gt;&lt;a href="https://github.com/ayeowch/banshee" target="_blank"&gt;https://github.com/ayeowch/banshee&lt;/a&gt;&lt;/div&gt;&lt;span class="HOEnZb"&gt;&lt;font color="#888888"&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br&gt; You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com" target="_blank"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com" target="_blank"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;  For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;   &lt;/font&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-637578644472505220?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/637578644472505220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-automatically-block-requests-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/637578644472505220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/637578644472505220'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-automatically-block-requests-from.html' title='Re: Automatically block requests from bad IP addresses'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4464012855820834341</id><published>2012-02-12T01:31:00.000-08:00</published><updated>2012-02-12T01:32:08.664-08:00</updated><title type='text'>Re: Unit test example for web froms</title><content type='html'>Coming from a non python/django background (my experience is groovy/&lt;br&gt;grails), but when we test our controllers (I think this is equivalent&lt;br&gt;to django views). We simply set up mock params on the request and set&lt;br&gt;expectations on the controller properties.&lt;p&gt;Simple example:&lt;p&gt;given:&lt;br&gt;    request.params = [ param1: &amp;#39;valid&amp;#39;, param2: &amp;#39;invalid&amp;#39; ]&lt;p&gt;when:&lt;br&gt;    controller.submit() // the method called when the webform is&lt;br&gt;posted&lt;p&gt;then:&lt;br&gt;    controller.hasErrors == true&lt;p&gt;and:&lt;br&gt;    controller.param2.error == &amp;#39;this is invalid&amp;#39;&lt;p&gt;The above example is obviously simplified, but hopefully it shows the&lt;br&gt;general idea.&lt;p&gt;&lt;p&gt;On Feb 12, 2:41&amp;#160;am, Mario Gudelj &amp;lt;&lt;a href="mailto:mario.gud...@gmail.com"&gt;mario.gud...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hi guys,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I was wandering if anyone has a good example of a unit test where they have&lt;br&gt;&amp;gt; a view which processes a web form. I&amp;#39;m not sure how you&amp;#39;d test something&lt;br&gt;&amp;gt; like that.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Thanks,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; mario&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4464012855820834341?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4464012855820834341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-unit-test-example-for-web-froms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4464012855820834341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4464012855820834341'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-unit-test-example-for-web-froms.html' title='Re: Unit test example for web froms'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8359649521800426431</id><published>2012-02-11T23:41:00.001-08:00</published><updated>2012-02-11T23:41:48.933-08:00</updated><title type='text'>Unit test example for web froms</title><content type='html'>Hi guys,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I was wandering if anyone has a good example of a unit test where they have a view which processes a web form. I&amp;#39;m not sure how you&amp;#39;d test something like that.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks,&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;mario&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8359649521800426431?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8359649521800426431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/unit-test-example-for-web-froms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8359649521800426431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8359649521800426431'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/unit-test-example-for-web-froms.html' title='Unit test example for web froms'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-9031712072358928624</id><published>2012-02-11T23:32:00.000-08:00</published><updated>2012-02-11T23:29:28.771-08:00</updated><title type='text'>Re: What Can I use?</title><content type='html'>On 11/02/2012 9:38pm, coded kid wrote:&lt;br&gt;&amp;gt; Hey guys, anyone know about a django package I can use for comment in&lt;br&gt;&amp;gt; django site? The one I see is Django-comment but it&amp;#39;s not maintained&lt;br&gt;&amp;gt; anymore. What other one do you know about? Thanks.&lt;p&gt;Is there something wrong with django.contrib.comments ???&lt;p&gt;It is built into the Django distribution. Sort of &amp;quot;batteries included&amp;quot;.&lt;p&gt;&lt;a href="https://docs.djangoproject.com/en/1.3/ref/contrib/comments/example/"&gt;https://docs.djangoproject.com/en/1.3/ref/contrib/comments/example/&lt;/a&gt;&lt;p&gt;Mike&lt;p&gt;&amp;gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-9031712072358928624?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/9031712072358928624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-what-can-i-use_8290.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/9031712072358928624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/9031712072358928624'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-what-can-i-use_8290.html' title='Re: What Can I use?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-536288476819949807</id><published>2012-02-11T21:44:00.000-08:00</published><updated>2012-02-11T21:45:38.634-08:00</updated><title type='text'>Re: What Can I use?</title><content type='html'>For those packages, I wonder where I can find a demo about how they look ?&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks very much&lt;/div&gt;&lt;div&gt;Best regards&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Sat, Feb 11, 2012 at 8:24 AM, Kevin Harvey &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:kcharvey@gmail.com"&gt;kcharvey@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt; &lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;I always look at &lt;a href="http://djangopackages.com" target="_blank"&gt;djangopackages.com&lt;/a&gt; for questions like this: &lt;a href="http://djangopackages.com/grids/g/commenting/" target="_blank"&gt;http://djangopackages.com/grids/g/commenting/&lt;/a&gt;&lt;div class="im"&gt; &lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br&gt; You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;&lt;/div&gt; To view this discussion on the web visit &lt;a href="https://groups.google.com/d/msg/django-users/-/Ber8mjS00bwJ" target="_blank"&gt;https://groups.google.com/d/msg/django-users/-/Ber8mjS00bwJ&lt;/a&gt;.&lt;div class="HOEnZb"&gt;&lt;div class="h5"&gt; &lt;br&gt;  To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com" target="_blank"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com" target="_blank"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;  For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en" target="_blank"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;   &lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear="all"&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;-- &lt;br&gt;&lt;font color="#888888"&gt;⚡ Chen Xu &lt;/font&gt;&lt;font color="#888888"&gt;⚡&lt;/font&gt;&lt;br&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-536288476819949807?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/536288476819949807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-what-can-i-use_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/536288476819949807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/536288476819949807'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-what-can-i-use_11.html' title='Re: What Can I use?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3291792675916355686</id><published>2012-02-11T12:52:00.000-08:00</published><updated>2012-02-11T12:53:15.376-08:00</updated><title type='text'>Re: How do I sort choices by their localized label?</title><content type='html'>&amp;gt; class CountryField(models.CharField):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; def __init__(self, *args, **kwargs):&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; kwargs.setdefault(&amp;#39;max_length&amp;#39;, 2)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; kwargs.setdefault(&amp;#39;choices&amp;#39;, COUNTRIES)&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; super(CountryField, self).__init__(*args, **kwargs)&lt;p&gt;Btw, the reason this doesn&amp;#39;t work is because setdefault doesn&amp;#39;t work&lt;br&gt;as you think it does. See [1] for an example.&lt;p&gt;For the &amp;#39;layer violation&amp;#39;, you might try:&lt;p&gt;class CountryField(models.CharField):&lt;br&gt;    def __init__(self, *args, **kwargs):&lt;br&gt;        super(CountryField, self).__init__(*args, **kwargs)&lt;br&gt;        self.choices = sorted(COUNTRIES, key=lambda c: c[1])&lt;br&gt;        ...&lt;p&gt;I haven&amp;#39;t tried this but it might work.&lt;br&gt;Cheers&lt;p&gt;&lt;br&gt;[1]&lt;a href="http://www.saltycrane.com/blog/2010/02/python-setdefault-example/"&gt;http://www.saltycrane.com/blog/2010/02/python-setdefault-example/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3291792675916355686?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3291792675916355686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_9781.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3291792675916355686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3291792675916355686'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_9781.html' title='Re: How do I sort choices by their localized label?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8859032876420054417</id><published>2012-02-11T11:39:00.000-08:00</published><updated>2012-02-11T11:40:41.960-08:00</updated><title type='text'>Re: Digest for django-users@googlegroups.com - 18 Messages in 8 Topics</title><content type='html'>&lt;div dir="ltr"&gt;I have configured the tinymce, but I can&amp;#39;t get the local file browsing... and leads...?&lt;div&gt;thanx...&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8859032876420054417?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8859032876420054417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-digest-for-django.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8859032876420054417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8859032876420054417'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-digest-for-django.html' title='Re: Digest for django-users@googlegroups.com - 18 Messages in 8 Topics'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2453235652076984394</id><published>2012-02-11T11:20:00.000-08:00</published><updated>2012-02-11T11:21:04.046-08:00</updated><title type='text'>Re: How do I sort choices by their localized label?</title><content type='html'>On Saturday, February 11, 2012 7:32:09 PM UTC+2, ajohnston wrote:&lt;blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"&gt;Have you tried setting the choices in your form, like: &lt;br&gt; &lt;br&gt;class SomeFormUsingCountryField(&lt;wbr&gt;forms.Form): &lt;br&gt;&amp;nbsp; &amp;nbsp; def __init__(self, *args, **kwargs): &lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(&lt;wbr&gt;SomeFormUsingCountryField, self).__init__(*args, &lt;br&gt;**kwargs) &lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self.fields['country_field'].&lt;wbr&gt;choices = sorted(COUNTRIES, &lt;br&gt;key=lambda c: c[1])&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Funny, that fixes it. Thanks!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It's a layer violation, so I have to do it for each form that uses my field, but it works.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Salvatore.&amp;nbsp;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To view this discussion on the web visit &lt;a href="https://groups.google.com/d/msg/django-users/-/rxP5eq2btaYJ"&gt;https://groups.google.com/d/msg/django-users/-/rxP5eq2btaYJ&lt;/a&gt;.&lt;br /&gt;  To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2453235652076984394?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2453235652076984394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_7528.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2453235652076984394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2453235652076984394'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_7528.html' title='Re: How do I sort choices by their localized label?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1447248671064973095</id><published>2012-02-11T11:08:00.001-08:00</published><updated>2012-02-11T11:08:48.082-08:00</updated><title type='text'>Re: Mod_Wsgi + Apache 2.2 + Threads + httplib2</title><content type='html'>Just to give more details that I think can be relevant:&lt;br&gt;&amp;quot;Hi everyone,&lt;br&gt;I have a django application that works pretty fine with django web-&lt;br&gt;server.&lt;br&gt;I have a python file that uses Http() from httplib2, it works very&lt;br&gt;well! But when I create a thread and in this thread use this python&lt;br&gt;file(more precisely a class) that uses Http() it seems that I got in a&lt;br&gt;infinite loop.&lt;br&gt;I am very noob in this kind of problems, but I think the problem is in&lt;br&gt;Apache or mod_wsgi because if I use django webserver it works as well!&lt;br&gt;But if I use Apache2 + mod_wsgi it doesn&amp;#39;t work! Other strange thing&lt;br&gt;is that in my house it works ;/, it doesn&amp;#39;t work at my server ;(.&lt;br&gt;If I use this class(that calls Http() ) without a thread involving it,&lt;br&gt;it works fine too ;/.&lt;br&gt;This my configuration Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/&lt;br&gt;5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.7&lt;br&gt;configured -- resuming normal operations&lt;br&gt;I have tested with other python version too.&lt;br&gt;My httpd.conf:&lt;br&gt;###&lt;br&gt;LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so&lt;br&gt;WSGIScriptAlias / /srv/www/ufcgjudge/apache/django.wsgi&lt;br&gt;########&lt;br&gt;At sites-available/ufcgjudge:&lt;br&gt;&amp;quot;&amp;quot;&amp;quot;&lt;br&gt;    WSGIDaemonProcess ufcgjudge processes=2 threads=15 display-name=%&lt;br&gt;{GROUP}&lt;br&gt;    WSGIProcessGroup ufcgjudge&lt;p&gt;    WSGIScriptAlias / /srv/www/ufcgjudge/apache/django.wsgi&lt;br&gt;&amp;quot;&amp;quot;&amp;quot;&lt;br&gt;Exactly the same way that is in my house.(And works here!)&lt;p&gt;&amp;quot;&lt;p&gt;On Feb 11, 3:02&amp;#160;pm, Phyllipe &amp;lt;&lt;a href="mailto:phyllipece...@gmail.com"&gt;phyllipece...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; My server config: Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/&lt;br&gt;&amp;gt; 5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.5&lt;br&gt;&amp;gt; configured -- resuming normal operations&lt;br&gt;&amp;gt; There is no error at apache log.&lt;br&gt;&amp;gt; I&amp;#39;ve tried to put:&lt;br&gt;&amp;gt; try:&lt;br&gt;&amp;gt; ...response, content...&lt;br&gt;&amp;gt; ...print &amp;quot;NEXT&amp;quot;&lt;br&gt;&amp;gt; except Exception as detail:&lt;br&gt;&amp;gt; ..print detail&lt;br&gt;&amp;gt; None of those prints were used ;/ Seems that I get an infinite loop at&lt;br&gt;&amp;gt; response, content...&lt;br&gt;&amp;gt; But just saying again, if I try &amp;quot;response, content&amp;quot; without using a&lt;br&gt;&amp;gt; thread, it works very nice!&lt;br&gt;&amp;gt; And if I try response, content with django webserver it works nice&lt;br&gt;&amp;gt; too!&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Feb 11, 11:37&amp;#160;am, Phyllipe &amp;lt;&lt;a href="mailto:phyllipece...@gmail.com"&gt;phyllipece...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; I have a python file that works as well, it connects in another&lt;br&gt;&amp;gt; &amp;gt; website, doing something like that:&lt;br&gt;&amp;gt; &amp;gt; &amp;#39;response, content = self.http.request(&amp;#39;&lt;a href="http://www.spoj.pl/"&gt;http://www.spoj.pl/&lt;/a&gt;&amp;#39;, &amp;#39;POST&amp;#39;,&lt;br&gt;&amp;gt; &amp;gt; headers=self.headers, body=urlencode(self.bodyLogin))&amp;#39;&lt;br&gt;&amp;gt; &amp;gt; It goes inside a class, when I run it in a thread it does not works.&lt;br&gt;&amp;gt; &amp;gt; If I try with runserver it works as well! But with Apache2 and&lt;br&gt;&amp;gt; &amp;gt; MOD_WSGI doesnt work!&lt;br&gt;&amp;gt; &amp;gt; I debugged somethings, I&amp;#39;ve tried to connect without using the&lt;br&gt;&amp;gt; &amp;gt; thread(calling the method in some view) and it worked.&lt;br&gt;&amp;gt; &amp;gt; But when I use my SingleTon class that has a bounded semaphores that&lt;br&gt;&amp;gt; &amp;gt; creates a thread and in that thread class this method that was talking&lt;br&gt;&amp;gt; &amp;gt; before, it stops in the response, content part.&lt;br&gt;&amp;gt; &amp;gt; So I did a little more tests, I&amp;#39;ve created a thread in my views and in&lt;br&gt;&amp;gt; &amp;gt; that thread called this method exactly the same way that I called&lt;br&gt;&amp;gt; &amp;gt; without threads and that worked, but it has not worked ;/&lt;br&gt;&amp;gt; &amp;gt; I&amp;#39;ve putted some prints in my code that is how I discovered the line&lt;br&gt;&amp;gt; &amp;gt; that has the bug, I&amp;#39;ve putted a print before call &amp;#39;response, content&amp;#39;&lt;br&gt;&amp;gt; &amp;gt; and a print after, the before print appears but not the last, the&lt;br&gt;&amp;gt; &amp;gt; strange thing its that does not raise any kind of exception, cause I&lt;br&gt;&amp;gt; &amp;gt; have a try:, except Exception in a while True and it does not executes&lt;br&gt;&amp;gt; &amp;gt; the before print again...&lt;br&gt;&amp;gt; &amp;gt; some thing like&lt;br&gt;&amp;gt; &amp;gt; while True:&lt;br&gt;&amp;gt; &amp;gt; ....try:&lt;br&gt;&amp;gt; &amp;gt; ........print&lt;br&gt;&amp;gt; &amp;gt; ........response....&lt;br&gt;&amp;gt; &amp;gt; ....except Exception as detail:&lt;br&gt;&amp;gt; &amp;gt; .......pass&lt;br&gt;&amp;gt; &amp;gt; So I&amp;#39;m pretty sure that my bug is something related to Threads +&lt;br&gt;&amp;gt; &amp;gt; httplib2, if I use only httplib2 works as well!&lt;br&gt;&amp;gt; &amp;gt; If I use only django server works as well if threads and httplib2.&lt;br&gt;&amp;gt; &amp;gt; But when I try to deploy in my university server with apache2 and&lt;br&gt;&amp;gt; &amp;gt; mod_wsgi it bugs ;/&lt;br&gt;&amp;gt; &amp;gt; At my house with apache2 and mod_wsgi works as well&lt;br&gt;&amp;gt; &amp;gt; I have already installed apache2-threaded-dev...&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1447248671064973095?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1447248671064973095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-apache-22-threads-httplib2_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1447248671064973095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1447248671064973095'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-apache-22-threads-httplib2_11.html' title='Re: Mod_Wsgi + Apache 2.2 + Threads + httplib2'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5738727056928221276</id><published>2012-02-11T10:02:00.000-08:00</published><updated>2012-02-11T10:03:03.801-08:00</updated><title type='text'>Re: Mod_Wsgi + Apache 2.2 + Threads + httplib2</title><content type='html'>My server config: Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 PHP/&lt;br&gt;5.3.2-1ubuntu4.10 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.5&lt;br&gt;configured -- resuming normal operations&lt;br&gt;There is no error at apache log.&lt;br&gt;I&amp;#39;ve tried to put:&lt;br&gt;try:&lt;br&gt;...response, content...&lt;br&gt;...print &amp;quot;NEXT&amp;quot;&lt;br&gt;except Exception as detail:&lt;br&gt;..print detail&lt;br&gt;None of those prints were used ;/ Seems that I get an infinite loop at&lt;br&gt;response, content...&lt;br&gt;But just saying again, if I try &amp;quot;response, content&amp;quot; without using a&lt;br&gt;thread, it works very nice!&lt;br&gt;And if I try response, content with django webserver it works nice&lt;br&gt;too!&lt;p&gt;On Feb 11, 11:37&amp;#160;am, Phyllipe &amp;lt;&lt;a href="mailto:phyllipece...@gmail.com"&gt;phyllipece...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; I have a python file that works as well, it connects in another&lt;br&gt;&amp;gt; website, doing something like that:&lt;br&gt;&amp;gt; &amp;#39;response, content = self.http.request(&amp;#39;&lt;a href="http://www.spoj.pl/"&gt;http://www.spoj.pl/&lt;/a&gt;&amp;#39;, &amp;#39;POST&amp;#39;,&lt;br&gt;&amp;gt; headers=self.headers, body=urlencode(self.bodyLogin))&amp;#39;&lt;br&gt;&amp;gt; It goes inside a class, when I run it in a thread it does not works.&lt;br&gt;&amp;gt; If I try with runserver it works as well! But with Apache2 and&lt;br&gt;&amp;gt; MOD_WSGI doesnt work!&lt;br&gt;&amp;gt; I debugged somethings, I&amp;#39;ve tried to connect without using the&lt;br&gt;&amp;gt; thread(calling the method in some view) and it worked.&lt;br&gt;&amp;gt; But when I use my SingleTon class that has a bounded semaphores that&lt;br&gt;&amp;gt; creates a thread and in that thread class this method that was talking&lt;br&gt;&amp;gt; before, it stops in the response, content part.&lt;br&gt;&amp;gt; So I did a little more tests, I&amp;#39;ve created a thread in my views and in&lt;br&gt;&amp;gt; that thread called this method exactly the same way that I called&lt;br&gt;&amp;gt; without threads and that worked, but it has not worked ;/&lt;br&gt;&amp;gt; I&amp;#39;ve putted some prints in my code that is how I discovered the line&lt;br&gt;&amp;gt; that has the bug, I&amp;#39;ve putted a print before call &amp;#39;response, content&amp;#39;&lt;br&gt;&amp;gt; and a print after, the before print appears but not the last, the&lt;br&gt;&amp;gt; strange thing its that does not raise any kind of exception, cause I&lt;br&gt;&amp;gt; have a try:, except Exception in a while True and it does not executes&lt;br&gt;&amp;gt; the before print again...&lt;br&gt;&amp;gt; some thing like&lt;br&gt;&amp;gt; while True:&lt;br&gt;&amp;gt; ....try:&lt;br&gt;&amp;gt; ........print&lt;br&gt;&amp;gt; ........response....&lt;br&gt;&amp;gt; ....except Exception as detail:&lt;br&gt;&amp;gt; .......pass&lt;br&gt;&amp;gt; So I&amp;#39;m pretty sure that my bug is something related to Threads +&lt;br&gt;&amp;gt; httplib2, if I use only httplib2 works as well!&lt;br&gt;&amp;gt; If I use only django server works as well if threads and httplib2.&lt;br&gt;&amp;gt; But when I try to deploy in my university server with apache2 and&lt;br&gt;&amp;gt; mod_wsgi it bugs ;/&lt;br&gt;&amp;gt; At my house with apache2 and mod_wsgi works as well&lt;br&gt;&amp;gt; I have already installed apache2-threaded-dev...&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5738727056928221276?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5738727056928221276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-apache-22-threads-httplib2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5738727056928221276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5738727056928221276'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-modwsgi-apache-22-threads-httplib2.html' title='Re: Mod_Wsgi + Apache 2.2 + Threads + httplib2'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7885358788149471895</id><published>2012-02-11T09:32:00.001-08:00</published><updated>2012-02-11T09:32:30.002-08:00</updated><title type='text'>Re: How do I sort choices by their localized label?</title><content type='html'>Sorry I just realized that even though that sorts them correctly, it&lt;br&gt;doesn&amp;#39;t solve your problem.&lt;p&gt;Have you tried setting the choices in your form, like:&lt;p&gt;class SomeFormUsingCountryField(forms.Form):&lt;br&gt;    def __init__(self, *args, **kwargs):&lt;br&gt;        super(SomeFormUsingCountryField, self).__init__(*args,&lt;br&gt;**kwargs)&lt;br&gt;        self.fields[&amp;#39;country_field&amp;#39;].choices = sorted(COUNTRIES,&lt;br&gt;key=lambda c: c[1])&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7885358788149471895?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7885358788149471895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_5587.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7885358788149471895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7885358788149471895'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_5587.html' title='Re: How do I sort choices by their localized label?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6833333723710160296</id><published>2012-02-11T08:59:00.000-08:00</published><updated>2012-02-11T09:00:05.968-08:00</updated><title type='text'>Re: How do I sort choices by their localized label?</title><content type='html'>I think this should work:&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; COUNTRIES = (&lt;br&gt;... (&amp;#39;GB&amp;#39;, _(&amp;#39;United Kingdom&amp;#39;)),&lt;br&gt;... (&amp;#39;AF&amp;#39;, _(&amp;#39;Afghanistan&amp;#39;)),&lt;br&gt;... (&amp;#39;AX&amp;#39;, _(&amp;#39;Aland Islands&amp;#39;)),&lt;br&gt;... (&amp;#39;AL&amp;#39;, _(&amp;#39;Albania&amp;#39;)),&lt;br&gt;... (&amp;#39;DZ&amp;#39;, _(&amp;#39;Algeria&amp;#39;)),)&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; sorted(COUNTRIES, key=lambda COUNTRIES: COUNTRIES[1])&lt;br&gt;[(&amp;#39;AF&amp;#39;, &amp;#39;Afghanistan&amp;#39;), (&amp;#39;AX&amp;#39;, &amp;#39;Aland Islands&amp;#39;), (&amp;#39;AL&amp;#39;, &amp;#39;Albania&amp;#39;),&lt;br&gt;(&amp;#39;DZ&amp;#39;, &amp;#39;Algeria&amp;#39;), (&amp;#39;GB&amp;#39;, &amp;#39;United Kingdom&amp;#39;)]&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6833333723710160296?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6833333723710160296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6833333723710160296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6833333723710160296'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their_11.html' title='Re: How do I sort choices by their localized label?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6662814526773348305</id><published>2012-02-11T07:49:00.000-08:00</published><updated>2012-02-11T08:22:38.859-08:00</updated><title type='text'>Re: list_editable raising a MultiValueDictKeyError</title><content type='html'>I added the missing form inputs as follows:&lt;p&gt;if ($(&amp;#39;.editable&amp;#39;).length &amp;gt; 0) {&lt;br&gt;  $(&amp;#39;.action-select&amp;#39;).each(function(i, el) {&lt;br&gt;    var item_id = $(el).val();&lt;br&gt;    $(&amp;#39;form&amp;#39;).append(&amp;quot;&amp;lt;input type=&amp;#39;hidden&amp;#39; name=&amp;#39;form-&amp;quot; + i + &amp;quot;-id&amp;#39;&lt;br&gt;value=&amp;#39;&amp;quot; + item_id + &amp;quot;&amp;#39;/&amp;gt;&amp;quot;);&lt;br&gt;  });&lt;br&gt;}&lt;p&gt;It seems a bug&lt;p&gt;On Feb 7, 9:10&amp;#160;pm, Nick &amp;lt;&lt;a href="mailto:nickt...@gmail.com"&gt;nickt...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Whenever I use list_editable inside of the django admin attempting to&lt;br&gt;&amp;gt; save the data results in&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Exception Type: &amp;#160; &amp;#160; &amp;#160; &amp;#160; MultiValueDictKeyError&lt;br&gt;&amp;gt; Exception Value: &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;quot;Key &amp;#39;form-0-id&amp;#39; not found in &amp;lt;QueryDict: {u&amp;#39;form-66-&lt;br&gt;&amp;gt; newID&amp;#39;: [u&amp;#39;&amp;#39;], etc. etc. &amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Whenever I create custom forms I simply add in the form-0 inputs as a&lt;br&gt;&amp;gt; hidden field. How do I work around this in the admin?&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6662814526773348305?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6662814526773348305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-listeditable-raising.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6662814526773348305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6662814526773348305'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-listeditable-raising.html' title='Re: list_editable raising a MultiValueDictKeyError'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-9062479022241960897</id><published>2012-02-11T07:38:00.001-08:00</published><updated>2012-02-11T07:38:33.029-08:00</updated><title type='text'>Re: User .get_all_permissions() vs. .has_perm() inconsistency</title><content type='html'>Yes, I have to agree entirely..&lt;br&gt;I bungled the OP. Here is what the code snippet should have been:&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; from django.contrib.auth.models import User&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u = User.objects.get(username=&amp;#39;clint&amp;#39;)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.get_all_permissions()&lt;br&gt;set([u&amp;#39;wb.delete_libraryitem&amp;#39;, u&amp;#39;wb.change_libraryitem&amp;#39;])&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.has_perm(&amp;quot;wb.add_libraryitem&amp;quot;)&lt;br&gt;True&lt;p&gt;How can that be?&lt;p&gt;Your reply did prod me into realizing that I had made a similar typo&lt;br&gt;while trying to resolve this question last night. Anyway, here is the&lt;br&gt;answer:&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.is_superuser&lt;br&gt;True&lt;p&gt;If the user is not superuser, it returns False. u.has_perm() returns&lt;br&gt;true for ANY permission if u is superuser.&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.has_perm(&amp;quot;wb.anything&amp;quot;)&lt;br&gt;True&lt;p&gt;This solves the problem. Thanks for the help Andy. :)&lt;p&gt;Don Slowik&lt;p&gt;On Feb 10, 10:49&amp;#160;pm, Andy McKay &amp;lt;&lt;a href="mailto:a...@clearwind.ca"&gt;a...@clearwind.ca&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; On Fri, Feb 10, 2012 at 4:01 PM, dslowik &amp;lt;&lt;a href="mailto:dslo...@tellink.net"&gt;dslo...@tellink.net&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; u.get_all_permissions()&lt;br&gt;&amp;gt; &amp;gt; set([u&amp;#39;wb.delete_libraryitem&amp;#39;, u&amp;#39;wb.change_libraryitem&amp;#39;])&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; u.has_perm(&amp;quot;wb.change_libraryitem&amp;quot;)&lt;br&gt;&amp;gt; &amp;gt; True&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; ...Shouldn&amp;#39;t that be False?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Why would it be False? get_all_permissions: Returns a set of&lt;br&gt;&amp;gt; permission strings that the user has.... has_perm: Returns True if the&lt;br&gt;&amp;gt; user has the specified permission.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &lt;a href="https://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.aut."&gt;https://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.aut.&lt;/a&gt;..&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-9062479022241960897?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/9062479022241960897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-user-getallpermissions-vs-hasperm_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/9062479022241960897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/9062479022241960897'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-user-getallpermissions-vs-hasperm_11.html' title='Re: User .get_all_permissions() vs. .has_perm() inconsistency'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6268593469467375235</id><published>2012-02-11T07:30:00.000-08:00</published><updated>2012-02-11T07:31:33.963-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>                 &lt;div style="font-family: Helvetica; font-size: 13px; "&gt;Thanks for weighing in, that is helpful, and last night I was playing around with a somewhat similar approach. It's not exactly what I was hoping for, because it still isn't really integrated with the way Django uses template loaders.&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;This solution works for TEMPLATE_DIRS and INSTALLED_APPS, but there are other possible template loaders, or a user might have written a custom template loader. Or they may have disabled the app directories loader… Anyway, you get the idea.&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;If the built-in loader classes had some method that would just return the paths to the template directories that were loaded, this could work perfectly, but I think the loaders can only check to see if a supplied template name exists on one of the paths they serve. So it seems like my idea is not really feasible in a way that integrates cleanly with Django and results in a portable application. Thanks to everyone who replied with assistance.&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;- Patrick&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;                                   &lt;p style="color: #A0A0A8;"&gt;On Saturday, February 11, 2012 at 5:39 AM, bb6xt wrote:&lt;/p&gt;                 &lt;blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"&gt;                     &lt;span&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Here's my two cents. Hope it helps some.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;from proj.settings import TEMPLATE_DIRS, INSTALLED_APPS&lt;/div&gt;&lt;div&gt;import os&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;def recursive_search(path):&lt;/div&gt;&lt;div&gt;   result = []&lt;/div&gt;&lt;div&gt;   for i in os.listdir(path):&lt;/div&gt;&lt;div&gt;      if not os.path.isdir(os.path.join(path, i)):&lt;/div&gt;&lt;div&gt;         result.append(i)&lt;/div&gt;&lt;div&gt;       else:&lt;/div&gt;&lt;div&gt;         result.extend(recursive_search(os.path.join(path, i)))&lt;/div&gt;&lt;div&gt;   return result&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;def myview(request):&lt;/div&gt;&lt;div&gt;    templates = []&lt;/div&gt;&lt;div&gt;    # the next 2 lines handles templates in explicit template&lt;/div&gt;&lt;div&gt;directories&lt;/div&gt;&lt;div&gt;    for path in TEMPLATE_DIRS:&lt;/div&gt;&lt;div&gt;       templates.extend(recursive_search(path))&lt;/div&gt;&lt;div&gt;    # the next 2 will handle template dir generated py the&lt;/div&gt;&lt;div&gt;appdirectories loader excluding contrib apps&lt;/div&gt;&lt;div&gt;    for app in INSTALLED_APPS:&lt;/div&gt;&lt;div&gt;        if app.startswith('proj'):&lt;/div&gt;&lt;div&gt;             if os.path.exists(os.path.join(ABSPATH_TO_PROJ,&lt;/div&gt;&lt;div&gt;app.split('.')[-1], 'templates')):&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;templates.extend(recursive_search(os.path.join(ABSPATH_TO_PROJ,&lt;/div&gt;&lt;div&gt;app.split('.')[-1], 'templates')))&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt; well, you have a list of templates with which you can do as you&lt;/div&gt;&lt;div&gt;please. surely you'll want to keep track of the actual path django&lt;/div&gt;&lt;div&gt;uses to locate these templates, you can do so by tweaking the&lt;/div&gt;&lt;div&gt;recursive_search funct a little&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/blockquote&gt;               &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6268593469467375235?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6268593469467375235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_9722.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6268593469467375235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6268593469467375235'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_9722.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4380240613204530857</id><published>2012-02-11T06:54:00.000-08:00</published><updated>2012-02-11T07:15:54.721-08:00</updated><title type='text'>Re: django discarding MySQL results for "in" operator</title><content type='html'>Karen Tracey &amp;lt;kmtracey &amp;lt;at&amp;gt; &lt;a href="http://gmail.com"&gt;gmail.com&lt;/a&gt;&amp;gt; writes:&lt;p&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; On Mon, Jan 5, 2009 at 3:37 PM, JonUK &amp;lt;jdoull &amp;lt;at&amp;gt; &lt;a href="http://flinttechnology.co.uk"&gt;flinttechnology.co.uk&lt;/a&gt;&amp;gt; &lt;br&gt;wrote:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Apologies as this is a repost, but I&amp;#39;m completely stuck!&lt;br&gt;&amp;gt; I&amp;#39;m using django 1.0.2 and the tagging app to retrieve a tag via a&lt;br&gt;&amp;gt; database &amp;quot;in&amp;quot; query, and something is causing the query results to be&lt;br&gt;&amp;gt; discarded.&lt;br&gt;&amp;gt; In particular, this line of code from tagging.utils.get_tag_list()&lt;br&gt;&amp;gt; executes:&lt;br&gt;&amp;gt; return Tag.objects.filter(name__in=[force_unicode(tag)&lt;br&gt;&amp;gt;  &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;for tag in tags])&lt;br&gt;&amp;gt; and at this point:&lt;br&gt;&amp;gt; (Pdb) p tags&lt;br&gt;&amp;gt; [u&amp;#39;sea&amp;#39;]&lt;br&gt;&amp;gt; The thread of execution can be traced into the method&lt;br&gt;&amp;gt; django.db.models.sql.query.execute_sql(self, result_type=MULTI), and&lt;br&gt;&amp;gt; to this line of code:&lt;br&gt;&amp;gt;  &amp;#160; &amp;#160; &amp;#160; &amp;#160;cursor.execute(sql, params)&lt;br&gt;&amp;gt; and over here:&lt;br&gt;&amp;gt; &amp;gt;&lt;br&gt;&amp;gt; c:\python26\lib\site-packages\django\db\models\sql\query.py(1735)&lt;br&gt;&amp;gt; execute_sql()&lt;br&gt;&amp;gt; -&amp;gt; cursor.execute(sql, params)&lt;br&gt;&amp;gt; (Pdb) p sql&lt;br&gt;&amp;gt; &amp;#39;SELECT &amp;quot;tagging_tag&amp;quot;.&amp;quot;id&amp;quot;, &amp;quot;tagging_tag&amp;quot;.&amp;quot;name&amp;quot; FROM &amp;quot;tagging_tag&amp;quot;&lt;br&gt;&amp;gt; WHERE &amp;quot;tagging_tag&amp;quot;.&amp;quot;name&amp;quot; IN (%s) ORDER BY &amp;quot;tagging_tag&amp;quot;.&amp;quot;name&amp;quot; ASC&amp;#39;&lt;br&gt;&amp;gt; (Pdb) p params&lt;br&gt;&amp;gt; (u&amp;#39;sea&amp;#39;,)&lt;br&gt;&amp;gt; (Pdb)&lt;br&gt;&amp;gt; If I audit what&amp;#39;s submitted to MySQL via MySQL logging, it reports:&lt;br&gt;&amp;gt; SELECT `tagging_tag`.`id`, `tagging_tag`.`name` FROM `tagging_tag`&lt;br&gt;&amp;gt; WHERE `tagging_tag`.`name` IN (&amp;#39;sea&amp;#39;) ORDER BY `tagging_tag`.`name`&lt;br&gt;&amp;gt; ASC&lt;br&gt;&amp;gt; which looks correct - however django returns an empty list.&lt;br&gt;&amp;gt; If I execute the query interactively in MySQL, I get the expected&lt;br&gt;&amp;gt; (correct) result:&lt;br&gt;&amp;gt; +----+------+&lt;br&gt;&amp;gt; | id | name |&lt;br&gt;&amp;gt; +----+------+&lt;br&gt;&amp;gt; | 28 | Sea &amp;#160;|&lt;br&gt;&amp;gt; +----+------+&lt;br&gt;&amp;gt; 1 row in set (0.00 sec)&lt;br&gt;&amp;gt; I suspect this is a configuration problem but have no idea where to&lt;br&gt;&amp;gt; look - can anyone help?&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I can&amp;#39;t recreate with a similar (though without tagging, just doing a similar &lt;br&gt;in query for one of my models) query on my MySQL DB/django app. &amp;#160;The &lt;br&gt;.filter(xxxx__in=[...]) returns case-insensitive results as expected. &amp;#160;As you&amp;#39;ve &lt;br&gt;traced it down to where the SQL executes, have you gone farther to determine if &lt;br&gt;somehow that SQL query when issued by Django isn&amp;#39;t returning any results while &lt;br&gt;the one you issue in the mysql command does? &amp;#160;It&amp;#39;d be pretty bizarre, but maybe &lt;br&gt;the SQL is returning the same result but somehow it&amp;#39;s getting lost before the &lt;br&gt;.filter() is returning? &amp;#160;The alternative seems to be that the same SQL query is &lt;br&gt;returning different results, which seems equally bizarre. &amp;#160;(There is no &lt;br&gt;configuration option to change what collation is used for the query, which is &lt;br&gt;all I could think would change the result as you have described -- Django always &lt;br&gt;uses the default collation.)Karen&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; --~--~---------~--~----~------------~-------~--~----~&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups &lt;br&gt;&amp;quot;Django users&amp;quot; group.  To post to this group, send email to django-users &amp;lt;at&amp;gt; &lt;br&gt;&lt;a href="http://googlegroups.com"&gt;googlegroups.com&lt;/a&gt;  To unsubscribe from this group, send email to django-&lt;br&gt;users+unsubscribe &amp;lt;at&amp;gt; &lt;a href="http://googlegroups.com"&gt;googlegroups.com&lt;/a&gt;  For more options, visit this group at &lt;br&gt;&lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;&lt;br&gt;&amp;gt; -~----------~----~----~----~------~----~------~--~---&lt;br&gt;&amp;gt; &lt;p&gt;&lt;br&gt;Apologies for the long silence before responding. Although I do not recall if &lt;br&gt;this was the precisely the issue (it was a long time ago), I did eventually hunt &lt;br&gt;down an accepted bug in Mysql that makes the &amp;quot;in&amp;quot; clause unreliable, &lt;br&gt;particularly when used in subqueries. The recommended workaround was to replace &lt;br&gt;with joins, however my preferred solution was to use Postgres, which solved this &lt;br&gt;problem and worked a treat. I appreciated your responses - so thank you.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4380240613204530857?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4380240613204530857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-discarding-mysql-results-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4380240613204530857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4380240613204530857'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-django-discarding-mysql-results-for.html' title='Re: django discarding MySQL results for &quot;in&quot; operator'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3742590088241149337</id><published>2012-02-11T06:37:00.000-08:00</published><updated>2012-02-11T08:22:38.097-08:00</updated><title type='text'>Mod_Wsgi + Apache 2.2 + Threads + httplib2</title><content type='html'>I have a python file that works as well, it connects in another&lt;br&gt;website, doing something like that:&lt;br&gt;&amp;#39;response, content = self.http.request(&amp;#39;&lt;a href="http://www.spoj.pl/"&gt;http://www.spoj.pl/&lt;/a&gt;&amp;#39;, &amp;#39;POST&amp;#39;,&lt;br&gt;headers=self.headers, body=urlencode(self.bodyLogin))&amp;#39;&lt;br&gt;It goes inside a class, when I run it in a thread it does not works.&lt;br&gt;If I try with runserver it works as well! But with Apache2 and&lt;br&gt;MOD_WSGI doesnt work!&lt;br&gt;I debugged somethings, I&amp;#39;ve tried to connect without using the&lt;br&gt;thread(calling the method in some view) and it worked.&lt;br&gt;But when I use my SingleTon class that has a bounded semaphores that&lt;br&gt;creates a thread and in that thread class this method that was talking&lt;br&gt;before, it stops in the response, content part.&lt;br&gt;So I did a little more tests, I&amp;#39;ve created a thread in my views and in&lt;br&gt;that thread called this method exactly the same way that I called&lt;br&gt;without threads and that worked, but it has not worked ;/&lt;br&gt;I&amp;#39;ve putted some prints in my code that is how I discovered the line&lt;br&gt;that has the bug, I&amp;#39;ve putted a print before call &amp;#39;response, content&amp;#39;&lt;br&gt;and a print after, the before print appears but not the last, the&lt;br&gt;strange thing its that does not raise any kind of exception, cause I&lt;br&gt;have a try:, except Exception in a while True and it does not executes&lt;br&gt;the before print again...&lt;br&gt;some thing like&lt;br&gt;while True:&lt;br&gt;....try:&lt;br&gt;........print&lt;br&gt;........response....&lt;br&gt;....except Exception as detail:&lt;br&gt;.......pass&lt;br&gt;So I&amp;#39;m pretty sure that my bug is something related to Threads +&lt;br&gt;httplib2, if I use only httplib2 works as well!&lt;br&gt;If I use only django server works as well if threads and httplib2.&lt;br&gt;But when I try to deploy in my university server with apache2 and&lt;br&gt;mod_wsgi it bugs ;/&lt;br&gt;At my house with apache2 and mod_wsgi works as well&lt;br&gt;I have already installed apache2-threaded-dev...&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3742590088241149337?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3742590088241149337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/modwsgi-apache-22-threads-httplib2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3742590088241149337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3742590088241149337'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/modwsgi-apache-22-threads-httplib2.html' title='Mod_Wsgi + Apache 2.2 + Threads + httplib2'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3472287256356342328</id><published>2012-02-11T05:24:00.000-08:00</published><updated>2012-02-11T05:25:07.890-08:00</updated><title type='text'>Re: What Can I use?</title><content type='html'>I always look at djangopackages.com for questions like this: http://djangopackages.com/grids/g/commenting/&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To view this discussion on the web visit &lt;a href="https://groups.google.com/d/msg/django-users/-/Ber8mjS00bwJ"&gt;https://groups.google.com/d/msg/django-users/-/Ber8mjS00bwJ&lt;/a&gt;.&lt;br /&gt;  To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3472287256356342328?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3472287256356342328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-what-can-i-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3472287256356342328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3472287256356342328'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-what-can-i-use.html' title='Re: What Can I use?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7565599006293232153</id><published>2012-02-11T05:23:00.001-08:00</published><updated>2012-02-11T05:23:44.089-08:00</updated><title type='text'>Re: How do I sort choices by their localized label?</title><content type='html'>Have you tried sorting them at the template level? A filter like dictsort might do the trick &lt;a href="https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#dictsort"&gt;https://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#dictsort&lt;/a&gt;&lt;br&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To view this discussion on the web visit &lt;a href="https://groups.google.com/d/msg/django-users/-/xAdGQ21s2BcJ"&gt;https://groups.google.com/d/msg/django-users/-/xAdGQ21s2BcJ&lt;/a&gt;.&lt;br /&gt;  To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7565599006293232153?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7565599006293232153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7565599006293232153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7565599006293232153'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-how-do-i-sort-choices-by-their.html' title='Re: How do I sort choices by their localized label?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-7166726319006599710</id><published>2012-02-11T05:14:00.000-08:00</published><updated>2012-02-11T05:15:13.727-08:00</updated><title type='text'>compare two querysets</title><content type='html'>&lt;div class=WordSection1&gt;&lt;p class=MsoNormal&gt;I&amp;#8217;ve got a use case where I need to find the fields that are different between two querysets in the same model and then use those fields to modify another queryset in that model.&amp;nbsp; The first two represent &amp;#8220;masks&amp;#8221; of allowed fields for a specific version while the third is the actual data.&amp;nbsp; Assessment_id&amp;#8217;s below 1000 are templates while &amp;gt;1000 are data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;Based on a date entered in one field (not shown) the version of the form could change and thus the applicable sections could change.&amp;nbsp; This will not happen often and therefore does not need to be efficient.&amp;nbsp; &amp;nbsp;&amp;nbsp;There will be cases where the all the fields in the templates are identical, but it may not be practical to merge those templates due to the need to find/fix design bugs and requirements changes in template definitions.&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;The best idea I can come up with is to:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get a queryset for each template based on it&amp;#8217;s pk (derived elsewhere)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Convert the __dict__ from each queryset to a set of (name,value) pairs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Find the differences between the two sets&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Convert the remaining set back to a dict() called &amp;#8220;changes&amp;#8221;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data = get the queryset for the actual data using it&amp;#8217;s pk&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Use Data.__dict__( changes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; And of course save&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;Snippets of models module below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:blue'&gt;class&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt; &lt;b&gt;MDSSection&lt;/b&gt;(models.Model):&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assessment&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = models.OneToOneField(Assessment, primary_key=&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:blue'&gt;True&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;) &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;. . .&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:blue'&gt;class&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt; &lt;b&gt;A&lt;/b&gt;(MDSSections):&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A0100A&amp;nbsp;&amp;nbsp;&amp;nbsp; = models.CharField(max_length=&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:maroon'&gt;10&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;, help_text=&lt;/span&gt;&lt;i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:#00AA00'&gt;'''Text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; Facility National Provider Identifier (NPI)'''&lt;/span&gt;&lt;/i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;) &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A0100B&amp;nbsp;&amp;nbsp;&amp;nbsp; = models.CharField(max_length=&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:maroon'&gt;12&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;, help_text=&lt;/span&gt;&lt;i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:#00AA00'&gt;'''Text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; Facility CMS Certification Number (CCN)'''&lt;/span&gt;&lt;/i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;) &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A0100C&amp;nbsp;&amp;nbsp;&amp;nbsp; = models.CharField(max_length=&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:maroon'&gt;15&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;, help_text=&lt;/span&gt;&lt;i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:#00AA00'&gt;'''Text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; State provider number'''&lt;/span&gt;&lt;/i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;) &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A0200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = models.CharField(max_length= &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:maroon'&gt;1&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;, default=&lt;/span&gt;&lt;i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:#00AA00'&gt;'1'&lt;/span&gt;&lt;/i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;, help_text=&lt;/span&gt;&lt;i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:#00AA00'&gt;'''Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; Type of provider'''&lt;/span&gt;&lt;/i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;) &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A0310A&amp;nbsp;&amp;nbsp;&amp;nbsp; = models.CharField(max_length= &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:maroon'&gt;2&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;, help_text=&lt;/span&gt;&lt;i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:#00AA00'&gt;'''Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&amp;nbsp; Type of assessment: OBRA'''&lt;/span&gt;&lt;/i&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New";color:black'&gt;) &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:"Courier New"'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . . .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-7166726319006599710?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/7166726319006599710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/compare-two-querysets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7166726319006599710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/7166726319006599710'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/compare-two-querysets.html' title='compare two querysets'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5987952773225597479</id><published>2012-02-11T05:12:00.001-08:00</published><updated>2012-02-11T05:12:49.377-08:00</updated><title type='text'>How do I sort choices by their localized label?</title><content type='html'>Hi,&lt;div&gt;I have the following custom field:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;from django.utils.translation import ugettext_lazy as _&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;COUNTRIES = (&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; ('GB', _('United Kingdom')),&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; ('AF', _('Afghanistan')),&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; ('AX', _('Aland Islands')),&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; ('AL', _('Albania')),&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; ('DZ', _('Algeria')),&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; .&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; .&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; .&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;)&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;class CountryField(models.CharField):&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; def __init__(self, *args, **kwargs):&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; kwargs.setdefault('max_length', 2)&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; kwargs.setdefault('choices', COUNTRIES)&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super(CountryField, self).__init__(*args, **kwargs)&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; def get_internal_type(self):&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return "CharField"&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;That field ends up in an HTML &lt;/font&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&amp;lt;select&amp;gt;&lt;/font&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;, and I'd like the countries to be sorted by their label in all locales. I have tried to replace this code:&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', monospace; "&gt;kwargs.setdefault('choices', COUNTRIES)&lt;/span&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new', monospace; "&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;with this:&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;kwargs.setdefault('choices', sorted(COUNTRIES, key=lambda x: x[1]))&lt;/font&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;but that's sorting the list only by the original English names, whatever the locale.&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;I can't switch to &lt;/font&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;ugettext&lt;/font&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt; instead of the &lt;/font&gt;&lt;font class="Apple-style-span" face="'courier new', monospace"&gt;_lazy&lt;/font&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt; version, because this is a Field so it won't work at all.&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;Do you have any suggestion on how to get my list of countries properly sorted in all locales?&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;Thank you!&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif"&gt;Salvatore Iovene.&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To view this discussion on the web visit &lt;a href="https://groups.google.com/d/msg/django-users/-/7VmYao_u1IMJ"&gt;https://groups.google.com/d/msg/django-users/-/7VmYao_u1IMJ&lt;/a&gt;.&lt;br /&gt;  To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5987952773225597479?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5987952773225597479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/how-do-i-sort-choices-by-their.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5987952773225597479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5987952773225597479'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/how-do-i-sort-choices-by-their.html' title='How do I sort choices by their localized label?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8425084420957565411</id><published>2012-02-11T02:39:00.000-08:00</published><updated>2012-02-11T02:40:16.441-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>Here&amp;#39;s my two cents. Hope it helps some.&lt;p&gt;from proj.settings import TEMPLATE_DIRS, INSTALLED_APPS&lt;br&gt;import os&lt;p&gt;def recursive_search(path):&lt;br&gt;   result = []&lt;br&gt;   for i in os.listdir(path):&lt;br&gt;      if not os.path.isdir(os.path.join(path, i)):&lt;br&gt;         result.append(i)&lt;br&gt;       else:&lt;br&gt;         result.extend(recursive_search(os.path.join(path, i)))&lt;br&gt;   return result&lt;p&gt;def myview(request):&lt;br&gt;    templates = []&lt;br&gt;    # the next 2 lines handles templates in explicit template&lt;br&gt;directories&lt;br&gt;    for path in TEMPLATE_DIRS:&lt;br&gt;       templates.extend(recursive_search(path))&lt;br&gt;    # the next 2 will handle template dir generated py the&lt;br&gt;appdirectories loader excluding contrib apps&lt;br&gt;    for app in INSTALLED_APPS:&lt;br&gt;        if app.startswith(&amp;#39;proj&amp;#39;):&lt;br&gt;             if os.path.exists(os.path.join(ABSPATH_TO_PROJ,&lt;br&gt;app.split(&amp;#39;.&amp;#39;)[-1], &amp;#39;templates&amp;#39;)):&lt;br&gt; &lt;br&gt;templates.extend(recursive_search(os.path.join(ABSPATH_TO_PROJ,&lt;br&gt;app.split(&amp;#39;.&amp;#39;)[-1], &amp;#39;templates&amp;#39;)))&lt;p&gt; well, you have a list of templates with which you can do as you&lt;br&gt;please. surely you&amp;#39;ll want to keep track of the actual path django&lt;br&gt;uses to locate these templates, you can do so by tweaking the&lt;br&gt;recursive_search funct a little&lt;p&gt;&lt;p&gt;On Feb 11, 2:34&amp;#160;am, Patrick Wellever &amp;lt;&lt;a href="mailto:pwelle...@gmail.com"&gt;pwelle...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Thanks for the reply. Yes, this wouldn&amp;#39;t be too tough if the directories in TEMPLATE_DIRS were all I had to worry about, but the glitch I mentioned earlier is that Django can also look for templates in places other than those listed explicitly in that setting.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; For example, the template loader &amp;#39;django.template.loaders.app_directories.Loader&amp;#39;, which is enabled by default, looks for a &amp;quot;templates&amp;quot; directory within each one of your &amp;quot;installed apps.&amp;quot; So a solution that only considers paths in TEMPLATE_DIRS would not work in that situation.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; - Patrick&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Friday, February 10, 2012 at 5:05 PM, Bill Beal wrote:&lt;br&gt;&amp;gt; &amp;gt; I know nothing, but here&amp;#39;s what I did:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; python manage.py shell&lt;br&gt;&amp;gt; &amp;gt; import os&lt;br&gt;&amp;gt; &amp;gt; from settings import TEMPLATE_DIRS&lt;br&gt;&amp;gt; &amp;gt; for x in TEMPLATE_DIRS:&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; print x&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; os.listdir(x)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; It gave me a list of the files in the (each) template directory.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; It looks like you already have a list of template directories in settings.py.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8425084420957565411?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8425084420957565411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8425084420957565411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8425084420957565411'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_11.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8584017313857874514</id><published>2012-02-11T02:38:00.001-08:00</published><updated>2012-02-11T02:38:57.517-08:00</updated><title type='text'>What Can I use?</title><content type='html'>Hey guys, anyone know about a django package I can use for comment in&lt;br&gt;django site? The one I see is Django-comment but it&amp;#39;s not maintained&lt;br&gt;anymore. What other one do you know about? Thanks.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8584017313857874514?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8584017313857874514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/what-can-i-use.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8584017313857874514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8584017313857874514'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/what-can-i-use.html' title='What Can I use?'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2908791332335940347</id><published>2012-02-11T00:26:00.000-08:00</published><updated>2012-02-11T00:27:24.180-08:00</updated><title type='text'>Automatically block requests from bad IP addresses</title><content type='html'>&lt;div&gt;I was looking for a Django solution to automatically block requests from bad IP addresses to some of my apps.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;After searching for a while without much luck, I attempted to write a simple Python script that:&lt;/div&gt; &lt;div&gt;- parses my Apache access log&lt;/div&gt;&lt;div&gt;- block IP that made too many requests within a set interval&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I have made the script with the associated Django app available on Github for those who may find it useful:&lt;/div&gt; &lt;div&gt;&lt;a href="https://github.com/ayeowch/banshee" target="_blank"&gt;https://github.com/ayeowch/banshee&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2908791332335940347?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2908791332335940347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/automatically-block-requests-from-bad.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2908791332335940347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2908791332335940347'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/automatically-block-requests-from-bad.html' title='Automatically block requests from bad IP addresses'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-5656683177110073676</id><published>2012-02-10T19:49:00.001-08:00</published><updated>2012-02-10T19:49:52.948-08:00</updated><title type='text'>Re: User .get_all_permissions() vs. .has_perm() inconsistency</title><content type='html'>On Fri, Feb 10, 2012 at 4:01 PM, dslowik &amp;lt;&lt;a href="mailto:dslowik@tellink.net"&gt;dslowik@tellink.net&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; u.get_all_permissions()&lt;br&gt;&amp;gt; set([u&amp;#39;wb.delete_libraryitem&amp;#39;, u&amp;#39;wb.change_libraryitem&amp;#39;])&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; u.has_perm(&amp;quot;wb.change_libraryitem&amp;quot;)&lt;br&gt;&amp;gt; True&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; ...Shouldn&amp;#39;t that be False?&lt;p&gt;Why would it be False? get_all_permissions: Returns a set of&lt;br&gt;permission strings that the user has.... has_perm: Returns True if the&lt;br&gt;user has the specified permission.&lt;p&gt;&lt;a href="https://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.auth.models.User.get_all_permissions"&gt;https://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.auth.models.User.get_all_permissions&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-5656683177110073676?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/5656683177110073676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-user-getallpermissions-vs-hasperm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5656683177110073676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/5656683177110073676'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-user-getallpermissions-vs-hasperm.html' title='Re: User .get_all_permissions() vs. .has_perm() inconsistency'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1488770873341268950</id><published>2012-02-10T17:34:00.000-08:00</published><updated>2012-02-10T17:35:07.071-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>                 &lt;div style="font-family: Helvetica; font-size: 13px; "&gt;Thanks for the reply. Yes, this wouldn't be too tough if the directories in TEMPLATE_DIRS were all I had to worry about, but the glitch I mentioned earlier is that Django can also look for templates in places other than those listed explicitly in that setting.&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;For example, the template loader&amp;nbsp;'django.template.loaders.app_directories.Loader', which is enabled by default, looks for a "templates" directory within each one of your "installed apps." So a solution that only considers paths in TEMPLATE_DIRS would not work in that situation.&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;&lt;br&gt;&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;- Patrick&lt;/div&gt;&lt;div style="font-family: Helvetica; font-size: 13px; "&gt;&lt;br&gt;&lt;/div&gt;                                   &lt;p style="color: #A0A0A8;"&gt;On Friday, February 10, 2012 at 5:05 PM, Bill Beal wrote:&lt;/p&gt;                 &lt;blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;"&gt;                     &lt;span&gt;&lt;div&gt;&lt;div&gt;I know nothing, but here's what I did:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;python manage.py shell&lt;/div&gt;&lt;div&gt;import os&lt;/div&gt;&lt;div&gt;from settings import TEMPLATE_DIRS&lt;/div&gt;&lt;div&gt;for x in TEMPLATE_DIRS:&lt;/div&gt;&lt;div&gt;&amp;nbsp; print x&lt;/div&gt;&lt;div&gt;&amp;nbsp; os.listdir(x)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It gave me a list of the files in the (each) template directory.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;It looks like you already have a list of template directories in settings.py.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;                 &lt;/div&gt;               &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1488770873341268950?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1488770873341268950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_9038.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1488770873341268950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1488770873341268950'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_9038.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4230330225721371211</id><published>2012-02-10T16:01:00.000-08:00</published><updated>2012-02-10T17:27:00.172-08:00</updated><title type='text'>User .get_all_permissions() vs. .has_perm() inconsistency</title><content type='html'>Here is the code form my Python 2.6.6 session which is puzzling me:&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; from django.contrib.auth.models import User&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u = User.objects.get(username=&amp;#39;clint&amp;#39;)&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.get_all_permissions()&lt;br&gt;set([u&amp;#39;wb.delete_libraryitem&amp;#39;, u&amp;#39;wb.change_libraryitem&amp;#39;])&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.has_perm(&amp;quot;wb.change_libraryitem&amp;quot;)&lt;br&gt;True&lt;p&gt;...Shouldn&amp;#39;t that be False?&lt;p&gt;&lt;br&gt;I&amp;#39;m really trying to use permission checking as in:&lt;br&gt;{% if perms.foo.can_vote %}&lt;br&gt;as discussed in:&lt;br&gt;&lt;a href="https://docs.djangoproject.com/en/1.2/topics/auth/#authentication-data-in-templates"&gt;https://docs.djangoproject.com/en/1.2/topics/auth/#authentication-data-in-templates&lt;/a&gt;&lt;br&gt;, where I was expecting a False and got that True, but I&amp;#39;ve tracked&lt;br&gt;the problem down to the above puzzle.&lt;p&gt;I&amp;#39;m running&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; django.VERSION&lt;br&gt;(1, 2, 3, &amp;#39;final&amp;#39;, 0)&lt;p&gt;&lt;br&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4230330225721371211?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4230330225721371211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/user-getallpermissions-vs-hasperm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4230330225721371211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4230330225721371211'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/user-getallpermissions-vs-hasperm.html' title='User .get_all_permissions() vs. .has_perm() inconsistency'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-8656896562312635548</id><published>2012-02-10T14:15:00.000-08:00</published><updated>2012-02-10T14:16:16.420-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>&lt;div&gt;Sorry... I think that&amp;#39;s a little more complicated than what I need, actually. Django already handles searching for the template in all the right locations, so I don&amp;#39;t have any problem actually rendering the template, and I shouldn&amp;#39;t need to worry about absolute paths. Here&amp;#39;s a simplified bit of code from the flatpage view in contrib.flatpages:&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;DEFAULT_TEMPLATE = &amp;#39;flatpages/default.html&amp;#39;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;br&gt;  &lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;def flatpage_detail(request, url):&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    # ...&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    f = get_object_or_404(FlatPage, url__exact=url)&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    &lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    if f.template_name:&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;        t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    else:&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;        t = loader.get_template(DEFAULT_TEMPLATE)&lt;/font&gt;&lt;/div&gt;  &lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;So in the Django admin site, if you have a flatpage that you want to use a template other than the default one, you enter the path to the template into the &amp;quot;template_name&amp;quot; field as something like &amp;#39;flatpages/custom_template.html&amp;#39;. I want the exact same functionality, but I just want the admin site to display a select list of all templates in a given directory instead of a blank text field. So within my templates directory I&amp;#39;d make a directory at &amp;quot;flatpages/templates/&amp;quot; that includes &amp;quot;default.html,&amp;quot; &amp;quot;custom_template_a.html,&amp;quot; &amp;quot;custom_template_b.html&amp;quot; and so on.&lt;div&gt;  &lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m just stuck on how to generate a list of those templates to use as choices in the admin site select menu. I want the list to populate based on the actual files that exist in the directory and update itself when new files are added. When you save the model instance, the template name you selected is saved in a column on the model itself and rendering the correct template is no problem.&lt;br&gt;  &lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Fri, Feb 10, 2012 at 4:54 PM, Python_Junkie &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:software.buy.design@gmail.com"&gt;software.buy.design@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;  I think I just figured out what you want to do.&lt;br&gt; &lt;br&gt; You want one drop down list with all of the templates listed&lt;br&gt; regardless of which folder the template lives in.&lt;br&gt; &lt;br&gt; So, as describe above you would create a dictionary of template_names&lt;br&gt; by walking through the directories where the templates live&lt;br&gt; and pass the dictionary back to the drop down list.&lt;br&gt; &lt;br&gt; Once the template is selected then you have to render back to the&lt;br&gt; folder that the selected template lives in.&lt;br&gt; &lt;br&gt; You can create a database table with 2 columns , assuming all of the&lt;br&gt; templates are named uniquely.&lt;br&gt; &lt;br&gt; column a contains the nameof all of the templates from the drop down&lt;br&gt; list.&lt;br&gt; column b contains the path that the template lives in.&lt;br&gt; &lt;br&gt; So, when  the user selects the template, the template value is passed&lt;br&gt; to the view.&lt;br&gt; &lt;br&gt; The view can then perform a sql query&lt;br&gt; &lt;br&gt; select template_path from table where template =&amp;#39;template_name&amp;#39;&lt;br&gt; &lt;br&gt; value=crsr.fetchone()&lt;br&gt; &lt;br&gt; full_path=value+template_name&lt;br&gt; &lt;br&gt; render(full_path,  plus whatever values you want to pass that&lt;br&gt; template)&lt;br&gt; &lt;br&gt; &lt;br&gt; If you don&amp;#39;t want to use a table you could have python walk through&lt;br&gt; all of the directories until it achieves a match on the template name&lt;br&gt; &lt;br&gt; I hope this solves your question&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-8656896562312635548?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/8656896562312635548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_2044.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8656896562312635548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/8656896562312635548'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_2044.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1193042815663920437</id><published>2012-02-10T14:05:00.000-08:00</published><updated>2012-02-10T17:26:00.598-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>I know nothing, but here's what I did:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;python manage.py shell&lt;/div&gt;&lt;div&gt;import os&lt;/div&gt;&lt;div&gt;from settings import TEMPLATE_DIRS&lt;/div&gt;&lt;div&gt;for x in TEMPLATE_DIRS:&lt;/div&gt;&lt;div&gt;&amp;nbsp; print x&lt;/div&gt;&lt;div&gt;&amp;nbsp; os.listdir(x)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It gave me a list of the files in the (each) template directory.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;It looks like you already have a list of template directories in settings.py.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;On Feb 10, 2012, at 4:51 PM, Patrick Wellever wrote:&lt;/div&gt;&lt;br class="Apple-interchange-newline"&gt;&lt;blockquote type="cite"&gt;&lt;div&gt;Thanks -- you must be on your way out the door now so I won't call, but according to your area code it looks like we might be neighbors. ;) So following the syntax I wrote out, what I still need to know is how do I get to&amp;nbsp;EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN. That's a variable that represents wishful thinking on my part -- I don't actually know how to get an iterable list of those directories.&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There must be some way I can sort of hook into the logic Django uses to construct a list of template directories...&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- P&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Fri, Feb 10, 2012 at 4:33 PM, Python_Junkie &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:software.buy.design@gmail.com"&gt;software.buy.design@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;  &lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;I think you have it with the syntax you just wrote down.&lt;br&gt; &lt;br&gt; I will be available by phone until 4:45 if you want to call.&lt;br&gt; &lt;br&gt; 781-...&lt;br&gt; &lt;div class="im"&gt;&lt;br&gt; On Feb 10, 4:19&amp;nbsp;pm, Patrick Wellever &amp;lt;&lt;a href="mailto:pwelle...@gmail.com"&gt;pwelle...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&lt;/div&gt;&lt;div class="im HOEnZb"&gt; &amp;gt;&lt;br&gt; &amp;gt; I need something like:&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; template_files = []&lt;br&gt; &amp;gt; for dir in EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN:&lt;br&gt; &amp;gt; &amp;nbsp; &amp;nbsp; template_files.extend(os.listdir(dir))&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br class="webkit-block-placeholder"&gt;&lt;/div&gt;  -- &lt;br&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br&gt; To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt; To unsubscribe from this group, send email to &lt;a href="mailto:django-users+unsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;  For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;br&gt;   &lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1193042815663920437?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1193042815663920437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_2007.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1193042815663920437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1193042815663920437'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_2007.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-1020476087623587123</id><published>2012-02-10T13:54:00.001-08:00</published><updated>2012-02-10T13:54:58.526-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>I think I just figured out what you want to do.&lt;p&gt;You want one drop down list with all of the templates listed&lt;br&gt;regardless of which folder the template lives in.&lt;p&gt;So, as describe above you would create a dictionary of template_names&lt;br&gt;by walking through the directories where the templates live&lt;br&gt;and pass the dictionary back to the drop down list.&lt;p&gt;Once the template is selected then you have to render back to the&lt;br&gt;folder that the selected template lives in.&lt;p&gt;You can create a database table with 2 columns , assuming all of the&lt;br&gt;templates are named uniquely.&lt;p&gt;column a contains the nameof all of the templates from the drop down&lt;br&gt;list.&lt;br&gt;column b contains the path that the template lives in.&lt;p&gt;So, when  the user selects the template, the template value is passed&lt;br&gt;to the view.&lt;p&gt;The view can then perform a sql query&lt;p&gt;select template_path from table where template =&amp;#39;template_name&amp;#39;&lt;p&gt;value=crsr.fetchone()&lt;p&gt;full_path=value+template_name&lt;p&gt;render(full_path,  plus whatever values you want to pass that&lt;br&gt;template)&lt;p&gt;&lt;br&gt;If you don&amp;#39;t want to use a table you could have python walk through&lt;br&gt;all of the directories until it achieves a match on the template name&lt;p&gt;I hope this solves your question&lt;p&gt;&lt;p&gt;&lt;br&gt;On Feb 10, 4:33&amp;#160;pm, Python_Junkie &amp;lt;&lt;a href="mailto:software.buy.des...@gmail.com"&gt;software.buy.des...@gmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;br&gt;&amp;gt; I think you have it with the syntax you just wrote down.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I will be available by phone until 4:45 if you want to call.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; 781-248-6557&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Feb 10, 4:19&amp;#160;pm, Patrick Wellever &amp;lt;&lt;a href="mailto:pwelle...@gmail.com"&gt;pwelle...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Sorry, this question is turning out to be much more difficult to articulate&lt;br&gt;&amp;gt; &amp;gt; than I originally expected. Thanks for bearing with me. ;)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; You definitely have the right idea of what I&amp;#39;m trying to do -- the only&lt;br&gt;&amp;gt; &amp;gt; problem with this method is that Django looks for templates in multiple&lt;br&gt;&amp;gt; &amp;gt; places, so I don&amp;#39;t actually know the absolute path to the directory the&lt;br&gt;&amp;gt; &amp;gt; templates are in. You quoted the critical bit from the docs in your earlier&lt;br&gt;&amp;gt; &amp;gt; message: if &amp;#39;django.template.loaders.app_directories.Loader&amp;#39; is included in&lt;br&gt;&amp;gt; &amp;gt; your TEMPLATE_LOADERS setting, Django will search for a directory called&lt;br&gt;&amp;gt; &amp;gt; &amp;#39;templates&amp;#39; in each installed app, *in addition to all the directories&lt;br&gt;&amp;gt; &amp;gt; specified in TEMPLATE_DIRS*, when trying to load a template.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; So if I have an app called &amp;#39;myapp&amp;#39; and my settings.py contains this:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; TEMPLATE_DIRS = (&amp;#39;/home/django/templates&amp;#39;,)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; TEMPLATE_LOADERS = (&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#39;django.template.loaders.filesystem.Loader&amp;#39;,&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#39;django.template.loaders.app_directories.Loader&amp;#39;,&lt;br&gt;&amp;gt; &amp;gt; )&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; ... then both &amp;quot;/home/django/templates/myapp/&amp;quot; and&lt;br&gt;&amp;gt; &amp;gt; &amp;quot;/path/to/myapp/templates/myapp/&amp;quot; are legitimate places to stick the&lt;br&gt;&amp;gt; &amp;gt; templates for the app. I&amp;#39;m trying to find a solution that would list the&lt;br&gt;&amp;gt; &amp;gt; contents of my specified directory in either of these locations.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; I need something like:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; template_files = []&lt;br&gt;&amp;gt; &amp;gt; for dir in EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN:&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; template_files.extend(os.listdir(dir))&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; I have to agree about the spoken word, though... Happy to discuss this by&lt;br&gt;&amp;gt; &amp;gt; phone if you&amp;#39;d like, and thanks again for your help.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; - Patrick&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; On Fri, Feb 10, 2012 at 3:25 PM, Python_Junkie &amp;lt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &lt;a href="mailto:software.buy.des...@gmail.com"&gt;software.buy.des...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; The internet is a wonderful invention, but sometimes the interchange&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; of the spoken word is more efficient.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Let&amp;#39;s see if I have this straight.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; You know which directory the templates are in.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#39;templates/flatpages/page_templates/ &amp;#160; for example.&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Is that correct?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Then when you pass from the url.py to the specific view that you are&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; directed to by the url &amp;#160;you simply call the function&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; *********************************************************&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; files=os.listdir(&amp;#39;templates/flatpages/page_templates/ &amp;#39;)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; template_qty=len(files)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; for xxx in range(template_qty):&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; #####perform the logic to add values to the dictionary&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; template_dictionary=( &amp;#160;a:&amp;#39;a&amp;#39;,b:&amp;#39;b&amp;#39;) &amp;#160; &amp;#160; ### I forget the&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; exact syntax&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; render(form_template_listing.html,template_dictionary) &amp;#160; &amp;#160;- &amp;#160;## I&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; forget the exact syntax&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; ******************************************************&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Then in the form_template_listing.html &amp;#160;, template unpack the template&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; dictionary in the drop down list.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I believe this is what you are asking.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; If not I can send you my cell phone number and we can discuss it.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-1020476087623587123?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/1020476087623587123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_3920.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1020476087623587123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/1020476087623587123'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_3920.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6012723221711823421</id><published>2012-02-10T13:51:00.000-08:00</published><updated>2012-02-10T13:52:08.643-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>&lt;div&gt;Thanks -- you must be on your way out the door now so I won&amp;#39;t call, but according to your area code it looks like we might be neighbors. ;) So following the syntax I wrote out, what I still need to know is how do I get to EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN. That&amp;#39;s a variable that represents wishful thinking on my part -- I don&amp;#39;t actually know how to get an iterable list of those directories.&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There must be some way I can sort of hook into the logic Django uses to construct a list of template directories...&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- P&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;On Fri, Feb 10, 2012 at 4:33 PM, Python_Junkie &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:software.buy.design@gmail.com"&gt;software.buy.design@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;  &lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;I think you have it with the syntax you just wrote down.&lt;br&gt; &lt;br&gt; I will be available by phone until 4:45 if you want to call.&lt;br&gt; &lt;br&gt; 781-...&lt;br&gt; &lt;div class="im"&gt;&lt;br&gt; On Feb 10, 4:19 pm, Patrick Wellever &amp;lt;&lt;a href="mailto:pwelle...@gmail.com"&gt;pwelle...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&lt;/div&gt;&lt;div class="im HOEnZb"&gt; &amp;gt;&lt;br&gt; &amp;gt; I need something like:&lt;br&gt; &amp;gt;&lt;br&gt; &amp;gt; template_files = []&lt;br&gt; &amp;gt; for dir in EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN:&lt;br&gt; &amp;gt;     template_files.extend(os.listdir(dir))&lt;br&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6012723221711823421?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6012723221711823421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_1349.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6012723221711823421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6012723221711823421'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_1349.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-6206384276741368316</id><published>2012-02-10T13:33:00.000-08:00</published><updated>2012-02-10T13:34:15.767-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>I think you have it with the syntax you just wrote down.&lt;p&gt;I will be available by phone until 4:45 if you want to call.&lt;p&gt;781-248-6557&lt;p&gt;On Feb 10, 4:19&amp;#160;pm, Patrick Wellever &amp;lt;&lt;a href="mailto:pwelle...@gmail.com"&gt;pwelle...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Sorry, this question is turning out to be much more difficult to articulate&lt;br&gt;&amp;gt; than I originally expected. Thanks for bearing with me. ;)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; You definitely have the right idea of what I&amp;#39;m trying to do -- the only&lt;br&gt;&amp;gt; problem with this method is that Django looks for templates in multiple&lt;br&gt;&amp;gt; places, so I don&amp;#39;t actually know the absolute path to the directory the&lt;br&gt;&amp;gt; templates are in. You quoted the critical bit from the docs in your earlier&lt;br&gt;&amp;gt; message: if &amp;#39;django.template.loaders.app_directories.Loader&amp;#39; is included in&lt;br&gt;&amp;gt; your TEMPLATE_LOADERS setting, Django will search for a directory called&lt;br&gt;&amp;gt; &amp;#39;templates&amp;#39; in each installed app, *in addition to all the directories&lt;br&gt;&amp;gt; specified in TEMPLATE_DIRS*, when trying to load a template.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; So if I have an app called &amp;#39;myapp&amp;#39; and my settings.py contains this:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; TEMPLATE_DIRS = (&amp;#39;/home/django/templates&amp;#39;,)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; TEMPLATE_LOADERS = (&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#39;django.template.loaders.filesystem.Loader&amp;#39;,&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#39;django.template.loaders.app_directories.Loader&amp;#39;,&lt;br&gt;&amp;gt; )&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; ... then both &amp;quot;/home/django/templates/myapp/&amp;quot; and&lt;br&gt;&amp;gt; &amp;quot;/path/to/myapp/templates/myapp/&amp;quot; are legitimate places to stick the&lt;br&gt;&amp;gt; templates for the app. I&amp;#39;m trying to find a solution that would list the&lt;br&gt;&amp;gt; contents of my specified directory in either of these locations.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I need something like:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; template_files = []&lt;br&gt;&amp;gt; for dir in EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN:&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; template_files.extend(os.listdir(dir))&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I have to agree about the spoken word, though... Happy to discuss this by&lt;br&gt;&amp;gt; phone if you&amp;#39;d like, and thanks again for your help.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; - Patrick&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Fri, Feb 10, 2012 at 3:25 PM, Python_Junkie &amp;lt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &lt;a href="mailto:software.buy.des...@gmail.com"&gt;software.buy.des...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; &amp;gt; The internet is a wonderful invention, but sometimes the interchange&lt;br&gt;&amp;gt; &amp;gt; of the spoken word is more efficient.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Let&amp;#39;s see if I have this straight.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; You know which directory the templates are in.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;#39;templates/flatpages/page_templates/ &amp;#160; for example.&lt;br&gt;&amp;gt; &amp;gt; Is that correct?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Then when you pass from the url.py to the specific view that you are&lt;br&gt;&amp;gt; &amp;gt; directed to by the url &amp;#160;you simply call the function&lt;br&gt;&amp;gt; &amp;gt; *********************************************************&lt;br&gt;&amp;gt; &amp;gt; files=os.listdir(&amp;#39;templates/flatpages/page_templates/ &amp;#39;)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; template_qty=len(files)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; for xxx in range(template_qty):&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; #####perform the logic to add values to the dictionary&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; template_dictionary=( &amp;#160;a:&amp;#39;a&amp;#39;,b:&amp;#39;b&amp;#39;) &amp;#160; &amp;#160; ### I forget the&lt;br&gt;&amp;gt; &amp;gt; exact syntax&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; render(form_template_listing.html,template_dictionary) &amp;#160; &amp;#160;- &amp;#160;## I&lt;br&gt;&amp;gt; &amp;gt; forget the exact syntax&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; ******************************************************&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Then in the form_template_listing.html &amp;#160;, template unpack the template&lt;br&gt;&amp;gt; &amp;gt; dictionary in the drop down list.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; I believe this is what you are asking.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; If not I can send you my cell phone number and we can discuss it.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-6206384276741368316?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/6206384276741368316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_6493.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6206384276741368316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/6206384276741368316'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_6493.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-3763241922351781735</id><published>2012-02-10T13:19:00.001-08:00</published><updated>2012-02-10T13:19:50.110-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>&lt;div&gt;Sorry, this question is turning out to be much more difficult to articulate than I originally expected. Thanks for bearing with me. ;)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;You definitely have the right idea of what I&amp;#39;m trying to do -- the only problem with this method is that Django looks for templates in multiple places, so I don&amp;#39;t actually know the absolute path to the directory the templates are in. You quoted the critical bit from the docs in your earlier message: if &amp;#39;django.template.loaders.app_directories.Loader&amp;#39; is included in your TEMPLATE_LOADERS setting, Django will search for a directory called &amp;#39;templates&amp;#39; in each installed app, &lt;i&gt;in addition to all the directories specified in TEMPLATE_DIRS&lt;/i&gt;, when trying to load a template.&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;So if I have an app called &amp;#39;myapp&amp;#39; and my settings.py contains this:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;TEMPLATE_DIRS = (&amp;#39;/home/django/templates&amp;#39;,)&lt;br&gt;  &lt;br&gt;TEMPLATE_LOADERS = (&lt;br&gt;    &amp;#39;django.template.loaders.filesystem.Loader&amp;#39;,&lt;br&gt;    &amp;#39;django.template.loaders.app_directories.Loader&amp;#39;,&lt;br&gt;)&lt;/font&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;... then both &amp;quot;/home/django/templates/myapp/&amp;quot; and &amp;quot;/path/to/myapp/templates/myapp/&amp;quot; are legitimate places to stick the templates for the app. I&amp;#39;m trying to find a solution that would list the contents of my specified directory in either of these locations.&lt;/div&gt;  &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I need something like:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;template_files = []&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;for dir in EVERY_DIRECTORY_DJANGO_LOOKS_FOR_TEMPLATES_IN:&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;    template_files.extend(os.listdir(dir))&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="&amp;#39;courier new&amp;#39;, monospace"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div&gt;I have to agree about the spoken word, though... Happy to discuss this by phone if you&amp;#39;d like, and thanks again for your help.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;- Patrick&lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div class="gmail_quote"&gt;  On Fri, Feb 10, 2012 at 3:25 PM, Python_Junkie &lt;span dir="ltr"&gt;&amp;lt;&lt;a href="mailto:software.buy.design@gmail.com"&gt;software.buy.design@gmail.com&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"&gt;  The internet is a wonderful invention, but sometimes the interchange&lt;br&gt; of the spoken word is more efficient.&lt;br&gt; &lt;br&gt; Let&amp;#39;s see if I have this straight.&lt;br&gt; &lt;br&gt; You know which directory the templates are in.&lt;br&gt; &lt;br&gt; &amp;#39;templates/flatpages/page_templates/   for example.&lt;br&gt; Is that correct?&lt;br&gt; &lt;br&gt; Then when you pass from the url.py to the specific view that you are&lt;br&gt; directed to by the url  you simply call the function&lt;br&gt; *********************************************************&lt;br&gt; files=os.listdir(&amp;#39;templates/flatpages/page_templates/ &amp;#39;)&lt;br&gt; &lt;br&gt; template_qty=len(files)&lt;br&gt; &lt;br&gt; for xxx in range(template_qty):&lt;br&gt;              #####perform the logic to add values to the dictionary&lt;br&gt;            template_dictionary=(  a:&amp;#39;a&amp;#39;,b:&amp;#39;b&amp;#39;)     ### I forget the&lt;br&gt; exact syntax&lt;br&gt; &lt;br&gt; render(form_template_listing.html,template_dictionary)    -  ## I&lt;br&gt; forget the exact syntax&lt;br&gt; &lt;br&gt; ******************************************************&lt;br&gt; &lt;br&gt; Then in the form_template_listing.html  , template unpack the template&lt;br&gt; dictionary in the drop down list.&lt;br&gt;   &lt;br&gt; &lt;br&gt; I believe this is what you are asking.&lt;br&gt; &lt;br&gt; If not I can send you my cell phone number and we can discuss it.&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-3763241922351781735?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/3763241922351781735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_4488.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3763241922351781735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/3763241922351781735'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_4488.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2773813386353989997</id><published>2012-02-10T12:25:00.001-08:00</published><updated>2012-02-10T12:25:34.688-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>The internet is a wonderful invention, but sometimes the interchange&lt;br&gt;of the spoken word is more efficient.&lt;p&gt;Let&amp;#39;s see if I have this straight.&lt;p&gt;You know which directory the templates are in.&lt;p&gt;&amp;#39;templates/flatpages/page_templates/   for example.&lt;br&gt;Is that correct?&lt;p&gt;Then when you pass from the url.py to the specific view that you are&lt;br&gt;directed to by the url  you simply call the function&lt;br&gt;*********************************************************&lt;br&gt;files=os.listdir(&amp;#39;templates/flatpages/page_templates/ &amp;#39;)&lt;p&gt;template_qty=len(files)&lt;p&gt;for xxx in range(template_qty):&lt;br&gt;             #####perform the logic to add values to the dictionary&lt;br&gt;           template_dictionary=(  a:&amp;#39;a&amp;#39;,b:&amp;#39;b&amp;#39;)     ### I forget the&lt;br&gt;exact syntax&lt;p&gt;render(form_template_listing.html,template_dictionary)    -  ## I&lt;br&gt;forget the exact syntax&lt;p&gt;******************************************************&lt;p&gt;Then in the form_template_listing.html  , template unpack the template&lt;br&gt;dictionary in the drop down list.&lt;p&gt;&lt;p&gt;&lt;br&gt;I believe this is what you are asking.&lt;p&gt;If not I can send you my cell phone number and we can discuss it.&lt;p&gt;&lt;p&gt;&lt;p&gt;On Feb 10, 3:01&amp;#160;pm, &amp;quot;Demetrio Girardi&amp;quot; &amp;lt;&lt;a href="mailto:demetrio.gira...@gmail.com"&gt;demetrio.gira...@gmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;br&gt;&amp;gt; On 10 Feb 2012 at 14:50, Patrick Wellever wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; I want to make it a choice field that justs lists all the files in, for example,&lt;br&gt;&amp;gt; &amp;gt; &amp;#39;templates/flatpages/page_templates/&amp;#39;, so the user can see what templates are available and just&lt;br&gt;&amp;gt; &amp;gt; choose one from a select list.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; you can read the filesystem in the form&amp;#39;s (or form field&amp;#39;s) __init__.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2773813386353989997?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2773813386353989997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_9291.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2773813386353989997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2773813386353989997'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_9291.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-4692521181235690316</id><published>2012-02-10T12:01:00.000-08:00</published><updated>2012-02-10T12:02:31.068-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>On 10 Feb 2012 at 14:50, Patrick Wellever wrote:&lt;p&gt;&amp;gt; I want to make it a choice field that justs lists all the files in, for example, &lt;br&gt;&amp;gt; &amp;#39;templates/flatpages/page_templates/&amp;#39;, so the user can see what templates are available and just &lt;br&gt;&amp;gt; choose one from a select list.&lt;p&gt;you can read the filesystem in the form&amp;#39;s (or form field&amp;#39;s) __init__.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Django users&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href="mailto:django-users@googlegroups.com"&gt;django-users@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href="mailto:django-users%2Bunsubscribe@googlegroups.com"&gt;django-users+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href="http://groups.google.com/group/django-users?hl=en"&gt;http://groups.google.com/group/django-users?hl=en&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-4692521181235690316?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/4692521181235690316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_8339.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4692521181235690316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/4692521181235690316'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_8339.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1173511580060553160.post-2185685609045075243</id><published>2012-02-10T11:50:00.000-08:00</published><updated>2012-02-10T11:51:24.218-08:00</updated><title type='text'>Re: Generating a list of available templates</title><content type='html'>Sorry to be unclear... Basically the functionality I want is just like in&amp;nbsp;contrib.flatpages -- the model has a field called 'template' that allows the user to specify an alternate template for the object detail page. But in the flatpages app, the field is just a charfield, so the user has to know which templates are available, then enter something like 'flatpages/some_template.hrml' in the field.&lt;br&gt;&lt;br&gt;I want to make it a choice field that justs lists all the files in, for example, 'templates/flatpages/page_templates/', so the user can see what templates are available and just choose one from a select list.&lt;br&gt;&lt;br&gt;Don't need to create templates dynamically or store them in the db.&lt;br&gt;&lt;br&gt;Thanks for your patience.&lt;br&gt;&lt;br&gt;Patrick&lt;br&gt;&lt;br&gt;&lt;span style="font-family:Prelude, Verdana, san-serif;"&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;span id="signature"&gt;&lt;div id="no_signature" style="overflow:hidden;"&gt;&lt;/div&gt;&lt;/span&gt;&lt;span style="color:navy; font-family:Prelude, Verdana, san-serif; "&gt;&lt;hr align="left" style="width:75%"&gt;On Feb 10, 2012 2:00 PM, Python_Junkie &amp;lt;software.buy.design@gmail.com&amp;gt; wrote: &lt;br&gt;&lt;br&gt;I am not sure that I follow you. &lt;br&gt; &lt;br&gt;When you mention creating new templates (you would be creating these &lt;br&gt;dynamically?) and have them show up in your database (model?) &lt;br&gt; &lt;br&gt;Please explain or provide an example &lt;br&gt;&lt;/span&gt;  &lt;p&gt;&lt;/p&gt;  -- &lt;br /&gt; You received this message because you are subscribed to the Google Groups "Django users" group.&lt;br /&gt; To post to this group, send email to django-users@googlegroups.com.&lt;br /&gt; To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.&lt;br /&gt;  For more options, visit this group at http://groups.google.com/group/django-users?hl=en.&lt;br /&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1173511580060553160-2185685609045075243?l=djangotalk.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://djangotalk.blogspot.com/feeds/2185685609045075243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_1404.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2185685609045075243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1173511580060553160/posts/default/2185685609045075243'/><link rel='alternate' type='text/html' href='http://djangotalk.blogspot.com/2012/02/re-generating-list-of-available_1404.html' title='Re: Generating a list of available templates'/><author><name>faw</name><uri>http://www.blogger.com/profile/03167266148729374879</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
