Upgrade to 1.5 issues

2013-03-08 Thread jayhalleaux
So I have two questions: 1. Changing LOGIN_REDIRECT to a named url. Example: settings.py: LOGIN_REDIRECT = ?? // what do i set it to, 'tracklist:profile' gives me an unsafe redirect error urls.py: // which one? your root urls.py or your application urls.py from django.conf.urls import

Re: p.choice_set.all() error

2013-03-08 Thread Hugo Guzman
Thanks for the feedback. It's much appreciated. On Thursday, March 7, 2013 10:39:42 PM UTC-5, Hugo Guzman wrote: > > Hey there. I'm working through Part I of the "Writing your first Django > app" tutorial and everything was going smoothly until I tried executing the > following command: > > >>>

Re: TestCase - send POST with m2m data?

2013-03-08 Thread Russell Keith-Magee
On Fri, Mar 8, 2013 at 7:52 PM, galgal wrote: > As in the topic - how can I prepare POST data dictionary in TestCase to > send it via POST? > I can see how it works in real admin POST in Chrome: > > --WebKitFormBoundaryEXChB8PRJPhaP3OQ > Content-Disposition:

Re: I screwed up my django site using touch

2013-03-08 Thread frocco
Thanks Sam On Friday, March 8, 2013 2:13:36 PM UTC-5, Sam Solomon wrote: > > Here is something that may help: > > import importlib > > from django.conf import settings > > for app in settings.INSTALLED_APPS: > views_name = "%s.views" % app > try: >

Re: Django Form Designer

2013-03-08 Thread Jason Arnst-Goodrich
I never knew this existed. I do hope someone continues development... On Thursday, March 7, 2013 8:39:56 AM UTC-8, Daniele Procida wrote: > > I like and use Django Form Designer, < > https://github.com/philomat/django-form-designer>, but it hasn't been > updated for a while and needs some work.

Re: cannot find unique constraint on easy_thumbnails_thumbnails while running jenkins

2013-03-08 Thread Jaimin Patel
Also while running I get this out put - $ python manage.py jenkins Creating test database for alias 'default'... Got an error creating the test database: (1007, "Can't create database 'test_abc'; database exists") Destroying old test database 'default'... Could not remove foreign key contraint:

Re: urls.py not loading changes

2013-03-08 Thread Bill Freeman
Well, nginx is a proxy to the fastCGI application. So you can't access it from the usual URL when nginx is stopped, but that doesn't mean that the process to which you proxy, which is running Django, has stopped. On Fri, Mar 8, 2013 at 3:11 PM, Asier Hernández Juanes < asiertxo...@gmail.com>

Re: Urls on the fly

2013-03-08 Thread Bill Freeman
That is weird. I don't know why 2 shouldn't satisfy a need for 2. As far as a work around goes, one doesn't need to use url() to make a url pattern. Just a tuple with those two members will do it. I think of url() as a way to specify a pattern name without specifying the extra dict. Unless

Re: urls.py not loading changes

2013-03-08 Thread Asier Hernández Juanes
Maybe fastCGI but when I stop the nginx server with /etc/init.d/nginx stop the application is not loading. I have seen some fastCGI configuration inside nginx server but I don't know how to restart fastCGI process or Django process itself. How can I do that? El viernes, 8 de marzo de 2013

Re: How can my JQuery Sliderbar pass a value to the Veiw and cause the View to execute?

2013-03-08 Thread Shawn Milochik
You'll need to attach something to the "change" event of your slider to execute a JavaScript function. The function would contain something like this: // $.ajax({ // url: your_url, // cache: 'false', // success:

Re: I screwed up my django site using touch

2013-03-08 Thread Sam Solomon
Here is something that may help: import importlib from django.conf import settings for app in settings.INSTALLED_APPS: views_name = "%s.views" % app try: importlib.import_module(views_name) except ImportError: pass except: print "Could not import %s" %

Re: urls.py not loading changes

2013-03-08 Thread Javier Guerra Giraldez
On Sun, Mar 3, 2013 at 8:16 AM, Asier Hernández Juanes wrote: > i have a remote Linux server with a Django application running in a nginx > server Django application's don't run in the nginx server. There must be some other process running your app. Either uWSGI,

Urls on the fly

2013-03-08 Thread Serge G. Spaolonzi
I am looking the way to create urls on the fly. This is a simplified version of the code I am using: def get_urls(): url_list = [] for code in external_code_list: url_list.append( url(r'^%s/$' % code, view ) ) urlpatterns =

Re: How can my JQuery Sliderbar pass a value to the Veiw and cause the View to execute?

2013-03-08 Thread 7equivalents
Ok, thanks Shawn, still having a bit of a snag. I have read the JQuery doc on $.ajax, but still don't have a complete grasp... So here is my next question, I added this to my sliderbar script: var args = { type:"POST", url:"/slider/" } $.ajax(args); Would those two lines of code cause my

cannot find unique constraint on easy_thumbnails_thumbnails while running jenkins

2013-03-08 Thread Jaimin Patel
I am running into below error while running jenkins for my django project - File "/Library/Python/2.7/site-packages/easy_thumbnails/migrations/0015_auto__del_unique_thumbnail_name_storage_hash__add_unique_thumbnail_sou.py", line 12, in forwards

Re: how to automatically create userprofile when user is created from admin

2013-03-08 Thread Shawn Milochik
Yes. Use a post-save signal. -- 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

how to automatically create userprofile when user is created from admin

2013-03-08 Thread frocco
Hello, right now, if I create a user in admin, I have to also create their userprofile that I have defined in settings. Is there a way to automate this? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: urls.py not loading changes

2013-03-08 Thread Asier Hernández Juanes
I have removed the .py and the .pyc files, restart the nginx server and the application is still working. I think the alication is being cached or I have the application duplicated but I am not able to find the solution. Some ideas? Thanks! El lunes, 4 de marzo de 2013 19:30:32 UTC+1, ke1g

Re: Question modelformset_factory with initial values

2013-03-08 Thread carlos
Thanks Tom you were right but I had several mistakes and resolved to thank you very much :) Cheers On Fri, Mar 8, 2013 at 8:56 AM, Tom Evans wrote: > On Fri, Mar 8, 2013 at 4:42 AM, carlos wrote: > > > > Hi > > is posible fill forms with

Re: How do i set div dynamically in template?

2013-03-08 Thread frocco
Thank you, I found it. On Friday, March 8, 2013 9:51:00 AM UTC-5, Laurent Meunier wrote: > > On 08/03/2013 15:34, frocco wrote: > > Hello > > > > I need to have a div set the on the first pass and then changed on the > > second pass > > > > for row in data > > first row > > > >

Re: How do i set div dynamically in template?

2013-03-08 Thread Laurent Meunier
On 08/03/2013 15:34, frocco wrote: Hello I need to have a div set the on the first pass and then changed on the second pass for row in data first row second row endfor in PHP I could just assign a variable to the div and change it. How would I do this in django? Hi, In

Re: How do i set div dynamically in template?

2013-03-08 Thread frocco
Thanks Tom On Friday, March 8, 2013 9:45:34 AM UTC-5, Tom Evans wrote: > > On Fri, Mar 8, 2013 at 2:34 PM, frocco > wrote: > > Hello > > > > I need to have a div set the on the first pass and then changed on the > > second pass > > > > for row in data > >first row

Re: Question modelformset_factory with initial values

2013-03-08 Thread Tom Evans
On Fri, Mar 8, 2013 at 4:42 AM, carlos wrote: > > Hi > is posible fill forms with initial values for example > > -- models.py - > class Model1(models.Model): > field1 = models.CharField() > field2 =models.CharField() > > CHOICE_ONE = ( > (1,'one'),

Re: django templates - iterate over several lists

2013-03-08 Thread Roberto López López
Thank you very much! On 03/08/2013 03:12 PM, Javier Guerra Giraldez wrote: > On Fri, Mar 8, 2013 at 5:07 AM, Roberto López López > wrote: >> I'd like to avoid having to concatenate them in the view and pass that >> as another parameter. > > > two ideas come to mind: >

Re: How do i set div dynamically in template?

2013-03-08 Thread Tom Evans
On Fri, Mar 8, 2013 at 2:34 PM, frocco wrote: > Hello > > I need to have a div set the on the first pass and then changed on the > second pass > > for row in data >first row > > > >second row > endfor > > in PHP I could just assign a variable to the div and

How do i set div dynamically in template?

2013-03-08 Thread frocco
Hello I need to have a div set the on the first pass and then changed on the second pass for row in data first row second row endfor in PHP I could just assign a variable to the div and change it. How would I do this in django? Thanks -- You received this message because you

Re: p.choice_set.all() error

2013-03-08 Thread Tom Evans
On Fri, Mar 8, 2013 at 3:39 AM, Hugo Guzman wrote: > Hey there. I'm working through Part I of the "Writing your first Django app" > tutorial and everything was going smoothly until I tried executing the > following command: > p.choice_set.all() > > When I try running

Re: p.choice_set.all() error

2013-03-08 Thread Victor Rocha
The only thing I can think of it is that your database is not up-to-date with your models. You could drop the database and do a syncdb, otherwise using south to migrate your database schema could be an option. Good luck, Victor Rocha RochApps On Thursday, March 7,

Re: django templates - iterate over several lists

2013-03-08 Thread Javier Guerra Giraldez
On Fri, Mar 8, 2013 at 5:07 AM, Roberto López López wrote: > I'd like to avoid having to concatenate them in the view and pass that > as another parameter. two ideas come to mind: - itertools.chain() on the view. it's equivalent to concatenating, but done lazily, so

no way to delete auth_messages

2013-03-08 Thread Yanhong Wu
Hi, I created an database router to try using multiple databases. I copied the example router in this page: https://docs.djangoproject.com/en/1.3/topics/db/multi-db/ . Almost everything is ok, however, it seems that I cannot delete an auth_message. The log said: DELETE command denied to user

Re: Get all objects that don't belong to M2M

2013-03-08 Thread galgal
I think that did the trick: *Product.objects.filter(subproducts__isnull=True)* On Friday, March 8, 2013 1:50:47 PM UTC+1, Martin J. Laubach wrote: > > Something like this (totally untested though) > > Product.objects.exclude(pk__in=Product.subproducts.through.values_list( > 'product_id',

Re: How can my JQuery Sliderbar pass a value to the Veiw and cause the View to execute?

2013-03-08 Thread Shawn Milochik
I think we've come all the way around to where my response is now appropriate. :o) https://groups.google.com/d/msg/django-users/kB27nmftPng/btPKtxvoumYJ Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Get all objects that don't belong to M2M

2013-03-08 Thread Martin J. Laubach
Something like this (totally untested though) Product.objects.exclude(pk__in=Product.subproducts.through.values_list( 'product_id', flat=True)) perhaps? Cheers, mjl -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Get all objects that don't belong to M2M

2013-03-08 Thread galgal
I have a model with field: class Product(models.Model): subproducts = models.ManyToManyField("self", blank=True) I need to overwrite admin's field queryset, to display only that objects that don't belong to any m2m relation. I have no idea how to get them. So if I have: product1,

Django + WSGI + CsrfViewMiddleware = ?

2013-03-08 Thread Konstantin
I am running Django 1.3 with Apache and mod_wsgi. I followed these instructions, https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/ to display a simple page, which contains a form, and which sends the data back via POST. Everything is fine with GET requests. However, when I do

p.choice_set.all() error

2013-03-08 Thread Hugo Guzman
Hey there. I'm working through Part I of the "Writing your first Django app" tutorial and everything was going smoothly until I tried executing the following command: >>> p.choice_set.all() When I try running it I get the proceeding errors (below). I've attached my models.py file for context.

TestCase - send POST with m2m data?

2013-03-08 Thread galgal
As in the topic - how can I prepare POST data dictionary in TestCase to send it via POST? I can see how it works in real admin POST in Chrome: --WebKitFormBoundaryEXChB8PRJPhaP3OQ Content-Disposition: form-data; name="visibly_usergroup" 1 --WebKitFormBoundaryEXChB8PRJPhaP3OQ

django recaptcha

2013-03-08 Thread Xavier Pegenaute
Dear, I am using your django-recaptcha application but I am havig a problem. Seems the validation step is not done properly ONLY if I use the javascript code. I've edited the django/forms/widgets.py file and added print data at line 209 (I am using django 1.5), once I am filling the form

Re: how to get value of anchor tag which is taken from database using python.

2013-03-08 Thread Avnesh Shakya
ya i got it I used {{ c.stream }} and in url - url(r'^(?P[^/]+)/$','stream',name="stream"), so here detail will store that value... and in views- def stream(request,detail): courses = Course.objects.filter(stream = detail ) ctx = {'courses':courses}

Re: how to get value of anchor tag which is taken from database using python.

2013-03-08 Thread Avnesh Shakya
Actually, i have lot of different-2 stream, now i want to make it as link, so that i can click on particular stream and it should filter data according to that stream({{c.stream}}) on same page. thanks On Fri, Mar 8, 2013 at 3:08 PM, Daniel Roseman wrote: > On Friday, 8

django templates - iterate over several lists

2013-03-08 Thread Roberto López López
Hi, How can I iterate over several list objects available in my template? I'd like to avoid having to concatenate them in the view and pass that as another parameter. I mean something like this: {% for x in list1, list2, list3... listN %} {% if not forloop.first %}, {% endif %}write

Re: how to get value of anchor tag which is taken from database using python.

2013-03-08 Thread Daniel Roseman
On Friday, 8 March 2013 09:07:12 UTC, Avnesh Shakya wrote: > I am using an anchor tag and have to access its content in python. I have > to access the 'text' from this. > > in html page-- > > {% for c in courses%} > > {{c.title}} href="cd.html">{{c.stream}} > > i want to get {{c.stream}} value

how to get value of anchor tag which is taken from database using python.

2013-03-08 Thread Avnesh Shakya
I am using an anchor tag and have to access its content in python. I have to access the 'text' from this. in html page-- {% for c in courses%} {{c.title}}{{c.stream}} i want to get {{c.stream}} value so that i can use it in views.py i want to filter the content acoording to it, and want to