Re: Django not installed, but clearly installed ??

2013-11-14 Thread Simon Charette
It looks like pip failed to install django. Look into pip.log for more 
details.

Le jeudi 14 novembre 2013 23:28:51 UTC-5, icevermin a écrit :
>
> Hello,
>
> I installed Django using pip. It seems as if it was installed just fine. 
> However...
>
> cmd --> python --> import django I get an error !
>
> Here is a picture: http://i.imgur.com/PgjptkI.png
>
> Can anybody help me through this? Thank you
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b28e62b-1555-4d7c-b0f2-6c1d237b56d8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django not installed, but clearly installed ??

2013-11-14 Thread icevermin
Hello,

I installed Django using pip. It seems as if it was installed just fine. 
However...

cmd --> python --> import django I get an error !

Here is a picture: http://i.imgur.com/PgjptkI.png

Can anybody help me through this? Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9bc5802d-4995-436d-a230-6d8ff79f288b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Upgrading from 1.5 to 1.6 - problem with Apache

2013-11-14 Thread Frank Bieniek

Hi Robert

django.conf.urls.defaults got deprecated in 1.5 - removed in 1.6 ...
it looks your urls.pys are broken now.
https://docs.djangoproject.com/en/dev/internals/deprecation/

django.conf.urls.defaults will be removed. The functions include() 
, 
patterns() 
 
and url() 
 
plus handler404 
, 
handler500 
, 
are now available through django.conf.urls 
 .


Thats all

Happy updating
Frank




Am 14.11.2013 18:57, schrieb Robert Jonathan S(imon:
When i upgraded Django from 1.5.1 to 1.6, sudenly Apache gives me this 
bunch of errors. So i tried manage.py runserver adn it worked fine. 
When i delete 1.6 and instal 1.5.5 it is all fine and all is working.


[Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] mod_wsgi (pid=9756): Exception occurred 
processing WSGI script 'C:/Program Files/Apache Software 
Foundation/Apache2.4/htdocs/mysite/mysite/wsgi.py'., referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] Traceback (most recent call last):\r, 
referer: http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", 
line 339, in urlconf_module\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] return self._urlconf_module\r, 
referer: http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] AttributeError: 'RegexURLResolver' object 
has no attribute '_urlconf_module'\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] \r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] During handling of the above exception, 
another exception occurred:\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] \r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] Traceback (most recent call last):\r, 
referer: http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", 
line 187, in __call__\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] self.load_middleware()\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\base.py", 
line 49, in load_middleware\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] mw_instance = mw_class()\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\middleware\\locale.py", 
line 24, in __init__\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] for url_pattern in 
get_resolver(None).url_patterns:\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", 
line 346, in url_patterns\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
[client 90.178.52.216:27044] patterns = 
getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)\r, 
referer: http://176.107.123.114:9000/hlavni_stranka/prihlasen/

Re: Django 1.6 error at creating project

2013-11-14 Thread Vibhu Rishi
I work exactly as you have mentioned .. In a xubuntu VM :)

V.
On Nov 13, 2013 11:17 AM, "Ferdy Rodríguez" 
wrote:

> Hi,
>
> Yes, I always work with virtual environments, and I've checked that I did
> download django 1.6. However, I looks like is a problem with my Windows
> OS I fired up a Virtual Machine with Ubuntu and everything is working
> fine.
>
> So I'm testing my code in the Virtual box.
>
> Thanks for your time!
>
> Ferdy
>
> On Sunday, November 10, 2013 5:22:01 AM UTC-6, Vibhu Rishi wrote:
>>
>> Do you have both versions of django installed ? That could cause the
>> issue.
>>
>> I suggest that you make a virtual environment (
>> https://pypi.python.org/pypi/virtualenv ) and do a pip install of
>> django. This will let you work on different versions of django on the same
>> machine.
>>
>> Vibhu
>>
>>
>> On Sun, Nov 10, 2013 at 2:32 AM, Ferdy Rodríguez wrote:
>>
>>> Hi,
>>>
>>> I've been wanting to to test django 1.6, I'm installing this new release
>>> on a virtualenv. However, whenever a to *django-admin.py startproject
>>> mysite* I get the settings.py and urls.py from previous version (1.5).
>>> It even weirder that at creating an app *django-admin.py startapp app* I
>>> get the correct files.
>>>
>>> I've checked that I'm using django 1.6, as it is what I get by doing
>>> django.get_version() in the python shell.
>>>
>>> Does anybody knows what could be happening?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/cea3e499-7641-4275-b869-ba9cf3a7a804%
>>> 40googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> Simplicity is the ultimate sophistication. - Leonardo da Vinci
>> Life is really simple, but we insist on making it complicated. -
>> Confucius
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/332db6f6-6c5e-45bb-ab1c-70731ee27497%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPiONwnenoOhkaU7DijrEQwv7kuHErp%3Dd--37RBOxLv2pTRPeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Upgrading from 1.5 to 1.6 - problem with Apache

2013-11-14 Thread Robert Jonathan Šimon
yes, you are right. Sorry

Dne čtvrtek, 14. listopadu 2013 19:09:41 UTC+1 tim napsal(a):
>
> The error message (last line) is quite clear: ImportError: No module named 
> 'django.conf.urls.defaults'
>
> This module has been removed in 1.6 as noted in the deprecation timeline: 
> https://docs.djangoproject.com/en/dev/internals/deprecation/#id3
>
> On Thursday, November 14, 2013 12:57:48 PM UTC-5, Robert Jonathan Šimon 
> wrote:
>>
>> When i upgraded Django from 1.5.1 to 1.6, sudenly Apache gives me this 
>> bunch of errors. So i tried manage.py runserver adn it worked fine. When i 
>> delete 1.6 and instal 1.5.5 it is all fine and all is working.
>>
>> [Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] mod_wsgi (pid=9756): Exception occurred 
>> processing WSGI script 'C:/Program Files/Apache Software 
>> Foundation/Apache2.4/htdocs/mysite/mysite/wsgi.py'., referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] Traceback (most recent call last):\r, 
>> referer: http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044]   File 
>> "C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
>> 339, in urlconf_module\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] return self._urlconf_module\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] AttributeError: 'RegexURLResolver' object 
>> has no attribute '_urlconf_module'\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] \r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] During handling of the above exception, 
>> another exception occurred:\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] \r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] Traceback (most recent call last):\r, 
>> referer: http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044]   File 
>> "C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 
>> 187, in __call__\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] self.load_middleware()\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044]   File 
>> "C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\base.py", line 
>> 49, in load_middleware\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] mw_instance = mw_class()\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044]   File 
>> "C:\\Python33\\lib\\site-packages\\django\\middleware\\locale.py", line 24, 
>> in __init__\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] for url_pattern in 
>> get_resolver(None).url_patterns:\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044]   File 
>> "C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
>> 346, in url_patterns\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044] patterns = getattr(self.urlconf_module, 
>> "urlpatterns", self.urlconf_module)\r, referer: 
>> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
>> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] 
>> [client 90.178.52.216:27044]   File 
>> "C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
>> 341, in urlconf_module\r, referer: 
>> http://176.107.123.11

Re: Upgrading from 1.5 to 1.6 - problem with Apache

2013-11-14 Thread tim
The error message (last line) is quite clear: ImportError: No module named 
'django.conf.urls.defaults'

This module has been removed in 1.6 as noted in the deprecation timeline: 
https://docs.djangoproject.com/en/dev/internals/deprecation/#id3

On Thursday, November 14, 2013 12:57:48 PM UTC-5, Robert Jonathan Šimon 
wrote:
>
> When i upgraded Django from 1.5.1 to 1.6, sudenly Apache gives me this 
> bunch of errors. So i tried manage.py runserver adn it worked fine. When i 
> delete 1.6 and instal 1.5.5 it is all fine and all is working.
>
> [Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] mod_wsgi (pid=9756): Exception occurred processing 
> WSGI script 'C:/Program Files/Apache Software 
> Foundation/Apache2.4/htdocs/mysite/mysite/wsgi.py'., referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] Traceback (most recent call last):\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044]   File 
> "C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
> 339, in urlconf_module\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] return self._urlconf_module\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] AttributeError: 'RegexURLResolver' object has no 
> attribute '_urlconf_module'\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] \r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] During handling of the above exception, another 
> exception occurred:\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] \r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] Traceback (most recent call last):\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044]   File 
> "C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 
> 187, in __call__\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] self.load_middleware()\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044]   File 
> "C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\base.py", line 
> 49, in load_middleware\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] mw_instance = mw_class()\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044]   File 
> "C:\\Python33\\lib\\site-packages\\django\\middleware\\locale.py", line 24, 
> in __init__\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] for url_pattern in 
> get_resolver(None).url_patterns:\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044]   File 
> "C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
> 346, in url_patterns\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] patterns = getattr(self.urlconf_module, 
> "urlpatterns", self.urlconf_module)\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044]   File 
> "C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
> 341, in urlconf_module\r, referer: 
> http://176.107.123.114:9000/hlavni_stranka/prihlasen/
> [Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
> 90.178.52.216:27044] self._urlconf_module = 
> import_module(self

Upgrading from 1.5 to 1.6 - problem with Apache

2013-11-14 Thread Robert Jonathan Šimon
When i upgraded Django from 1.5.1 to 1.6, sudenly Apache gives me this 
bunch of errors. So i tried manage.py runserver adn it worked fine. When i 
delete 1.6 and instal 1.5.5 it is all fine and all is working.

[Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] mod_wsgi (pid=9756): Exception occurred processing 
WSGI script 'C:/Program Files/Apache Software 
Foundation/Apache2.4/htdocs/mysite/mysite/wsgi.py'., referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] Traceback (most recent call last):\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.601025 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
339, in urlconf_module\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] return self._urlconf_module\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] AttributeError: 'RegexURLResolver' object has no 
attribute '_urlconf_module'\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] \r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] During handling of the above exception, another 
exception occurred:\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] \r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] Traceback (most recent call last):\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602002 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 
187, in __call__\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] self.load_middleware()\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.602979 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\handlers\\base.py", line 
49, in load_middleware\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] mw_instance = mw_class()\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\middleware\\locale.py", line 24, 
in __init__\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] for url_pattern in 
get_resolver(None).url_patterns:\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
346, in url_patterns\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] patterns = getattr(self.urlconf_module, 
"urlpatterns", self.urlconf_module)\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File 
"C:\\Python33\\lib\\site-packages\\django\\core\\urlresolvers.py", line 
341, in urlconf_module\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] self._urlconf_module = 
import_module(self.urlconf_name)\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.603955 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044]   File "C:\\Python33\\Lib\\importlib\\__init__.py", 
line 90, in import_module\r, referer: 
http://176.107.123.114:9000/hlavni_stranka/prihlasen/
[Thu Nov 14 17:34:23.604932 2013] [:error] [pid 9756:tid 1044] [client 
90.178.52.216:27044] return _bootstrap._gcd_import(name[level:], 
package, level

Re: Startproject failing on Django 1.6

2013-11-14 Thread Steve Sawyer
Ramiro - I only have a single version of Python installed (I have the 
luxury of being able to keep things simple).

I just tried this again though, using the explicit pathing you recommend. I 
note that I have two copies of django-admin.py, but they're identical - one 
in C:\Python33\Scripts, and the other in site-packages. In any case, I'm 
still getting the ImportError.

I can see that there is an http package that apparently belongs to the 
python standard library, contains a cookies.py module and is located here:

C:\Python33\Lib\http

However, Django installs another http package

C:\Python33\Lib\site-packages\django\http

And this folder contains a file "cookie.py" (singular).

In any case, I'm not sure what module is expected to be imported. However, 
I note that if I try to import http from an interactive session, the 
__init__.py in the Django http package is executed, and I end up getting 
the same ImportError.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f86f8b9-90e4-437c-a8fd-783063a63325%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


votes/score

2013-11-14 Thread Érico Oliveira
Hy, i'm learning django.
My idea is to give marks / votes for a selected job.
Works but not as I would.

class Job(models.Model):
title= models.CharField(max_length=20)
slug = models.SlugField(max_length=40, blank=True)
def __unicode__(self):
return self.title  


class Vote(models.Model):
job = models.ForeignKey(Job)
score = models.IntegerField(blank=True, default=0)


my forms.py

MYVALUES = (
(5, u'5 '), # don't work {{ 
form|safe }}
(5, five'),
(3, u'three'),
(2, u'two'), 
(1, u'one'),
)
class FormVote(forms.ModelForm):
class Meta:
model = Vote
score = forms.ChoiceField(choices=MYVALUES, widget=forms.RadioSelect())



As I did all the html / css. I would not return the form that way.
I tried a different approach, trying to pass the values of the vote 
through a link using jquery, but I can not mount the garvar to view the 
value of voting.

It would be a mess trying to return an HTML inside FormVote, something like:







Help?
thanks in advance.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/736728d8-dc12-41aa-b223-7c8bed0a2cf4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Weekend Cardiff

2013-11-14 Thread Tom Christie
Thanks for that Daniele - will be looking forward to that.
Will make sure to promote it at the next Brighton and London meetups, and 
I'd probably be interested in talking and/or giving a tutorial.
What's the best forum for staying in the loop re. conf organization?

Cheers,

  Tom

On Wednesday, 13 November 2013 23:11:27 UTC, Daniele Procida wrote:
>
> (With apologies if you have already seen this on another email list or 
> newsgroup.) 
>
> The UK's first-ever Django conference will take place on the 7th-9th 
> February 2014 in Cardiff, Wales. 
>
>  
>
> The programme for the event: 
>
> Friday: tutorials and demonstrations (also open to the public) 
> Saturday: talks 
> Sunday: code sprints and clinics 
>
> The conference is Django-focused, but all of all aspects of Python fall 
> within its remit - particularly in the tutorials and workshops. 
>
> A venue has been booked at Cardiff University. 
>
> Registration and ticket sales will open soon, as well as a call for 
> papers. 
>
> To be a success, the conference needs the support of: 
>
> *   people in Wales, the UK and beyond who will participate as attendees 
> or volunteers 
> *   speakers who'd like to give talks or conduct tutorials 
> *   organisations locally and internationally willing to provide 
> sponsorship or other support 
>
> If you can offer support, please get in touch. 
>
> One of the aims of the conference is to establish it as an annual event 
> that will raise the profile in Wales of open-source software in general and 
>  Python in particular, and also bolster the local open-source software 
> community here. 
>
> Above all, however, the intention is to establish the Django Weekend in 
> Cardiff as a meaningful and enjoyable date in the Django/Python calendar. 
>
> We'll publish updates on our website, our Twitter account <
> https://twitter.com/DjangoWeekend> and elsewhere as appropriate. 
>
> Daniele 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bca169c2-4413-4544-8d71-6de598ed95a0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is this what you would expect from this Q query?

2013-11-14 Thread akaariai
On Thursday, November 14, 2013 2:17:43 PM UTC+2, Phoebe Bright wrote:
>
> After a long time trying to create a simple version that would replicate 
> the error, and failing, I've tracked it through the original code.
>
> Line 1140 in django/db/models/sql/query.py in function build_filter
>
> if current_negated and (lookup_type != 'isnull' or value is False):
> self.promote_joins(join_list)
> if (lookup_type != 'isnull' and (
> self.is_nullable(targets[0]) or
> self.alias_map[join_list[-1]].join_type == 
> self.LOUTER)):
> # The condition added here will be SQL like this:
> # NOT (col IS NOT NULL), where the first NOT is added in
> # upper layers of code. The reason for addition is that if 
> col
> # is null, then col != someval will result in SQL "unknown"
> # which isn't the same as in Python. The Python None 
> handling
> # is wanted, and it can be gotten by
> # (col IS NULL OR col != someval)
> #   <=>
> # NOT (col IS NOT NULL AND col = someval).
> clause.add((Constraint(alias, targets[0].column, None), 
> 'isnull', False), AND)  < this is adding the spurious clause
>
> This is django version 1.6 and happens using both the original Q version 
> and using your suggested .exclude version.  
> Having found it I'm still not sure what it means or how to avoid it being 
> triggered!
>
> Any suggestions?
>

I believe the query is actually correct. The idea is that 
.exclude(condition) produces complement of .filter(condition). The simplest 
example I can generate is using raw SQL on PostgreSQL:
akaariai=# create temp table foo(id integer);
CREATE TABLE
akaariai=# insert into foo values(null);
INSERT 0 1
-- What .filter(id__in=[1, 2, 3]) will do:
akaariai=# select * from foo where id in (1, 2, 3);
 id 

(0 rows)

-- If the  "id is not null" condition isn't there
akaariai=# select * from foo where not (id in (1, 2, 3));
 id 

(0 rows)

-- Note: we get still zero rows while we should get the complement, that is 
one row.
-- Add in the id is not null condition
akaariai=# select * from foo where not (id in (1, 2, 3) and id is not null);
 id 

   
(1 row)
-- Now we got the complement of the .filter() query.

The problem comes from this feature in SQL:
  NULL in (1, 2, 3) => unknown
  NOT (NULL in (1, 2, 3)) => unknown
so, NOT (condition) doesn't produce complement of (condition) in SQL! To 
avoid that problem we have to add the AND id IS NOT NULL into the condition.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/133e9b0b-1e93-47fc-82ac-4a97d0cca021%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Problems running tests when magic DB driven properties are added to models

2013-11-14 Thread Tom Evans
Hi all

One of our projects is a conversion of our old C++ ORM/website to
django (1.4.x). Certain pages/parts of the website have been
redeveloped in to django, and we've provided django models mapping to
the existing tables, whilst other pages are still served from our C++
app.

Some of the tables are look-up tables, with columns like (id,
description). If we were starting from scratch with Django, these
would probably be defined as Model.FOO_CHOICES, with each choice being
defined as Model.CHOICE_ONE. One of our developers thought that this
behaviour should be available even on our old style tables, so they
added a snippet like this in app/models/__init__.py:

  for cls in (ItemType, Category, )
  for value in cls.objects.all():
  description = value.description
  key = re.sub("[^\w]+", "_", description).strip("_").upper()
  setattr(cls, key, value.pk)

So, our item type table has this data:

pkdescription
1   Item
2   Product
3   Review

and so this snippet adds the attributes to the ItemType class (eg
ItemType.ITEM, ItemType.PRODUCT, ItemType.REVIEW).

This works well in development and production, but because these
statements are at module level in models/__init__.py, we have problems
in testing because the queries are run before the test databases are
configured.

This means that the DATABASES setting for test must point to working,
up to date databases, which in turn means that we can't use in memory
sqlite databases for testing, we must use the same engine and options
as the working DB, and thus (finally!) testing is too slow and has too
many external dependencies.

I can't easily remove the magic - not enough of the code utilising
these attributes is unit tested to find what would break. I can't lazy
load the attributes, as I don't know what the attribute names might
be. I was hoping there might be some signal I could hang this on that
would be fired after either the standard DB connections have been
created, or when the test DB has replaced them, but there does not
seem to be one.

Any ideas?

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1LJ_o9MkZapep6rd-wWaNqUrnbbsJ7PC%2BLZ0LOd0AqfFg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError at /admin/

2013-11-14 Thread Claudio Filho
Último Zhô
LoSs ihoodizincluding ds sozorsoazolWhizoOaozi i
Em 14 de Nov de 2013 10:27, "Swastik Acharya" 
escreveu:

> I m trying to read the html pages
> but it shows the folowiing error::
> mportError at /admin/
>
> No module named views
>
> Request Method:GETRequest URL:http://127.0.0.1:8050/admin/Django Version:
> 1.4.10Exception Type:ImportErrorException Value:
>
> No module named views
>
> Exception 
> Location:/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
> in import_module, line 35Python Executable:/usr/bin/pythonPython Version:
> 2.7.2Python Path:
>
> ['/home/swastik/Desktop/django1/vxlp',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-linux2',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PIL',
>  '/usr/lib/python2.7/dist-packages/gst-0.10',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/pymodules/python2.7',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>
> Server time:Thu, 14 Nov 2013 04:18:10 -0600
> Traceback Switch to copy-and-paste view 
>
>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
> in get_response
>1.
>
>   response = callback(request, *callback_args, 
> **callback_kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in wrapper
>1.
>
>   return self.admin_view(view, cacheable)(*args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
>_wrapped_view
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>-
>/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py
> in _wrapped_view_func
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in inner
>1.
>
>  current_app=self.name):
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in reverse
>1.
>
>   app_list = resolver.app_dict[ns]
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in app_dict
>1.
>
>   self._populate()
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in _populate
>1.
>
>   lookups.appendlist(pattern.callback, (bits, p_pattern, 
> pattern.default_args))
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in callback
>1.
>
>   self._callback = get_callable(self._callback_str)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/functional.py in
>wrapper
>1.
>
>   result = func(*args)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in get_callable
>1.
>
>   lookup_view = getattr(import_module(mod_name), 
> func_name)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
>▶ Local vars 
>
>
> how to solve this error??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1281eb8c-e338-4d8b-aabd-984fcb684f85%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You rec

Re: Django/Web Programming Pattern

2013-11-14 Thread Claudio Filho
Óhoz
Em 14 de Nov de 2013 12:37, "Timothy W. Cook"  escreveu:

> Well, this isn't likely a Django specific question but since this
> project is built in Django, I'd like to know how best to handle this
> issue.
>
> I have a view that calls a function and performs a long running
> process.  It reads and processes a file, creating potentially
> thousands of objects and can take up to several minutes to complete.
>
> Right now it just displays a pretty much blank template.  This isn't
> very user friendly.  I imagine some kind of counter or progress bar
> but I am not certain how best to display this via Django.
>
> What do others do in this case?
>
> Thanks,
> Tim
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAGUOoSEMQsv%3D96UrWx9CG05yayXVb9K5ECf5n02LXKgaunJCg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is this what you would expect from this Q query?

2013-11-14 Thread tim
Please provide your models so I can reproduce it myself. It's quite 
difficult (at least for me) to help otherwise.

On Thursday, November 14, 2013 7:17:43 AM UTC-5, Phoebe Bright wrote:
>
> After a long time trying to create a simple version that would replicate 
> the error, and failing, I've tracked it through the original code.
>
> Line 1140 in django/db/models/sql/query.py in function build_filter
>
> if current_negated and (lookup_type != 'isnull' or value is False):
> self.promote_joins(join_list)
> if (lookup_type != 'isnull' and (
> self.is_nullable(targets[0]) or
> self.alias_map[join_list[-1]].join_type == 
> self.LOUTER)):
> # The condition added here will be SQL like this:
> # NOT (col IS NOT NULL), where the first NOT is added in
> # upper layers of code. The reason for addition is that if 
> col
> # is null, then col != someval will result in SQL "unknown"
> # which isn't the same as in Python. The Python None 
> handling
> # is wanted, and it can be gotten by
> # (col IS NULL OR col != someval)
> #   <=>
> # NOT (col IS NOT NULL AND col = someval).
> clause.add((Constraint(alias, targets[0].column, None), 
> 'isnull', False), AND)  < this is adding the spurious clause
>
> This is django version 1.6 and happens using both the original Q version 
> and using your suggested .exclude version.  
> Having found it I'm still not sure what it means or how to avoid it being 
> triggered!
>
> Any suggestions?
>
> Phoebe.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/389a4a4e-86ae-4bfe-82a9-57436238462c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django/Web Programming Pattern

2013-11-14 Thread Amirouche Boubekki
Celery might overkill they are other more simple solutions that only
involve your current database and cron jobs.

Regards,


Amirouche


2013/11/14 Jonathan Baker 

> You're welcome. I just set celery+rabbitmq up on a new project, and while
> it can seem like a lot of steps (and potential information overload), it
> isn't so bad once you get a grasp on the concepts.
>
> One thing that recently bit me: once in production with running workers,
> if the models your task code are interacting with change (in my case, a
> south migration from concrete inheritance to abstract), you need to restart
> the workers just like you would Apache (doc:
> http://docs.celeryproject.org/en/latest/userguide/workers.html#restarting-the-worker).
> This seems obvious to me know, but hindsight...
>
>
> On Thu, Nov 14, 2013 at 8:04 AM, Timothy W. Cook  wrote:
>
>> Thanks Jonathan.  Looks interesting from the FAQ.
>> I'll give it a shot and see what happens.
>>
>> On Thu, Nov 14, 2013 at 12:39 PM, Jonathan Baker
>>  wrote:
>> > This sounds like a good candidate for an async Celery task:
>> > http://docs.celeryproject.org/en/latest/index.html
>> >
>> >
>> > On Thu, Nov 14, 2013 at 7:37 AM, Timothy W. Cook  wrote:
>> >>
>> >> Well, this isn't likely a Django specific question but since this
>> >> project is built in Django, I'd like to know how best to handle this
>> >> issue.
>> >>
>> >> I have a view that calls a function and performs a long running
>> >> process.  It reads and processes a file, creating potentially
>> >> thousands of objects and can take up to several minutes to complete.
>> >>
>> >> Right now it just displays a pretty much blank template.  This isn't
>> >> very user friendly.  I imagine some kind of counter or progress bar
>> >> but I am not certain how best to display this via Django.
>> >>
>> >> What do others do in this case?
>> >>
>> >> Thanks,
>> >> Tim
>> >>
>> >>
>> >>
>> >> --
>> >> MLHIM VIP Signup: http://goo.gl/22B0U
>> >> 
>> >> Timothy Cook, MSc   +55 21 94711995
>> >> MLHIM http://www.mlhim.org
>> >> Like Us on FB: https://www.facebook.com/mlhim2
>> >> Circle us on G+: http://goo.gl/44EV5
>> >> Google Scholar: http://goo.gl/MMZ1o
>> >> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Django users" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> >> email to django-users+unsubscr...@googlegroups.com.
>> >> To post to this group, send email to django-users@googlegroups.com.
>> >> Visit this group at http://groups.google.com/group/django-users.
>> >> To view this discussion on the web visit
>> >>
>> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com
>> .
>> >> For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>> >
>> >
>> > --
>> > Jonathan D. Baker
>> > Developer
>> > http://jonathandbaker.com
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to django-users+unsubscr...@googlegroups.com.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/CAPMFOb4M7BSndCdN3N0STgwiN%2BA%2BbAZ5f80OkqBtLB1xosfr7A%40mail.gmail.com
>> .
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> --
>> MLHIM VIP Signup: http://goo.gl/22B0U
>> 
>> Timothy Cook, MSc   +55 21 94711995
>> MLHIM http://www.mlhim.org
>> Like Us on FB: https://www.facebook.com/mlhim2
>> Circle us on G+: http://goo.gl/44EV5
>> Google Scholar: http://goo.gl/MMZ1o
>> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3VisT0PhoHML-hDTX3t9SdRQOQ7UkvYdQz%3DBpai9AKEYA%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> Jonathan D. Baker
> Developer
> http://jonathandbaker.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsu

Re: Django/Web Programming Pattern

2013-11-14 Thread Jonathan Baker
You're welcome. I just set celery+rabbitmq up on a new project, and while
it can seem like a lot of steps (and potential information overload), it
isn't so bad once you get a grasp on the concepts.

One thing that recently bit me: once in production with running workers, if
the models your task code are interacting with change (in my case, a south
migration from concrete inheritance to abstract), you need to restart the
workers just like you would Apache (doc:
http://docs.celeryproject.org/en/latest/userguide/workers.html#restarting-the-worker).
This seems obvious to me know, but hindsight...


On Thu, Nov 14, 2013 at 8:04 AM, Timothy W. Cook  wrote:

> Thanks Jonathan.  Looks interesting from the FAQ.
> I'll give it a shot and see what happens.
>
> On Thu, Nov 14, 2013 at 12:39 PM, Jonathan Baker
>  wrote:
> > This sounds like a good candidate for an async Celery task:
> > http://docs.celeryproject.org/en/latest/index.html
> >
> >
> > On Thu, Nov 14, 2013 at 7:37 AM, Timothy W. Cook  wrote:
> >>
> >> Well, this isn't likely a Django specific question but since this
> >> project is built in Django, I'd like to know how best to handle this
> >> issue.
> >>
> >> I have a view that calls a function and performs a long running
> >> process.  It reads and processes a file, creating potentially
> >> thousands of objects and can take up to several minutes to complete.
> >>
> >> Right now it just displays a pretty much blank template.  This isn't
> >> very user friendly.  I imagine some kind of counter or progress bar
> >> but I am not certain how best to display this via Django.
> >>
> >> What do others do in this case?
> >>
> >> Thanks,
> >> Tim
> >>
> >>
> >>
> >> --
> >> MLHIM VIP Signup: http://goo.gl/22B0U
> >> 
> >> Timothy Cook, MSc   +55 21 94711995
> >> MLHIM http://www.mlhim.org
> >> Like Us on FB: https://www.facebook.com/mlhim2
> >> Circle us on G+: http://goo.gl/44EV5
> >> Google Scholar: http://goo.gl/MMZ1o
> >> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to django-users+unsubscr...@googlegroups.com.
> >> To post to this group, send email to django-users@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/django-users.
> >> To view this discussion on the web visit
> >>
> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com
> .
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
> >
> >
> > --
> > Jonathan D. Baker
> > Developer
> > http://jonathandbaker.com
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/CAPMFOb4M7BSndCdN3N0STgwiN%2BA%2BbAZ5f80OkqBtLB1xosfr7A%40mail.gmail.com
> .
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3VisT0PhoHML-hDTX3t9SdRQOQ7UkvYdQz%3DBpai9AKEYA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb5RV-d%3DEUj8RDutR6gxUcPP3KtFFYghK6grHfTBgv8bZA%40mail.gmail

Re: Django/Web Programming Pattern

2013-11-14 Thread Larry Martell
On Thu, Nov 14, 2013 at 9:37 AM, Timothy W. Cook  wrote:

> Well, this isn't likely a Django specific question but since this
> project is built in Django, I'd like to know how best to handle this
> issue.
>
> I have a view that calls a function and performs a long running
> process.  It reads and processes a file, creating potentially
> thousands of objects and can take up to several minutes to complete.
>
> Right now it just displays a pretty much blank template.  This isn't
> very user friendly.  I imagine some kind of counter or progress bar
> but I am not certain how best to display this via Django.
>
> What do others do in this case?
>

I have a situation where I'm loading a lot of images that takes a long
time. What I do is I have this code in my template:

 ... loading images 

$('.loadMsg').show();

window.onload = function() {
$(function() {
$('.loadMsg').hide();
});
};

Not the most elegant thing in the world, but it works and meets my needs.
YMMV

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY5U1ngNF_WiNJv40nrW-U%3DsuB5DxEhaQ2_2rDk7X1W7JQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django/Web Programming Pattern

2013-11-14 Thread Timothy W. Cook
Thanks Jonathan.  Looks interesting from the FAQ.
I'll give it a shot and see what happens.

On Thu, Nov 14, 2013 at 12:39 PM, Jonathan Baker
 wrote:
> This sounds like a good candidate for an async Celery task:
> http://docs.celeryproject.org/en/latest/index.html
>
>
> On Thu, Nov 14, 2013 at 7:37 AM, Timothy W. Cook  wrote:
>>
>> Well, this isn't likely a Django specific question but since this
>> project is built in Django, I'd like to know how best to handle this
>> issue.
>>
>> I have a view that calls a function and performs a long running
>> process.  It reads and processes a file, creating potentially
>> thousands of objects and can take up to several minutes to complete.
>>
>> Right now it just displays a pretty much blank template.  This isn't
>> very user friendly.  I imagine some kind of counter or progress bar
>> but I am not certain how best to display this via Django.
>>
>> What do others do in this case?
>>
>> Thanks,
>> Tim
>>
>>
>>
>> --
>> MLHIM VIP Signup: http://goo.gl/22B0U
>> 
>> Timothy Cook, MSc   +55 21 94711995
>> MLHIM http://www.mlhim.org
>> Like Us on FB: https://www.facebook.com/mlhim2
>> Circle us on G+: http://goo.gl/44EV5
>> Google Scholar: http://goo.gl/MMZ1o
>> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Jonathan D. Baker
> Developer
> http://jonathandbaker.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPMFOb4M7BSndCdN3N0STgwiN%2BA%2BbAZ5f80OkqBtLB1xosfr7A%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
MLHIM VIP Signup: http://goo.gl/22B0U

Timothy Cook, MSc   +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3VisT0PhoHML-hDTX3t9SdRQOQ7UkvYdQz%3DBpai9AKEYA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django/Web Programming Pattern

2013-11-14 Thread Jonathan Baker
This sounds like a good candidate for an async Celery task:
http://docs.celeryproject.org/en/latest/index.html


On Thu, Nov 14, 2013 at 7:37 AM, Timothy W. Cook  wrote:

> Well, this isn't likely a Django specific question but since this
> project is built in Django, I'd like to know how best to handle this
> issue.
>
> I have a view that calls a function and performs a long running
> process.  It reads and processes a file, creating potentially
> thousands of objects and can take up to several minutes to complete.
>
> Right now it just displays a pretty much blank template.  This isn't
> very user friendly.  I imagine some kind of counter or progress bar
> but I am not certain how best to display this via Django.
>
> What do others do in this case?
>
> Thanks,
> Tim
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPMFOb4M7BSndCdN3N0STgwiN%2BA%2BbAZ5f80OkqBtLB1xosfr7A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django/Web Programming Pattern

2013-11-14 Thread Timothy W. Cook
Well, this isn't likely a Django specific question but since this
project is built in Django, I'd like to know how best to handle this
issue.

I have a view that calls a function and performs a long running
process.  It reads and processes a file, creating potentially
thousands of objects and can take up to several minutes to complete.

Right now it just displays a pretty much blank template.  This isn't
very user friendly.  I imagine some kind of counter or progress bar
but I am not certain how best to display this via Django.

What do others do in this case?

Thanks,
Tim



-- 
MLHIM VIP Signup: http://goo.gl/22B0U

Timothy Cook, MSc   +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3WXxamXh3avPc%2BmW0yWHJERPACsvvLErx9T8OJc%3D5tsUA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ImportError at /admin/

2013-11-14 Thread Avraham Serour
somewhere you are trying to do a 'import views' and python can't find
nothing with this name,

try using from appname import views


On Thu, Nov 14, 2013 at 12:25 PM, Swastik Acharya wrote:

> I m trying to read the html pages
> but it shows the folowiing error::
> mportError at /admin/
>
> No module named views
>
> Request Method:GET Request URL:http://127.0.0.1:8050/admin/ Django
> Version:1.4.10Exception Type: ImportErrorException Value:
>
>
> No module named views
>
> Exception 
> Location:/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py
> in import_module, line 35 Python Executable:/usr/bin/python Python
> Version:2.7.2Python Path:
>
> ['/home/swastik/Desktop/django1/vxlp',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-linux2',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PIL',
>  '/usr/lib/python2.7/dist-packages/gst-0.10',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/pymodules/python2.7',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-client',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
>  '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
>
> Server time: Thu, 14 Nov 2013 04:18:10 -0600
> Traceback Switch to copy-and-paste view 
>
>- /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py
> in get_response
>1.
>
>   response = callback(request, *callback_args, 
> **callback_kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in wrapper
>1.
>
>   return self.admin_view(view, cacheable)(*args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in
>_wrapped_view
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>-
>/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py
> in _wrapped_view_func
>1.
>
>   response = view_func(request, *args, **kwargs)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
> in inner
>1.
>
>  current_app=self.name):
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in reverse
>1.
>
>   app_list = resolver.app_dict[ns]
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in app_dict
>1.
>
>   self._populate()
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in _populate
>1.
>
>   lookups.appendlist(pattern.callback, (bits, p_pattern, 
> pattern.default_args))
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in callback
>1.
>
>   self._callback = get_callable(self._callback_str)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/functional.py in
>wrapper
>1.
>
>   result = func(*args)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py
> in get_callable
>1.
>
>   lookup_view = getattr(import_module(mod_name), 
> func_name)
>
>   ...
>▶ Local vars 
>- /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in
>import_module
>1.
>
>   __import__(name)
>
>   ...
>▶ Local vars 
>
>
> how to solve this error??
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1281eb8c-e338-4d8b-aabd-984fcb684f85%40googlegroups.com
> .
> F

Re: Tango with Django Chapter 7 (Add_page)

2013-11-14 Thread Lee
No problem at all, glad it worked out for you :-)

Good luck with the rest of the tutorial

Cheers

On Thursday, 14 November 2013 12:16:06 UTC, Amimo Benja wrote:
>
> Thanks Lee, it worked. The problem was I had not passed category_name_url 
> from my view function to the category template. The moment I passed it, it 
> worked without any problem. Thanks a lot Man. At least I can proceed. 
> Phee...w!!! Thanks again.
>
> On Thursday, November 14, 2013 3:08:27 PM UTC+3, Lee wrote:
>>
>> Noob here so I may be way wrong but it looks to me like your problem is 
>> probably in link in category page when generating the link to add_page, 
>> given the url in the error is missing the category name in the URL. Have 
>> you passed category_name_url from your view function to the category 
>> template? Your views.py link seems to show forms.py rather than the view 
>> functions so I cant see the view, but my category view looks as follows and 
>> works:
>>
>>  def category(request, category_name_url):
>> context = RequestContext(request)
>> category_name = decode_url(category_name_url)
>> context_dict = {'category_name': category_name, 'category_name_url': 
>> category_name_url}
>>
>> try:
>> category = Category.objects.get(name=category_name)
>> pages = Page.objects.filter(category=category)
>> context_dict['pages'] = pages
>> context_dict['category'] = category
>> except Category.DoesNotExist:
>> pass
>>
>> return render_to_response('rango/category.html', context_dict, context)
>>
>> And I am also mid way through Tango with Django if you hadn't guessed ;-)
>>
>>
>> On Wednesday, 13 November 2013 12:14:40 UTC, Amimo Benja wrote:
>>>
>>> Hey all,
>>>
>>> Am currently practicing using this tutorial 
>>> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
>>> constantly getting this error "The current URL, 
>>> rango/category//add_page/, didn't match any of these." every time I 
>>> click on the Add a Page 
>>> link 
>>> in the Category.html. I don't know how to solve it. Any help? Thanks.
>>>
>>> Here are my 
>>> 1. Views.py http://pastebin.mozilla.org/3595121
>>> 2. rango/urls.py http://pastebin.mozilla.org/3595145
>>> 3. add_page.html http://pastebin.mozilla.org/3595156
>>> 4. category.html http://pastebin.mozilla.org/3595158
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cdef43db-8232-41eb-b5eb-5f898e3ca4ab%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


ImportError at /admin/

2013-11-14 Thread Swastik Acharya
I m trying to read the html pages
but it shows the folowiing error::
mportError at /admin/

No module named views

Request Method:GETRequest URL:http://127.0.0.1:8050/admin/Django Version:
1.4.10Exception Type:ImportErrorException Value:

No module named views

Exception 
Location:/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py 
in import_module, line 35Python Executable:/usr/bin/pythonPython Version:
2.7.2Python Path:

['/home/swastik/Desktop/django1/vxlp',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']

Server time:Thu, 14 Nov 2013 04:18:10 -0600
Traceback Switch to copy-and-paste view 

   - /usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in 
   get_response
   1. 
  
  response = callback(request, *callback_args, 
**callback_kwargs)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
in wrapper
   1. 
  
  return self.admin_view(view, cacheable)(*args, **kwargs)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/utils/decorators.py in 
   _wrapped_view
   1. 
  
  response = view_func(request, *args, **kwargs)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py
in _wrapped_view_func
   1. 
  
  response = view_func(request, *args, **kwargs)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py
in inner
   1. 
  
 current_app=self.name):
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   reverse
   1. 
  
  app_list = resolver.app_dict[ns]
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   app_dict
   1. 
  
  self._populate()
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   _populate
   1. 
  
  lookups.appendlist(pattern.callback, (bits, p_pattern, 
pattern.default_args))
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   callback
   1. 
  
  self._callback = get_callable(self._callback_str)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/utils/functional.py in 
   wrapper
   1. 
  
  result = func(*args)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in 
   get_callable
   1. 
  
  lookup_view = getattr(import_module(mod_name), func_name)
  
  ...
   ▶ Local vars 
   - /usr/local/lib/python2.7/dist-packages/django/utils/importlib.py in 
   import_module
   1. 
  
  __import__(name)
  
  ...
   ▶ Local vars 
   

how to solve this error??

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1281eb8c-e338-4d8b-aabd-984fcb684f85%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is this what you would expect from this Q query?

2013-11-14 Thread Phoebe Bright
After a long time trying to create a simple version that would replicate 
the error, and failing, I've tracked it through the original code.

Line 1140 in django/db/models/sql/query.py in function build_filter

if current_negated and (lookup_type != 'isnull' or value is False):
self.promote_joins(join_list)
if (lookup_type != 'isnull' and (
self.is_nullable(targets[0]) or
self.alias_map[join_list[-1]].join_type == 
self.LOUTER)):
# The condition added here will be SQL like this:
# NOT (col IS NOT NULL), where the first NOT is added in
# upper layers of code. The reason for addition is that if 
col
# is null, then col != someval will result in SQL "unknown"
# which isn't the same as in Python. The Python None 
handling
# is wanted, and it can be gotten by
# (col IS NULL OR col != someval)
#   <=>
# NOT (col IS NOT NULL AND col = someval).
clause.add((Constraint(alias, targets[0].column, None), 
'isnull', False), AND)  < this is adding the spurious clause

This is django version 1.6 and happens using both the original Q version 
and using your suggested .exclude version.  
Having found it I'm still not sure what it means or how to avoid it being 
triggered!

Any suggestions?

Phoebe.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/716b0373-8975-4518-815d-88906fb188db%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-14 Thread Amimo Benja
Thanks Lee, it worked. The problem was I had not passed category_name_url 
from my view function to the category template. The moment I passed it, it 
worked without any problem. Thanks a lot Man. At least I can proceed. 
Phee...w!!! Thanks again.

On Thursday, November 14, 2013 3:08:27 PM UTC+3, Lee wrote:
>
> Noob here so I may be way wrong but it looks to me like your problem is 
> probably in link in category page when generating the link to add_page, 
> given the url in the error is missing the category name in the URL. Have 
> you passed category_name_url from your view function to the category 
> template? Your views.py link seems to show forms.py rather than the view 
> functions so I cant see the view, but my category view looks as follows and 
> works:
>
>  def category(request, category_name_url):
> context = RequestContext(request)
> category_name = decode_url(category_name_url)
> context_dict = {'category_name': category_name, 'category_name_url': 
> category_name_url}
>
> try:
> category = Category.objects.get(name=category_name)
> pages = Page.objects.filter(category=category)
> context_dict['pages'] = pages
> context_dict['category'] = category
> except Category.DoesNotExist:
> pass
>
> return render_to_response('rango/category.html', context_dict, context)
>
> And I am also mid way through Tango with Django if you hadn't guessed ;-)
>
>
> On Wednesday, 13 November 2013 12:14:40 UTC, Amimo Benja wrote:
>>
>> Hey all,
>>
>> Am currently practicing using this tutorial 
>> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
>> constantly getting this error "The current URL, 
>> rango/category//add_page/, didn't match any of these." every time I 
>> click on the Add a Page  
>> link 
>> in the Category.html. I don't know how to solve it. Any help? Thanks.
>>
>> Here are my 
>> 1. Views.py http://pastebin.mozilla.org/3595121
>> 2. rango/urls.py http://pastebin.mozilla.org/3595145
>> 3. add_page.html http://pastebin.mozilla.org/3595156
>> 4. category.html http://pastebin.mozilla.org/3595158
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/74663178-37fa-4124-9a6a-82e069c636f3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-14 Thread Lee
Noob here so I may be way wrong but it looks to me like your problem is 
probably in link in category page when generating the link to add_page, 
given the url in the error is missing the category name in the URL. Have 
you passed category_name_url from your view function to the category 
template? Your views.py link seems to show forms.py rather than the view 
functions so I cant see the view, but my category view looks as follows and 
works:

 def category(request, category_name_url):
context = RequestContext(request)
category_name = decode_url(category_name_url)
context_dict = {'category_name': category_name, 'category_name_url': 
category_name_url}

try:
category = Category.objects.get(name=category_name)
pages = Page.objects.filter(category=category)
context_dict['pages'] = pages
context_dict['category'] = category
except Category.DoesNotExist:
pass

return render_to_response('rango/category.html', context_dict, context)

And I am also mid way through Tango with Django if you hadn't guessed ;-)


On Wednesday, 13 November 2013 12:14:40 UTC, Amimo Benja wrote:
>
> Hey all,
>
> Am currently practicing using this tutorial 
> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
> constantly getting this error "The current URL, 
> rango/category//add_page/, didn't match any of these." every time I click 
> on the Add a Page  link 
> in the Category.html. I don't know how to solve it. Any help? Thanks.
>
> Here are my 
> 1. Views.py http://pastebin.mozilla.org/3595121
> 2. rango/urls.py http://pastebin.mozilla.org/3595145
> 3. add_page.html http://pastebin.mozilla.org/3595156
> 4. category.html http://pastebin.mozilla.org/3595158
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/668f0b64-f008-46fe-8362-d90f47f73f0b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Tango with Django Chapter 7 (Add_page)

2013-11-14 Thread Amimo Benja
It seems not to be working. It raises an error that Invalid block tag: 
''views:category_name_url''

On Wednesday, November 13, 2013 3:38:47 PM UTC+3, Sergiy Khohlov wrote:
>
> try to change 
> Add a Page 
>  to 
> Add a Page 
> Many thanks, 
>
> Serge 
>
>
> +380 636150445 
> skype: skhohlov 
>
>
> On Wed, Nov 13, 2013 at 2:14 PM, Amimo Benja 
> > 
> wrote: 
> > Hey all, 
> > 
> > Am currently practicing using this tutorial 
> > http://www.tangowithdjango.com/book/chapters/forms.html, but I'm 
> constantly 
> > getting this error "The current URL, rango/category//add_page/, didn't 
> match 
> > any of these." every time I click on the Add a Page link in the 
> > Category.html. I don't know how to solve it. Any help? Thanks. 
> > 
> > Here are my 
> > 1. Views.py http://pastebin.mozilla.org/3595121 
> > 2. rango/urls.py http://pastebin.mozilla.org/3595145 
> > 3. add_page.html http://pastebin.mozilla.org/3595156 
> > 4. category.html http://pastebin.mozilla.org/3595158 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/4731ffd8-f500-40a2-af7b-9587195bc092%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/groups/opt_out. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ad99603c-5f6b-41e4-9b55-3509c6c348b1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Fixture extraction

2013-11-14 Thread Javier Guerra Giraldez
On Thu, Nov 14, 2013 at 3:12 AM, Anton Pirker  wrote:
> The optimal solution would be that I can give a number of auth_users to a
> script, and it will extract all data neccessary to have a complete set of
> data for the given users.
>
> A plus would be, if the email addresses of the users would be anonymized and
> the password would be set to some default password.


check the serializers doc.  it's not hard to get a queryset and export
as a fixture.

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFkDaoSQzj1OxAbjE%3DhPbkQBj71MsTrYUdK4ZTXEYLVRFBhXYw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Fixture extraction

2013-11-14 Thread Anton Pirker
Hello!

I have a fairly large production database (about 40GB) and I want to
extract a sample of it as fixtures so I can use this sample for
development.

The optimal solution would be that I can give a number of auth_users to a
script, and it will extract all data neccessary to have a complete set of
data for the given users.

A plus would be, if the email addresses of the users would be anonymized
and the password would be set to some default password.

Has anybody used any of the fixture packages [1] available?
Can anybody recommend a package, or an approach on how to do this?

Thanks in advance,
Anton

1: https://www.djangopackages.com/grids/g/fixtures/



-- 

DI(FH) Anton Pirker

-
IGNAZ Softwaremanufaktur
agile software development

wurlitzergasse 58/20
a-1160 wien
tel: +43 699 1234 0 456
skype: antonpirker
http://anton-pirker.athttp://ignaz.at

Currently working on: Relaunch of http://bikemap.net
My latest project: http://creativesociety.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACu05bUWgwKAJB0jP_63uEubfEmx5qmm90d-_YPZrCAjz%3DCJxA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.