error in installing django-facebook

2013-03-11 Thread Avnesh Shakya
i m trying to install django-facebook but it's showing error, i unable to
catch it please help me.
error -
C:\django-facebook-5.0.2prealpha>python setup.py install
No handlers could be found for logger "django_facebook"
Traceback (most recent call last):
  File "setup.py", line 11, in 
from distutils.core import setup, find_packages
ImportError: cannot import name find_packages


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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Trouble with Custom User Modle and "createsupermethod"

2013-03-11 Thread Russell Keith-Magee
On Tue, Mar 12, 2013 at 5:49 AM, Gabriel Cavalcante <
gabriel.cavalcant...@gmail.com> wrote:

> Hello EveryBody,
>
> I'm trying to implement a custom user model, using django 1.5 and the
> example available at:
>
>
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#a-full-example
>
> For now, I'm able to create a super user based on my custom model only if
> it has none of ForeignKey or M2M modelfields. When I try to use a
> ForeignKey, for example, the following error occurs (obtained trough
> --traceback option of createsuperuser command):
>
> http://dpaste.com/hold/1019886/
>
> In other way,  I can instantiate the class and it has the attribute
> "_state". Additionally, "_state.db" is None.
>
> How can I fix this? I'm doing something wrong?
>
>
You're not doing something wrong per-se -- I think you're just doing
something that isn't exactly compatible with the createsuperuer management
command.

I suspect you'll find that while the createsuperuser management doesn't
work, DsimUser.objects.create_superuser() *will* work as a command issue
from the Python shell.

The problem is that you've created a User model that the createsuperuser
management command can't instantiate. Since client is a required field,
createsuperuser will be asking the user for a value -- but the value needs
to be a foreign key value, and that can't be entered at the keyboard (at
least, not without some post-processing). The error you're seeing is
unusual, but I suspect it's because the internals of Django are turning the
string input into an object that can't be saved as the FK value for the
User object.

This is doubly true for m2m relations -- not only can't you specify an m2m
relation at the keyboard, you can't create an m2m relation until it the
objects involved in the relation have been saved.

This is worth reporting as a bug -- at the very least, we should document
and validate that REQUIRED_FIELDS aren't foreign keys or m2m. A better (but
more complex) solution still would be to allow keyboard entry of FK and m2m
field data (including appropriate hints/search functionality).

Yours,
Russ Magee %-)

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] how to debug when I send the data by POST.

2013-03-11 Thread lx
*hi: *
*   I'm a new one in django, I' using the django recevice the data by POST.*

*for examle:*

wget -v --post-file=conf.xml http://192.168.23.21:8001/time/


*this way can't show the wrong message, when I write the wrong code like
this:*

 conf_xml =  request.body
 root = ET.fromstring(conf_xml)
 root = tree.getroot()

*the wrong messages is:*
*
*
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
  File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 127, in
finish_response
self.write(data)
  File "/usr/local/lib/python2.7/wsgiref/handlers.py", line 215, in write
self._write(data)
  File "/usr/local/lib/python2.7/socket.py", line 322, in write
self.flush()
  File "/usr/local/lib/python2.7/socket.py", line 301, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 104] Connection reset by peer

Exception happened during processing of request from ('192.168.23.21',
47107)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/SocketServer.py", line 582, in
process_request_thread
self.finish_request(request, client_address)
  File "/usr/local/lib/python2.7/SocketServer.py", line 323, in
finish_request
self.RequestHandlerClass(request, client_address, self)
  File
"/usr/local/lib/python2.7/site-packages/django/core/servers/basehttp.py",
line 139, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
  File "/usr/local/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
  File "/usr/local/lib/python2.7/socket.py", line 301, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe


*the question is how to debug easily except  Web Page.*
*
*
*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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Editing the RSS in the Django community feeds

2013-03-11 Thread Russell Keith-Magee
Hi Shabda,

I've got hold of the server logs - the feeds are tied into a bigger
framework for actually gathering the blog entries, and older feeds are
resisting change :-)

There are two options here:

 * You should be able edit the feed yourself: visit
http://www.djangoproject.com/community/mine and update the details.

 * Try deleting the feed and re-adding it.

If you're still having problems, try emailing ja...@jacobian.org - he's got
the keys to the servers, and should be able to fix things at a low level.

Yours,
Russ Magee %-)

On Tue, Mar 12, 2013 at 8:21 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> Hi Shabda,
>
> I took a look at this for you, but for some reason the new URL is throwing
> an error (on our end) when I try and update it. I'll keep digging and let
> you know when it's working.
>
> Yours,
> Russ Magee %-)
>
>
> On Mon, Mar 11, 2013 at 8:34 PM, Shabda Raaj  wrote:
>
>> Hello,
>>
>> The Django community RSS feeds has a form to add new RSS:
>> https://www.djangoproject.com/community/add/blogs/
>>
>> We have our RSS added in this from way back. However sometime we write
>> about non-django stuff, which is not relevant in this feed. I would like to
>> update this to our Django only feed:
>>
>> http://agiliq.com/blog/rss/latest/django/
>>
>> Can someone with access do this? (or advise me who can I contact to edit
>> this.)
>>
>> --
>> 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Trouble with Custom User Modle and "createsupermethod"

2013-03-11 Thread Gabriel Cavalcante
Hello EveryBody,

I'm trying to implement a custom user model, using django 1.5 and the 
example available at:

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#a-full-example

For now, I'm able to create a super user based on my custom model only if 
it has none of ForeignKey or M2M modelfields. When I try to use a 
ForeignKey, for example, the following error occurs (obtained trough 
--traceback option of createsuperuser command):

http://dpaste.com/hold/1019886/

In other way,  I can instantiate the class and it has the attribute 
"_state". Additionally, "_state.db" is None.

How can I fix this? I'm doing something wrong? 

Below, the models:

http://dpaste.com/hold/1019890/

Thank you in advance.

Gabriel Abdalla Cavalcante

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django payment gateway with subscription management

2013-03-11 Thread Silviu Dicu
one suggestion:

- stripe has subscription built in, you don't need to keep the data on your 
server.
  you can use stripe.js to send directly the payment info to stripe.

-silviu

On Tuesday, 5 March 2013 15:34:33 UTC-5, Jaimin Patel wrote:
>
> Hello,
>
> We are evaluating different payment gateways for subscription management 
> for one of the app which requires the subscription based model (monthly, 6 
> months, year). 
>
> I checked different packages available here - 
> https://www.djangopackages.com/grids/g/payment-processing/
>
> Though I am confuse which one I should be using, can someone recommend 
> which one is actively maintained and most commonly used for subscription 
> based model where users can signup for free and if they want they can 
> subscribe later on. We don't required to store the credit card details and 
> it can be taken care by the payment gateway.
>
> Thanks. 
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Editing the RSS in the Django community feeds

2013-03-11 Thread Russell Keith-Magee
Hi Shabda,

I took a look at this for you, but for some reason the new URL is throwing
an error (on our end) when I try and update it. I'll keep digging and let
you know when it's working.

Yours,
Russ Magee %-)

On Mon, Mar 11, 2013 at 8:34 PM, Shabda Raaj  wrote:

> Hello,
>
> The Django community RSS feeds has a form to add new RSS:
> https://www.djangoproject.com/community/add/blogs/
>
> We have our RSS added in this from way back. However sometime we write
> about non-django stuff, which is not relevant in this feed. I would like to
> update this to our Django only feed:
>
> http://agiliq.com/blog/rss/latest/django/
>
> Can someone with access do this? (or advise me who can I contact to edit
> this.)
>
> --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Restful User Authentication for Ember/Backbone client with Tastypie

2013-03-11 Thread Jaimin Patel
Not sure about your first questions.

For right way to authenticate is solely depends on your requirement. 
If you don't care about who is using the data > you can turn off the data, 
if you want only your application users to use it > you can use 
DjangoAuthentication
if you want minimal security > use Dajngo API key Authentication
More secure > use OAuth mechanism

hope it helps!

On Sunday, March 10, 2013 4:54:10 PM UTC-4, Pratik Mandrekar wrote:
>
> Hello,
>
> I'm trying to figure out what would be the best way to integrate django 
> with ember.js/backbone from the user authentication point of view. I'm 
> using Tastypie for creating RESTful resources.
>
> I have no problem creating APIs once a user has been authenticated using 
> the Session based authentication but I am wondering what is the best 
> RESTful way to create  a user authentication API that can confirm to 
> Session based authentication.
>
> Also if I'm not mistaken the right way to authenticate the client is via 
> the API key authentication right?
>
> Thanks,
> Pratik
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django payment gateway with subscription management

2013-03-11 Thread Jaimin Patel
Thanks Pankaj.

Is there any step by step tutorial to integrate this. I tried to follow the 
documentation, and not sure how to integrate from this step 
- http://django-stripe-payments.readthedocs.org/en/latest/templatetags.html

Thanks.

On Wednesday, March 6, 2013 3:09:00 AM UTC-5, psjinx wrote:
>
> Hey Jaimin,
> For recurring submissions managed by Stripe, have a look at 
> https://github.com/eldarion/django-stripe-payments
>
> Sincerely,
> Pankaj Singh
> http://about.me/psjinx
>
>
> On Wed, Mar 6, 2013 at 2:27 AM, Jaimin Patel  > wrote:
>
>> Yes, we are USA based and I come across stripe. It seems very developer 
>> friendly. Is there any example on setting up recurring payments using 
>> stripe?
>>
>>
>> On Tuesday, March 5, 2013 3:47:06 PM UTC-5, Mayukh Mukherjee wrote:
>>
>>> Stripe if you're in the us (am not sure which other countries they've 
>>> rolled out to). 
>>>
>>>
>>> On Tue, Mar 5, 2013 at 3:34 PM, Jaimin Patel  wrote:
>>>
 Hello,

 We are evaluating different payment gateways for subscription 
 management for one of the app which requires the subscription based model 
 (monthly, 6 months, year). 

 I checked different packages available here - 
 https://www.djangopackages.**com/grids/g/payment-**processing/
  
 Though I am confuse which one I should be using, can someone recommend 
 which one is actively maintained and most commonly used for subscription 
 based model where users can signup for free and if they want they can 
 subscribe later on. We don't required to store the credit card details and 
 it can be taken care by the payment gateway.

 Thanks. 

 -- 
 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?hl=en
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_out
 .
  
  

>>>
>>>
>>>
>>> -- 
>>> Mayukh Mukherjee
>>> http://www.linkedin.com/in/**mayukhmmukherjee
>>>
>>>
>>>   -- 
>> 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Restful User Authentication for Ember/Backbone client with Tastypie

2013-03-11 Thread Silviu Dicu
Tastypie supports custom authentication.
You don't have to use the api_key.
I'm not sure what is the best way to do it however :)


On Sunday, 10 March 2013 16:54:10 UTC-4, Pratik Mandrekar wrote:
>
> Hello,
>
> I'm trying to figure out what would be the best way to integrate django 
> with ember.js/backbone from the user authentication point of view. I'm 
> using Tastypie for creating RESTful resources.
>
> I have no problem creating APIs once a user has been authenticated using 
> the Session based authentication but I am wondering what is the best 
> RESTful way to create  a user authentication API that can confirm to 
> Session based authentication.
>
> Also if I'm not mistaken the right way to authenticate the client is via 
> the API key authentication right?
>
> Thanks,
> Pratik
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: urls.py not loading changes

2013-03-11 Thread Asier Hernández Juanes
I found a solution!

I created a file /tmp/django.pid with the PID of the UWSGI master-process, 
then I executed in the shell the command  uwsgi-core --reload 
/tmp/django.pid and the UWSGI process has restarted and the urls.py changes 
are working now.

Thanks a lot for the help!

El sábado, 9 de marzo de 2013 16:33:31 UTC+1, Asier Hernández Juanes 
escribió:
>
> I have launched a "/etc/init.d/uwsgi restart" but the application is still 
> not loading the changes in urls.py file.
>
> I think I have to kill the process because after restarting the uwsgi 
> process the PID is still the same:
>
> *root@miami ~ # ps -fea|grep uwsgi
> uwsgi11916 1  0 Jan22 ?00:03:52 uwsgi --uid uwsgi --home 
> /home/oper/bros --pythonpath /home/oper/bros/src --socket 
> 127.0.0.1:5001--chmod-socket --module wsgi -b 8192 --logdate --optimize 2 
> --processes 2 
> --master --logto /home/oper/bros/log/uwsgi.log
> uwsgi11917 11916  0 Jan22 ?00:08:19 uwsgi --uid uwsgi --home 
> /home/oper/bros --pythonpath /home/oper/bros/src --socket 
> 127.0.0.1:5001--chmod-socket --module wsgi -b 8192 --logdate --optimize 2 
> --processes 2 
> --master --logto /home/oper/bros/log/uwsgi.log
> uwsgi11918 11916  0 Jan22 ?00:06:15 uwsgi --uid uwsgi --home 
> /home/oper/bros --pythonpath /home/oper/bros/src --socket 
> 127.0.0.1:5001--chmod-socket --module wsgi -b 8192 --logdate --optimize 2 
> --processes 2 
> --master --logto /home/oper/bros/log/uwsgi.log
> uwsgi11975 1  0 Jan22 ?00:03:57 uwsgi --uid uwsgi --home 
> /home/oper/fys --pythonpath /home/oper/fys/src --socket 
> 127.0.0.1:5002--chmod-socket --module wsgi -b 8192 --logdate --optimize 2 
> --processes 2 
> --master --logto /home/oper/fys/log/uwsgi.log
> uwsgi11976 11975  0 Jan22 ?00:02:19 uwsgi --uid uwsgi --home 
> /home/oper/fys --pythonpath /home/oper/fys/src --socket 
> 127.0.0.1:5002--chmod-socket --module wsgi -b 8192 --logdate --optimize 2 
> --processes 2 
> --master --logto /home/oper/fys/log/uwsgi.log
> uwsgi11977 11975  0 Jan22 ?00:01:50 uwsgi --uid uwsgi --home 
> /home/oper/fys --pythonpath /home/oper/fys/src --socket 
> 127.0.0.1:5002--chmod-socket --module wsgi -b 8192 --logdate --optimize 2 
> --processes 2 
> --master --logto /home/oper/fys/log/uwsgi.log
> root 18451 17969  0 16:30 pts/000:00:00 grep --color=auto uwsgi*
>
> Some clue to restart uwsgi process. I know how to kill it but what is the 
> best way to restart it?
>
> Thanks!
>
> El sábado, 9 de marzo de 2013 16:19:58 UTC+1, Asier Hernández Juanes 
> escribió:
>>
>> The problem is that I am administrating this server where the Django 
>> application was already installed and deployed so I don't have this 
>> information.
>>
>> However I have execute "ps -e" to view all the processes running on my 
>> server and I got this:
>>
>>   PID TTY  TIME CMD
>> 1 ?00:00:25 init
>> 2 ?00:00:00 kthreadd
>> 3 ?00:03:02 ksoftirqd/0
>> 5 ?00:00:00 kworker/u:0
>> 6 ?00:00:00 migration/0
>> 7 ?00:08:20 watchdog/0
>> 8 ?00:00:00 cpuset
>> 9 ?00:00:00 khelper
>>10 ?00:00:00 kdevtmpfs
>>11 ?00:00:00 netns
>>12 ?00:00:27 sync_supers
>>13 ?00:00:00 bdi-default
>>14 ?00:00:00 kintegrityd
>>15 ?00:00:00 kblockd
>>16 ?00:00:00 ata_sff
>>17 ?00:00:00 khubd
>>18 ?00:00:00 md
>>19 ?00:05:58 kworker/0:1
>>21 ?00:00:02 khungtaskd
>>22 ?00:05:22 kswapd0
>>23 ?00:00:00 ksmd
>>24 ?00:00:00 fsnotify_mark
>>25 ?00:00:00 ecryptfs-kthrea
>>26 ?00:00:00 crypto
>>35 ?00:00:00 kthrotld
>>36 ?00:00:00 scsi_eh_0
>>37 ?00:00:00 scsi_eh_1
>>40 ?00:00:00 binder
>>41 ?00:00:00 kworker/u:4
>>60 ?00:00:00 deferwq
>>61 ?00:00:00 charger_manager
>>62 ?00:00:00 devfreq_wq
>>   236 ?00:03:50 jbd2/sda3-8
>>   237 ?00:00:00 ext4-dio-unwrit
>>   353 ?00:00:00 upstart-udev-br
>>   391 ?00:00:00 kjournald
>>   395 ?00:00:00 udevd
>>   541 ?00:00:03 dbus-daemon
>>   554 ?00:00:00 udevd
>>   555 ?00:00:00 udevd
>>   563 ?00:00:00 vballoon
>>   572 ?00:08:35 rsyslogd
>>   577 ?00:00:00 kpsmoused
>>   597 ?00:00:00 kworker/0:2
>>   730 ?00:00:01 upstart-socket-
>>   739 ?00:01:17 sshd
>>   832 tty4 00:00:00 getty
>>   838 tty5 00:00:00 getty
>>   862 tty2 00:00:00 getty
>>   863 tty3 00:00:00 getty
>>   869 tty6 00:00:00 getty
>>   880 ?00:00:00 acpid
>>   885 ?00:00:14 cron
>>   887 ?00:00:00 atd
>>   990 ?00:00:02 mdadm
>>  1015 ?00:00:21 chronyd
>>  7034 tty1 00:00:00 getty
>>  7890 ?00:01:35 flush-8:0
>>  9790 ?  

Re: cannot install django-tracking

2013-03-11 Thread frocco
Nevermind, duh

On Monday, March 11, 2013 12:33:32 PM UTC-4, frocco wrote:
>
> I see there is a pull request that fixes install for 1.5
>
> How do I do a pull request to get the latest version?
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem with testing Django sources

2013-03-11 Thread C. Kirby
You didn't necessarily do anything wrong, if you mean you think you failed 
running the tests. The test ran and 4 of them are failing. It also looks 
like it missed 5 expected failures in among the 217 it skipped.

If your question is why are the tests failing - you might need to reword 
your question, and possibly make a question for each group of failing tests 
(the 4 failed tests belong to three separate django modules)
I will throw out that all of the failed tests look to be time related, and 
could be due to a number of factors, most often a mismatch between server 
and client, which in this case would be the time the test database thinks 
it is vs the time the request/response thinks it is vs the time python 
thinks it is.

Chaim

On Saturday, March 9, 2013 3:16:22 PM UTC-6, VVilku wrote:
>
> Hello,
> I have problem with testing Django sources from Git.
>
> When I use:
> *
> PYTHONPATH=.. /python runtests.py --settings=test_sqlite*(in 
> Windows with Git Shell). 
>
> I receive these errors:
>
> ==
> FAIL: test_naturalday_uses_localtime 
> (django.contrib.humanize.tests.HumanizeTests)
> --
> Traceback (most recent call last):
>   File "D:\- Repositories GIT -\django\django\contrib\humanize\tests.py", 
> line 162, in test_naturalday_uses_localtime
> self.humanize_tester([dt], ['yesterday'], 'naturalday')
>   File "D:\- Repositories GIT -\django\django\contrib\humanize\tests.py", 
> line 48, in humanize_tester
> msg="%s test failed, produced '%s', should've produced '%s'" % 
> (method, rendered, result))
> AssertionError: naturalday test failed, produced 'today', should've 
> produced 'yesterday'
>
> ==
> FAIL: test_aware_expiration (requests.tests.RequestsTests)
> Cookie accepts an aware datetime as expiration time
> --
> Traceback (most recent call last):
>   File "D:\- Repositories GIT -\django\tests\requests\tests.py", line 275, 
> in test_aware_expiration
> self.assertEqual(datetime_cookie['max-age'], 10)
> AssertionError: 11 != 10
>
> ==
> FAIL: test_near_expiration (requests.tests.RequestsTests)
> Cookie will expire when an near expiration time is provided
> --
> Traceback (most recent call last):
>   File "D:\- Repositories GIT -\django\tests\requests\tests.py", line 266, 
> in test_near_expiration
> self.assertEqual(datetime_cookie['max-age'], 10)
> AssertionError: 11 != 10
>
> ==
> FAIL: test_feed_last_modified_time (syndication.tests.SyndicationFeedTest)
> --
> Traceback (most recent call last):
>   File "D:\- Repositories GIT -\django\tests\syndication\tests.py", line 
> 265, in test_feed_last_modified_time
> self.assertEqual(response['Last-Modified'], 'Thu, 03 Jan 2008 19:30:00 
> GMT')
> AssertionError: 'Thu, 03 Jan 2008 12:30:00 GMT' != u'Thu, 03 Jan 2008 
> 19:30:00 GMT'
>
> --
> Ran 5124 tests in 2268.805s
>
> FAILED (failures=4, skipped=217, expected failures=9)
>
>
> Does anyone know what I'm doing wrong?
> regards,
> VVilku
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Restful User Authentication for Ember/Backbone client with Tastypie

2013-03-11 Thread Nick Apostolakis

On 10/03/2013 10:54 μμ, Pratik Mandrekar wrote:

Hello,

I'm trying to figure out what would be the best way to integrate 
django with ember.js/backbone from the user authentication point of 
view. I'm using Tastypie for creating RESTful resources.


I have no problem creating APIs once a user has been authenticated 
using the Session based authentication but I am wondering what is the 
best RESTful way to create a user authentication API that can confirm 
to Session based authentication.


Also if I'm not mistaken the right way to authenticate the client is 
via the API key authentication right?


Thanks,
Pratik
--

Tthis is cool, I was about to ask the same thing. I believe that this 
thread will be interesting.



--
 --
   Nick Apostolakis
  e-mail: nicka...@oncrete.gr
 Web Site: http://nick.oncrete.gr
 --

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django login/registration validation error message issue

2013-03-11 Thread sri
Hi Tom,

Thanks for pointing me to docs.
I am able to display the error message now.
But because the page is being refreshed, the drop down is not visisble at 
first. When i click the register button again, then i can see the error 
message. Is there anyway i can show the registration drop down if errors 
exists.
My code now looks like below.

Views.py :-

   def register_view(request):
if request.method == 'POST':
form = UserCreationForm(data=request.POST, files=request.FILES)
if form.is_valid():
new_user = form.save()
new_user = authenticate(username=request.POST['username'],
password=request.POST['password1'])
login(request, new_user)
return HttpResponseRedirect(request.GET.get("next"))
else:
item_list = 
CoolStuff.objects.filter(show_on_website=True).order_by('-item_rank')
column_1_items_list = item_list.filter(column=ONE)
column_2_items_list = item_list.filter(column=TWO)
column_3_items_list = item_list.filter(column=THREE)
return render_to_response('homepage.html',
{'column_1_items_list': column_1_items_list,
'column_2_items_list': column_2_items_list,
 'column_3_items_list': column_3_items_list,
'register_form': form},
context_instance=RequestContext(request))
else:
return HttpResponseRedirect(reverse('coolstuff.views.homepage'))


base.html has the following for registration form :-

 
 
Register

{% csrf_token %}

  {{ register_form.non_field_errors }}

 
{% for field in register_form %}
  

  {{ field.errors }}

{{ field.label_tag }}
{{ field }}
  
{% endfor %}




   
   
  $(function() {
  // Setup drop down menu
  $('.dropdown-toggle').dropdown();
 
  // Fix input element click problem
  $('.dropdown input, .dropdown 
label').click(function(e) {
e.stopPropagation();
  });
  });
   
   


How can i make the drop down form for registration to be displayed 
automatically with errors rather than user clicking the button again. I 
think i will need to write javascript, but i am not sure how i can achieve 
it. Please suggest.

Thanks
Sreekanth

On Monday, 11 March 2013 14:36:56 UTC, Tom Evans wrote:
>
> On Mon, Mar 11, 2013 at 1:28 PM, sri  
> wrote: 
> > Hi, 
> > 
> > I am relatively new to Django and trying to create a Django application 
> > using 1.5 and created a pop up modal login and registration form using 
> > twitter bootstrap. The example i used to create the drop down 
> > login/registration form 
> > ishttp://mifsud.me/adding-dropdown-login-form-bootstraps-navbar/[1].Now,
> >  
> > the problem i am having is that, how do i show any error messages 
> (password 
> > invalid etc) on the pop up login/registration drop down modal box. 
> > 
> > Here is my base.html file: 
> > 
> >  
> >
> >  > data-toggle="dropdown">Login 
> >  
> >  > method="post" class="form-horizontal">{% csrf_token %} 
> >  > style="margin-bottom: 15px;" type="text" name="email" size="30" /> 
> >  placeholder="Password" 
> > style="margin-bottom: 15px;" type="password" name="password" size="30" 
> /> 
> >  > value="Sign In" /> 
> >  
> >  
> >
> >
> >  > data-toggle="dropdown">Register 
> >  
> >  > method="post" class="form-horizontal" name="register_form">{% csrf_token 
> %} 
> > {{ register_form.non_field_errors }} 
> >  > style="margin-bottom: 15px;" type="text" name="email" size="30" /> 
> >  placeholder="Password" 
> > style="margin-bottom: 15px;" type="password" name="password1" size="30" 
> /> 
> >  > placeholder="Password Again" style="margin-bottom: 15px;" 
> type="password" 
> > name="password2" size="30" /> 
> >  > value="Register" /> 
> >  
> >  
> >
> > 
> > And my views.py looks like below for login and registration views: 
> > 
> > def 

Re: cannot install django-tracking

2013-03-11 Thread frocco
I see there is a pull request that fixes install for 1.5

How do I do a pull request to get the latest version?

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problems install/download Django 1.5

2013-03-11 Thread DJ-Tom

Fixed - downloaded from Github and installed manually... everything's fine 
:-)

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to display large data by scrolling html page using python and django?

2013-03-11 Thread Jaimin Patel
you can use - http://django-endless-pagination.readthedocs.org/en/latest/

Its easy to integrate with jQuery, Django plugin.

On Monday, March 11, 2013 10:47:43 AM UTC-4, Avnesh Shakya wrote:
>
> ya i m trying  to display data from database on html page, but it's 
> showing 20-25 rows of data from database..Actually i want to display 25 
> rows of data after that i want show 25 rows of data,that time last 20 rows 
> should be flushed by scrolling and it should be repeat again-2
> thanks 
>
> On Mon, Mar 11, 2013 at 7:53 PM, Jaimin Patel  > wrote:
>
>> What control you are using to display? What do you mean by you want to 
>> show all data using scrolling? Is your query restricting top 20 records 
>> only, and you want to override that to get more?
>>
>>
>> On Monday, March 11, 2013 12:41:05 AM UTC-4, Avnesh Shakya wrote:
>>>
>>> hi,
>>>  i have stored data in database,but it has large data,so it's 
>>> showing only 20-25 rows of data on html page. I want to show all data using 
>>> scrolling. how is it possible?
>>> Please help me  
>>> Thanks
>>>
>>  -- 
>> 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problems install/download Django 1.5

2013-03-11 Thread Thiago Avelino
Recomend download https://github.com/django/django/tree/1.5




Cheers,
Thiago Avelino


On Mon, Mar 11, 2013 at 12:19 PM, DJ-Tom  wrote:

> Hi,
>
> I'm trying to get the new Django release, but the download of the .tar.gz
> file stops with errors:
> *
> *
> *  Downloading from URL
> http://pypi.python.org/packages/source/D/Django/Django-1.5.tar.gz#md5=fac09e1e0f11bb83bb187d652a9be967
> *
> *Exception:*
> *Traceback (most recent call last):*
> *  File "D:\Python27\lib\site-packages\pip\basecommand.py", line 107, in
> main*
> *status = self.run(options, args)*
> *  File "D:\Python27\lib\site-packages\pip\commands\install.py", line
> 256, in run*
> *requirement_set.prepare_files(finder,
> force_root_egg_info=self.bundle, bundle=self.bundle)*
> *  File "D:\Python27\lib\site-packages\pip\req.py", line 1018, in
> prepare_files*
> *self.unpack_url(url, location, self.is_download)*
> *  File "D:\Python27\lib\site-packages\pip\req.py", line 1142, in
> unpack_url*
> *retval = unpack_http_url(link, location, self.download_cache,
> self.download_dir)*
> *  File "D:\Python27\lib\site-packages\pip\download.py", line 463, in
> unpack_http_url*
> *download_hash = _download_url(resp, link, temp_location)*
> *  File "D:\Python27\lib\site-packages\pip\download.py", line 380, in
> _download_url*
> *chunk = resp.read(4096)*
> *  File "D:\Python27\lib\socket.py", line 380, in read*
> *data = self._sock.recv(left)*
> *  File "D:\Python27\lib\httplib.py", line 561, in read*
> *s = self.fp.read(amt)*
> *  File "D:\Python27\lib\socket.py", line 380, in read*
> *data = self._sock.recv(left)*
> *error: [Errno 10054] Eine vorhandene Verbindung wurde vom Remotehost
> geschlossen*
>
> are there currently any known download server issues?
>
> thx
> thomas
>
> --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Problems install/download Django 1.5

2013-03-11 Thread DJ-Tom
Hi,

I'm trying to get the new Django release, but the download of the .tar.gz 
file stops with errors:
*
*
*  Downloading from URL 
http://pypi.python.org/packages/source/D/Django/Django-1.5.tar.gz#md5=fac09e1e0f11bb83bb187d652a9be967
*
*Exception:*
*Traceback (most recent call last):*
*  File "D:\Python27\lib\site-packages\pip\basecommand.py", line 107, in 
main*
*status = self.run(options, args)*
*  File "D:\Python27\lib\site-packages\pip\commands\install.py", line 256, 
in run*
*requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, 
bundle=self.bundle)*
*  File "D:\Python27\lib\site-packages\pip\req.py", line 1018, in 
prepare_files*
*self.unpack_url(url, location, self.is_download)*
*  File "D:\Python27\lib\site-packages\pip\req.py", line 1142, in unpack_url
*
*retval = unpack_http_url(link, location, self.download_cache, 
self.download_dir)*
*  File "D:\Python27\lib\site-packages\pip\download.py", line 463, in 
unpack_http_url*
*download_hash = _download_url(resp, link, temp_location)*
*  File "D:\Python27\lib\site-packages\pip\download.py", line 380, in 
_download_url*
*chunk = resp.read(4096)*
*  File "D:\Python27\lib\socket.py", line 380, in read*
*data = self._sock.recv(left)*
*  File "D:\Python27\lib\httplib.py", line 561, in read*
*s = self.fp.read(amt)*
*  File "D:\Python27\lib\socket.py", line 380, in read*
*data = self._sock.recv(left)*
*error: [Errno 10054] Eine vorhandene Verbindung wurde vom Remotehost 
geschlossen*

are there currently any known download server issues?

thx 
thomas

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to display large data by scrolling html page using python and django?

2013-03-11 Thread Tom Evans
On Mon, Mar 11, 2013 at 2:47 PM, Avnesh Shakya  wrote:
> ya i m trying  to display data from database on html page, but it's showing
> 20-25 rows of data from database..Actually i want to display 25 rows of data
> after that i want show 25 rows of data,that time last 20 rows should be
> flushed by scrolling and it should be repeat again-2
> thanks
>

Do you mean infinite scrolling, like Google Image search?

It's quite easy to do in Django:

http://dustinfarris.com/2012/4/django-jquery-and-infinite-scroll/

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to display large data by scrolling html page using python and django?

2013-03-11 Thread Avnesh Shakya
ya i m trying  to display data from database on html page, but it's showing
20-25 rows of data from database..Actually i want to display 25 rows of
data after that i want show 25 rows of data,that time last 20 rows should
be flushed by scrolling and it should be repeat again-2
thanks

On Mon, Mar 11, 2013 at 7:53 PM, Jaimin Patel  wrote:

> What control you are using to display? What do you mean by you want to
> show all data using scrolling? Is your query restricting top 20 records
> only, and you want to override that to get more?
>
>
> On Monday, March 11, 2013 12:41:05 AM UTC-4, Avnesh Shakya wrote:
>>
>> hi,
>>  i have stored data in database,but it has large data,so it's showing
>> only 20-25 rows of data on html page. I want to show all data using
>> scrolling. how is it possible?
>> Please help me
>> Thanks
>>
>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django login/registration validation error message issue

2013-03-11 Thread Tom Evans
On Mon, Mar 11, 2013 at 1:28 PM, sri  wrote:
> Hi,
>
> I am relatively new to Django and trying to create a Django application
> using 1.5 and created a pop up modal login and registration form using
> twitter bootstrap. The example i used to create the drop down
> login/registration form
> ishttp://mifsud.me/adding-dropdown-login-form-bootstraps-navbar/[1] .Now,
> the problem i am having is that, how do i show any error messages (password
> invalid etc) on the pop up login/registration drop down modal box.
>
> Here is my base.html file:
>
> 
>   
>  data-toggle="dropdown">Login
> 
>  method="post" class="form-horizontal">{% csrf_token %}
>  style="margin-bottom: 15px;" type="text" name="email" size="30" />
>  style="margin-bottom: 15px;" type="password" name="password" size="30" />
>  value="Sign In" />
> 
> 
>   
>   
>  data-toggle="dropdown">Register
> 
>  method="post" class="form-horizontal" name="register_form">{% csrf_token %}
> {{ register_form.non_field_errors }}
>  style="margin-bottom: 15px;" type="text" name="email" size="30" />
>  style="margin-bottom: 15px;" type="password" name="password1" size="30" />
>  placeholder="Password Again" style="margin-bottom: 15px;" type="password"
> name="password2" size="30" />
>  value="Register" />
> 
> 
>   
>
> And my views.py looks like below for login and registration views:
>
> def login_view(request):
>   if request.method == 'POST':
>  username = request.POST['email']
>  password = request.POST['password']
>  user = authenticate(username=username, password=password)
>  if user is not None and user.is_active:
> login(request, user)
> return HttpResponseRedirect(request.GET.get("next"))
>   else:
> return  HttpResponseRedirect(reverse('homepage'))
>
> def register_view(request):
>if request.method == 'POST':
>   form = UserCreationForm(data=request.POST, files=request.FILES)
>   if form.is_valid():
> new_user = form.save()
> new_user = authenticate(username=request.POST['username'],
> password=request.POST['password1'])
> login(request, new_user)
>  return HttpResponseRedirect(request.GET.get("next"))
>else:
>   return HttpResponseRedirect(reverse('homepage'))
>
> def homepage(request):
>form = UserCreationForm()
>return render_to_response('base.html',
> {
>  'register_form': form},
>context_instance=RequestContext(request))
>
> And my forms.py looks like below for registration:
>
>  class UserCreationForm(forms.ModelForm):
>
>password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
>password2 = forms.CharField(label='Password confirmation',
> widget=forms.PasswordInput)
>
>class Meta:
> model = MyUser
> fields = ('email',)
>
>def clean_password2(self):
> # Check that the two password entries match
> password1 = self.cleaned_data.get("password1")
> password2 = self.cleaned_data.get("password2")
> if password1 and password2 and password1 != password2:
> raise forms.ValidationError("Passwords don't match")
> return password2
>
>def save(self, commit=True):
> # Save the provided password in hashed format
> user = super(UserCreationForm, self).save(commit)
> user.set_password(self.cleaned_data["password1"])
> if commit:
> user.save()
> return user
>
> Can anyone help me how i can pass the registration validation error messages
> into the drop down modal form and also the login password validation error
> messages. What i would like to do is displat the error message in the drop
> down login/registration box itself.
>
> Thanks
>

Hi Sri

Django's form objects have individual field objects, accessible in the
template. These field objects have attributes for any validation error
messages, and the form itself has an attribute for any non field
related validation error messages.

Normally, Django would output these for you when you output the form.
However, you've hard-coded the HTML for the form, which makes it
impossible for Django to output the related error messages.

This page shows how forms are normally output:

https://docs.djangoproject.com/en/1.5/topics/forms/#displaying-a-form-using-a-template

And this section of the same page outlines what you must do if you
choose not to allow Django to do most of it for you:

https://docs.djangoproject.com/en/1.5/topics/forms/#customizing-the-form-template

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop 

Re: Upgrade to 1.5 issues

2013-03-11 Thread Tom Evans
On Mon, Mar 11, 2013 at 2:21 PM, Tom Evans  wrote:
> On Mon, Mar 11, 2013 at 2:00 PM, jayhalleaux  wrote:
 Any ideas on question 1? how to use named urls in settings.py?
>>
>
> The problem with having named URLs in settings.py (also some other
> places, models.py for instance) is that at this point, the URL
> resolving architecture has not yet been completed.
>
> There is a simple solution - you do not actually want the URL in
> settings.py at the time settings.py is parsed. When you actually want
> the URL, everything is properly set up. Therefore, you can use a
> simply lazy evaluation of your reverse call:
>
>   from django.utils.functional import lazy
>   from django.core.urlresolvers import reverse
>
>   lazy_reverse = lazy(reverse, str)
>
>   FOO_URL = lazy_reverse('mysite:my-named-url')
>
> The downside of lazy is that this url will get re-generated each time
> you access FOO_URL. There is a bit of magic for that too, you can
> memoize the result:
>
>   from django.utils.functional import lazy, memoize
>   from django.core.urlresolvers import reverse
>
>   _reverse_memo_cache = { }
>   lazy_memoized_reverse = memoize(lazy(reverse, str), _reverse_memo_cache, 1)
>
>   FOO_URL = lazy_memoized_reverse('mysite:my-named-url')
>
> Cheers
>
> Tom

Just noticed, I have my memoize and lazy the wrong way around, so it
has the wrong effect! The correct way should be:

  lazy_memoized_reverse = lazy(memoize(reverse, c2, 1), str)

IE, memoize the return value of reverse, and lazy evaluate it, not
memoize the lazily evaluated reverse function!

How embarrassing :)

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to display large data by scrolling html page using python and django?

2013-03-11 Thread Jaimin Patel
What control you are using to display? What do you mean by you want to show 
all data using scrolling? Is your query restricting top 20 records only, 
and you want to override that to get more?

On Monday, March 11, 2013 12:41:05 AM UTC-4, Avnesh Shakya wrote:
>
> hi,
>  i have stored data in database,but it has large data,so it's showing 
> only 20-25 rows of data on html page. I want to show all data using 
> scrolling. how is it possible?
> Please help me  
> Thanks
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Upgrade to 1.5 issues

2013-03-11 Thread Tom Evans
On Mon, Mar 11, 2013 at 2:00 PM, jayhalleaux  wrote:
>>> Any ideas on question 1? how to use named urls in settings.py?
>

The problem with having named URLs in settings.py (also some other
places, models.py for instance) is that at this point, the URL
resolving architecture has not yet been completed.

There is a simple solution - you do not actually want the URL in
settings.py at the time settings.py is parsed. When you actually want
the URL, everything is properly set up. Therefore, you can use a
simply lazy evaluation of your reverse call:

  from django.utils.functional import lazy
  from django.core.urlresolvers import reverse

  lazy_reverse = lazy(reverse, str)

  FOO_URL = lazy_reverse('mysite:my-named-url')

The downside of lazy is that this url will get re-generated each time
you access FOO_URL. There is a bit of magic for that too, you can
memoize the result:

  from django.utils.functional import lazy, memoize
  from django.core.urlresolvers import reverse

  _reverse_memo_cache = { }
  lazy_memoized_reverse = memoize(lazy(reverse, str), _reverse_memo_cache, 1)

  FOO_URL = lazy_memoized_reverse('mysite:my-named-url')

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Testing multilingual site

2013-03-11 Thread galgal
I'm making a test for a model which has a field with language.
How can I switch, using Client(), languages to test actions on various 
languages?

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python

2013-03-11 Thread Tom Evans
On Mon, Mar 11, 2013 at 1:05 PM, Bill Freeman  wrote:
> I wouldn't call that "compiling", but it is a step that many people take in
> order to make it slightly more convenient to run.
>
> While "compiling" does happen, it is done automatically as a side effect of
> running the program.
>
> You are apparently not on Windows, since you have a chmod command.
>
> You can always run the program using:
>
>python filename.py
>
> As the python interpreter reads filename.py, it is "compiled" into "byte
> codes" which is actually what the python interpreter interprets.

I'd call it compiling, since python itself does!

Python ships with a module called 'compileall' to recursively compile
all python files within a directory tree. Use it like this:

python -m compileall /path/to/directory

http://docs.python.org/2/library/compileall.html

You can use this to ensure that your pyc files are fresh and
pre-compiled before deployment. I normally update files, remove all
.pyc/.pyo files, then run compileall as part of a deployment. Removing
pyc files may be necessary if you have removed a module, you do not
want old stale pyc files.

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python

2013-03-11 Thread shar100101
"Python automatically compiles Python source code when you import a 
module". Or you can use compileall module to compile all modules.
see: http://effbot.org/zone/python-compile.htm

понедељак, 11. март 2013. 13.15.25 UTC+1, Harjot Mann је написао/ла:
>
> anyone knows how to compile a python program???
>  im doing it as
> chmod +x filename.py
> ./filename.py???
> Am i right??/
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Upgrade to 1.5 issues

2013-03-11 Thread jayhalleaux

>
> Any ideas on question 1? how to use named urls in settings.py?
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python

2013-03-11 Thread Harjot Mann
ok thanks



On Mon, Mar 11, 2013 at 6:35 PM, Bill Freeman  wrote:

> I wouldn't call that "compiling", but it is a step that many people take
> in order to make it slightly more convenient to run.
>
> While "compiling" does happen, it is done automatically as a side effect
> of running the program.
>
> You are apparently not on Windows, since you have a chmod command.
>
> You can always run the program using:
>
>python filename.py
>
> As the python interpreter reads filename.py, it is "compiled" into "byte
> codes" which is actually what the python interpreter interprets.
>
> If the user running the program has permission to write the directory,
> then, when a .py file is imported, the "compiled" byte codes are written to
> a file with the same base name, but with the extension .pyc .  Upon
> subsequent runs, the import will notice that there is a .pyc file, and, so
> long as the .pyc file is newer than any like named .py file (it is legit to
> remove the .py file once there is a .pyc file), will read the "compiled"
> byte codes from the .pyc file, rather than reading a re-parsing the .py
> file.
>
> Note: this isn't done for the file mentioned on the command line.  If you
> want a .pyc file for it, start the python interpreter and type:
>
>import filename
>
> There are projects that attempt to convert python source to machine code.
> They have limitations and require stylized coding, and are only used when
> people need improved performance, but don't want to profile their code,
> reorganize as necessary, and recode the hot spots in C (since the latter
> will yield performance that is better yet), or to recode the entire app in
> a truly compiled langage.  See also some of what are effectively packaging
> tools like py2exe.
>
> Back to chmod +x, that simply tells the operating system (and the shell)
> that this is a file that is allowed t be executed.  That's not actually
> true of a python file, but another trick of the *nix world helps out:  If
> the first two bytes of a file are the ASCII codes for '#' and '!', then the
> rest of the line (again ASCII) are taken as the absolute path of a program
> to run instead, plus any flags and arguments to pass to it, and the path to
> this file will be added as a last argument.  A suitable first lines for .py
> files would be:
>
>#!/usr/bin/python
>
> (assuming that /usr/bin/python is where python live on your system). The
> OS sees the #! and actually runs:
>
>/usr/bin/python /path/to/your/filename.py
>
> Bill
>
>
>
> On Mon, Mar 11, 2013 at 8:15 AM, Harjot Mann wrote:
>
>> anyone knows how to compile a python program???
>>  im doing it as
>> chmod +x filename.py
>> ./filename.py???
>> Am i right??/
>> 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?hl=en.
>> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django login/registration validation error message issue

2013-03-11 Thread sri


Hi,

I am relatively new to Django and trying to create a Django application 
using 1.5 and created a pop up modal login and registration form using 
twitter bootstrap. The example i used to create the drop down 
login/registration form is
http://mifsud.me/adding-dropdown-login-form-bootstraps-navbar/[1] .Now, the 
problem i am having is that, how do i show any error messages (password 
invalid etc) on the pop up login/registration drop down modal box.

Here is my base.html file:


  
Login

{% csrf_token %}





  
  
Register

{% csrf_token %}
{{ register_form.non_field_errors }}






  

And my views.py looks like below for login and registration views:

def login_view(request):
  if request.method == 'POST':
 username = request.POST['email']
 password = request.POST['password']
 user = authenticate(username=username, password=password)
 if user is not None and user.is_active:
login(request, user)
return HttpResponseRedirect(request.GET.get("next"))
  else:
return  HttpResponseRedirect(reverse('homepage'))

def register_view(request):
   if request.method == 'POST':
  form = UserCreationForm(data=request.POST, files=request.FILES)
  if form.is_valid():
new_user = form.save()
new_user = authenticate(username=request.POST['username'],
password=request.POST['password1'])
login(request, new_user)
 return HttpResponseRedirect(request.GET.get("next"))
   else:
  return HttpResponseRedirect(reverse('homepage'))

def homepage(request):
   form = UserCreationForm()
   return render_to_response('base.html',
{
 'register_form': form},
   context_instance=RequestContext(request))

And my forms.py looks like below for registration:

 class UserCreationForm(forms.ModelForm):

   password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
   password2 = forms.CharField(label='Password confirmation', 
widget=forms.PasswordInput)

   class Meta:
model = MyUser
fields = ('email',)

   def clean_password2(self):
# Check that the two password entries match
password1 = self.cleaned_data.get("password1")
password2 = self.cleaned_data.get("password2")
if password1 and password2 and password1 != password2:
raise forms.ValidationError("Passwords don't match")
return password2

   def save(self, commit=True):
# Save the provided password in hashed format
user = super(UserCreationForm, self).save(commit)
user.set_password(self.cleaned_data["password1"])
if commit:
user.save()
return user

Can anyone help me how i can pass the registration validation error 
messages into the drop down modal form and also the login password 
validation error messages. What i would like to do is displat the error 
message in the drop down login/registration box itself.

Thanks

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python

2013-03-11 Thread Bill Freeman
I wouldn't call that "compiling", but it is a step that many people take in
order to make it slightly more convenient to run.

While "compiling" does happen, it is done automatically as a side effect of
running the program.

You are apparently not on Windows, since you have a chmod command.

You can always run the program using:

   python filename.py

As the python interpreter reads filename.py, it is "compiled" into "byte
codes" which is actually what the python interpreter interprets.

If the user running the program has permission to write the directory,
then, when a .py file is imported, the "compiled" byte codes are written to
a file with the same base name, but with the extension .pyc .  Upon
subsequent runs, the import will notice that there is a .pyc file, and, so
long as the .pyc file is newer than any like named .py file (it is legit to
remove the .py file once there is a .pyc file), will read the "compiled"
byte codes from the .pyc file, rather than reading a re-parsing the .py
file.

Note: this isn't done for the file mentioned on the command line.  If you
want a .pyc file for it, start the python interpreter and type:

   import filename

There are projects that attempt to convert python source to machine code.
They have limitations and require stylized coding, and are only used when
people need improved performance, but don't want to profile their code,
reorganize as necessary, and recode the hot spots in C (since the latter
will yield performance that is better yet), or to recode the entire app in
a truly compiled langage.  See also some of what are effectively packaging
tools like py2exe.

Back to chmod +x, that simply tells the operating system (and the shell)
that this is a file that is allowed t be executed.  That's not actually
true of a python file, but another trick of the *nix world helps out:  If
the first two bytes of a file are the ASCII codes for '#' and '!', then the
rest of the line (again ASCII) are taken as the absolute path of a program
to run instead, plus any flags and arguments to pass to it, and the path to
this file will be added as a last argument.  A suitable first lines for .py
files would be:

   #!/usr/bin/python

(assuming that /usr/bin/python is where python live on your system). The OS
sees the #! and actually runs:

   /usr/bin/python /path/to/your/filename.py

Bill


On Mon, Mar 11, 2013 at 8:15 AM, Harjot Mann wrote:

> anyone knows how to compile a python program???
>  im doing it as
> chmod +x filename.py
> ./filename.py???
> Am i right??/
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Fwd: Delivery Status Notification (Failure)

2013-03-11 Thread Nick Dokos
jesmine chaudhuri  wrote:

> Hello,
> 
> I am new in Python and Django. This is my first test project following the
> site :
> 
> https://docs.djangoproject.com/en/1.3/intro/tutorial01/
> 
> I am using database MySQL.
> 
> I configured in
> 
> INSTALLED_APPS = (
>     'django.contrib.auth',
>     'django.contrib.contenttypes',
>     'django.contrib.sessions',
>     'django.contrib.sites',
>     'polls'
> )
> 
> After that I am trying to run :
> 
> python manage.py sql polls
> 
> But I am getting this error :
> 
> App with label polls could not be found. Are you sure your
> > INSTALLED_APPS setting is correct?
> 

The docs recommend that you add

...
'polls',
  )

with a final comma, but that's only to prevent you from errors if you
add more apps at the end: it should work without the comma if 'polls' is
the final element of the tuple. Nevertheless, you probably want to make
it a habit to add the comma (which btw is necessary for a one-element
tuple - not the case here, but forewarned is forearmed).

Do an ``ls'' in the directory where you do the ``python manage.py sql
polls'': do you have a subdirectory named `polls' with the standard
structure? Below, I have named the project `poll' and the app `polls'
(which is a bit confusing, sorry: I should have named the project
`poll_project' or something). Here's what I get:

,
| $ python manage.py sql polls
| BEGIN;
| CREATE TABLE "polls_poll" (
| "id" integer NOT NULL PRIMARY KEY,
| "question" varchar(200) NOT NULL,
| "pub_date" datetime NOT NULL
| )
| ;
| CREATE TABLE "polls_choice" (
| "id" integer NOT NULL PRIMARY KEY,
| "poll_id" integer NOT NULL REFERENCES "polls_poll" ("id"),
| "choice_text" varchar(200) NOT NULL,
| "votes" integer NOT NULL
| )
| ;
| COMMIT;
| 
| $ ls
| manage.py  poll  pollspolls.db
| 
| $ ls polls
| admin.py  admin.pyc  __init__.py  __init__.pycmodels.py   models.pyc  
tests.py  views.py
`

Nick

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot install django-tracking

2013-03-11 Thread frocco
Thanks, I guess it is a 1.5 problem.

On Monday, March 11, 2013 8:34:31 AM UTC-4, Nick Dokos wrote:
>
> frocco  wrote: 
>
> > Hello, 
> > 
> > I am getting 
> > django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, 
> but settings are not 
> > configured. You must either define the environment variable 
> DJANGO_SETTINGS_MODULE or call 
> > settings.configure() before accessing settings. 
> > 
> > trying pip install django-tracking 
> > 
> > Does this work in django 1.5? 
> > 
>
> FWIW, I tried ``pip install django-tracking'' in a virtualenv where I 
> had installed django 1.4.3 final, and it was successfully installed: 
>
>
> , 
> | $ pip install django-tracking 
> | Downloading/unpacking django-tracking 
> |   Downloading django-tracking-0.4.1.tar.gz (1.9Mb): 1.9Mb downloaded 
> |   Running setup.py egg_info for package django-tracking 
> | 
> | warning: no previously-included files matching '.*.swp' found under 
> directory 'tracking' 
> | warning: no previously-included files matching '*.*' found under 
> directory 'demo' 
> | Installing collected packages: django-tracking 
> |   Running setup.py install for django-tracking 
> | 
> | warning: no previously-included files matching '.*.swp' found under 
> directory 'tracking' 
> | warning: no previously-included files matching '*.*' found under 
> directory 'demo' 
> | Successfully installed django-tracking 
> | Cleaning up... 
> ` 
>
> Nick 
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Delivery Status Notification (Failure)

2013-03-11 Thread abhijeet shete
Hi Jasmine,

First if you are asking about the same question then continue in same
thread don't start with new thread every time.

How you created app using django's startapp command or manually ?
Normally if apps folder doesn't contain __init__.py file then it gives this
error while executing


python manage.py sql polls
>
>



Regards.
Abhijeet.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot install django-tracking

2013-03-11 Thread Nick Dokos
frocco  wrote:

> Hello,
> 
> I am getting
> django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but 
> settings are not
> configured. You must either define the environment variable 
> DJANGO_SETTINGS_MODULE or call
> settings.configure() before accessing settings.
> 
> trying pip install django-tracking
> 
> Does this work in django 1.5?
> 

FWIW, I tried ``pip install django-tracking'' in a virtualenv where I
had installed django 1.4.3 final, and it was successfully installed:


,
| $ pip install django-tracking
| Downloading/unpacking django-tracking
|   Downloading django-tracking-0.4.1.tar.gz (1.9Mb): 1.9Mb downloaded
|   Running setup.py egg_info for package django-tracking
| 
| warning: no previously-included files matching '.*.swp' found under 
directory 'tracking'
| warning: no previously-included files matching '*.*' found under 
directory 'demo'
| Installing collected packages: django-tracking
|   Running setup.py install for django-tracking
| 
| warning: no previously-included files matching '.*.swp' found under 
directory 'tracking'
| warning: no previously-included files matching '*.*' found under 
directory 'demo'
| Successfully installed django-tracking
| Cleaning up...
`

Nick

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Editing the RSS in the Django community feeds

2013-03-11 Thread Shabda Raaj
Hello,

The Django community RSS feeds has a form to add new RSS: 
https://www.djangoproject.com/community/add/blogs/

We have our RSS added in this from way back. However sometime we write 
about non-django stuff, which is not relevant in this feed. I would like to 
update this to our Django only feed:

http://agiliq.com/blog/rss/latest/django/

Can someone with access do this? (or advise me who can I contact to edit 
this.)

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Errors in my first django app

2013-03-11 Thread frocco
Do you have polls defined in your INSTALLED_APPS?

INSTALLED_APPS (

'polls',

)


On Monday, March 11, 2013 8:03:13 AM UTC-4, jesmine chaudhuri wrote:
>
> Error: App with label polls could not be found. Are you sure your
>  INSTALLED_APPS setting is correct? 
>
>
>  The app is in django 1.3 project and mysql.
>  I am new in Django and Python. Please anyone help me.
>
>  Thanks in advance.
>
>  Jesmine C
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




cannot install django-tracking

2013-03-11 Thread frocco
Hello,

I am getting
django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but 
settings are not configured. You must either define the environment 
variable DJANGO_SETTINGS_MODULE or call settings.configure() before 
accessing settings.

trying pip install django-tracking

Does this work in django 1.5?

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




python

2013-03-11 Thread Harjot Mann
anyone knows how to compile a python program???
 im doing it as
chmod +x filename.py
./filename.py???
Am i right??/
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Fwd: Delivery Status Notification (Failure)

2013-03-11 Thread jesmine chaudhuri
Hello,

I am new in Python and Django. This is my first test project following the
site :

https://docs.djangoproject.com/en/1.3/intro/tutorial01/

I am using database MySQL.

I configured in

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

After that I am trying to run :

python manage.py sql polls

But I am getting this error :

App with label polls could not be found. Are you sure your
> INSTALLED_APPS setting is correct?


Thanks in advance. Please can anyone help me.


Regards


Jesmine

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Template inheritance

2013-03-11 Thread Tomas Ehrlich
This approach is more flexible. It's easier to override template than
override view. You can still put your "context variable" logic there,
if you want.

Take Django admin as example. You can customize it quiet easily when
you override/subclass templates. If you want to customize view, you
have to sublass ModelAdmin or whole AdminSite. It's overkill when you
need tune some details like this.

Cheers,
 Tom


Dne Mon, 11 Mar 2013 11:51:47 +
Tom Evans  napsal(a):

> On Sat, Mar 9, 2013 at 10:28 AM, Tomas Ehrlich  
> wrote:
> > Hi Nenad,
> > you can wrap your meta-refresh line in another block and then delete
> > it's content in templates which shouldn't be refreshed.
> >
> > # base_site.html
> > {% block extrahead %}
> > {% block extrahead-refresh %}
> > 
> > {% endblock %}
> > {% endblock %}
> >
> > # change_form.html -- deletes content of block extrahead-refresh
> > {% block extrahead-refresh %}{% endblock %}
> 
> 
> This approach is exactly what the docs are warning about. This is
> putting all of the logic of whether to display something into the
> template, and not the view.
> 
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Errors in my first django app

2013-03-11 Thread abhijeet shete
Hi Jasmin,

Looks like you haven't added your app 'polls' in 'settings.py' under
INSTALLED_APPS. Check whether you added your app or not.
If not add it.


On Mon, Mar 11, 2013 at 5:33 PM, jesmine chaudhuri <
jesminechaudhur...@gmail.com> wrote:

> Error: App with label polls could not be found. Are you sure your
>  INSTALLED_APPS setting is correct?
>
>
> Regards..
Abhijeet Shete

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Errors in my first django app

2013-03-11 Thread jesmine chaudhuri
Error: App with label polls could not be found. Are you sure your
 INSTALLED_APPS setting is correct?


 The app is in django 1.3 project and mysql.
 I am new in Django and Python. Please anyone help me.

 Thanks in advance.

 Jesmine C

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Template inheritance

2013-03-11 Thread Tom Evans
On Sat, Mar 9, 2013 at 10:28 AM, Tomas Ehrlich  wrote:
> Hi Nenad,
> you can wrap your meta-refresh line in another block and then delete
> it's content in templates which shouldn't be refreshed.
>
> # base_site.html
> {% block extrahead %}
> {% block extrahead-refresh %}
> 
> {% endblock %}
> {% endblock %}
>
> # change_form.html -- deletes content of block extrahead-refresh
> {% block extrahead-refresh %}{% endblock %}


This approach is exactly what the docs are warning about. This is
putting all of the logic of whether to display something into the
template, and not the view.

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Template inheritance

2013-03-11 Thread Tom Evans
On Sat, Mar 9, 2013 at 9:41 AM, Nenad Cikic  wrote:
> Hello,
> I am using django admin for my project so I am not writing much templates by
> myself, therefore I am not very skilled with them, so excuse me if I ask
> dumb question.
> I have extended base_site.html to add browser refresh in block extrahead.
> I do not want however to do refresh while I am inserting data.
> In my change_form.html I have something as
> {% block extrahead %}{{ block.super }}
>
> What I would need is the possiblity to have some template variable that is
> True for base_site.html and that I set to False only in change_form.html,
> and then I could use that in base_site.html something as
>
> base_site.html
> {% block extrahead %}
> {% if do_refresh %}
> 
> {% endif %}
> {% endblock %}
>
> I understand that the template is only for presentation and not logic, as
> found in docs, but this I do see as logic of presentation:)
> I am looking in docs but can not see anythign useful for my scenario, which
> should not be so uncommon.
>
> What's the proper way to solve this.
> Thanks
> Nenad
>

Depends, which happens more frequently, wanting to override the
default or allow the default to happen?

I would handle all this with a context variable, 'no_meta_refresh'. By
default, this context variable would be unset, and the meta refresh
would be written out by the base template.

If a child template does not want the meta refresh, then it would add
'no_meta_refresh': True to it's context.

If you only wanted the refresh on 1-2 pages, and did not want it on
all the others, invert the logic. Have a variable called
'meta_refresh', by default not present, and force views requiring meta
refresh to set it.

The docs talk about separating presentation and logic. This doesn't
mean "do not put logic in the template", it is more about determining
the decisions about what to display in the view, and passing that
information on to the template. The view sets the context variable,
and the template acts upon it - this is the perfect separation of
presentation and logic.

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error: App with label world could not be found. Are you sure your INSTALLED_APPS setting is correct?

2013-03-11 Thread abhijeet shete
Hi Jasmin,

Looks like you haven't added your app 'polls' in 'settings.py' under
INSTALLED_APPS. Check whether you added your app or not.
If not add it.

Regards.
Abhijeet


On Mon, Mar 11, 2013 at 5:05 PM, jesmine chaudhuri <
jesminechaudhur...@gmail.com> wrote:

> Error: App with label polls could not be found. Are you sure your
> INSTALLED_APPS setting is correct? in django 1.3 project and mysql.
>
> I am new in Django and Python. Please anyone help me.
>
> Thanks in advance.
>
> Jesmine C
>
>
>>  --
> 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?hl=en.
> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error: App with label world could not be found. Are you sure your INSTALLED_APPS setting is correct?

2013-03-11 Thread Tom Evans
On Mon, Mar 11, 2013 at 11:35 AM, jesmine chaudhuri
 wrote:
> Error: App with label polls could not be found. Are you sure your
> INSTALLED_APPS setting is correct? in django 1.3 project and mysql.
>
> I am new in Django and Python. Please anyone help me.
>
> Thanks in advance.
>
> Jesmine C
>

Please don't hijack old threads with your new problems, IE send a new
email to django-users@googlegroups.com instead of replying to an old
one. You will need to include more details as well if you want
assistance!

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Error: App with label world could not be found. Are you sure your INSTALLED_APPS setting is correct?

2013-03-11 Thread jesmine chaudhuri
Error: App with label polls could not be found. Are you sure your 
INSTALLED_APPS setting is correct? in django 1.3 project and mysql.

I am new in Django and Python. Please anyone help me.

Thanks in advance.

Jesmine C


>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Survey : Theme for Django admin interface

2013-03-11 Thread Derek

On Monday, 11 March 2013 06:05:46 UTC+2, Venkatraman.S. wrote:
>
>
> On Mon, Mar 11, 2013 at 3:49 AM, Emiliano Dalla Verde Marcozzi <
> ed...@fedoraproject.org > wrote:
>
>>
>> I was looking for this, but didnt find anything. i think it can have a 
>> great market, something like
>> this web: 
>> https://wrapbootstrap.com/theme/unicorn-admin-template-WB0F35928
>> For me, a reasonable price is 20USD but well, if the theme affords it i 
>> think i would do the effort
>> and pay the 40 USD,
>> Regards,
>> Emiliano.
>>
>>
> Yes, i might as well give it free depending on the mood of the day :) 
> I have started working on it
>

I agree about the $20.  A reasonable price will get you more users... 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.