another CSRF question -- and django hitcount

2014-12-06 Thread Eric Abrahamsen
I have a question about the django-hitcount app that I think is likely csrf-related. I recently upgraded a site from Django 1.4 all the way to 1.7. I've got most everything working fine, except that the hitcount app I've been using[1], stopped recording hits. Nevermind the actual app, it works by

Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
I need to connect my project to sharepoint. So i installed "sharepoint 0.4.1" package and then use this code in my view : from sharepoint import SharePointSite, basic_auth_opener def userloginres(request): server_url = "http://portal:8080/"; site_url = server_url + "rashno/" opener = basic_auth_

Re: Connect django project with sharepoint 2013

2014-12-06 Thread François Schiettecatte
Ok, but I am not sure what this has to do with Django ? Maybe you should ask on a SharePoint mailing list ? And did you try running the code in a script on the command line ? François > On Dec 6, 2014, at 7:10 AM, Hossein Rashnoo wrote: > > I need to connect my project to sharepoint. So i ins

Re: Add another link missing in Chrome

2014-12-06 Thread Timothy Good
Here is the heart of my question: Is basic Django code (like in the poll tutoiral) supposed to render the same in different browsers? If the answer is 'Yes' this looks like a bug. Thoughts? On Friday, December 5, 2014 11:19:37 AM UTC-5, Timothy Good wrote: > > Django Users, > > I am working

Re: Web and mobile app with Django? Kivy? sth else?

2014-12-06 Thread Russell Keith-Magee
Hi Mariusz, It depends how many sharp edges you're willing to live with. I've been working on a project to allow users to develop native mobile apps in Python: http://pybee.org/toga/ It's *very* early stage though - nothing close to production ready. There isn't even really a tutorial for mobile

TypeError: unbound method save() must be called with NagiosLog instance as first argument (got nothing instead)

2014-12-06 Thread Phil F
Hi, I am attempting to write a python script that will populate the Django db from data stored in a dictionary. I'm currently getting the error :"TypeError: unbound method save() must be called with NagiosLog instance as first argument (got nothing instead)" from incidents.models import Nagios

Re: Web and mobile app with Django? Kivy? sth else?

2014-12-06 Thread graeme
If you want to do everything in Python (which I like to) my choices would be Django for the backend, Kivy for the mobile apps, and Django Rest Framework to provide APIs for the mobile apps. If you want to keep it simpler maybe a responsive web design will be enough, so you only need Django, HTM

Re: How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-06 Thread Collin Anderson
Hi, Are you saying you have a ForeignKey choice field on the same form (above the ManyToMany), and when you change the choice field it should change the available values in the ManyToMany? Collin On Thursday, December 4, 2014 7:20:13 PM UTC-5, inoyon artlover KLANGRAUSCH wrote: > > Very cool!

Re: Problem Making New Django project - please help

2014-12-06 Thread Collin Anderson
Hi, Is your DJANGO_SETTINGS_MODULE set in your environment? You may need to clear that out before running django-admin.py Something like one of these: unset DJANGO_SETTINGS_MODULE DJANGO_SETTINGS_MODULE= django-admin.py startproject env -u DJANGO_SETTINGS_MODULE django-admin.py startproject Co

Re: Django development server crash on syntactic or indent error after check

2014-12-06 Thread Collin Anderson
Hi, Yes, this happens to me frequently. It happens when editing models.py or something imported by a models.py. It's on my mental dream list of things to fix, but feel free to open a ticket about it if there's not one open already. Collin On Friday, December 5, 2014 2:00:01 AM UTC-5, Mario De

Re: Django development server crash on syntactic or indent error after check

2014-12-06 Thread Collin Anderson
It happens if there's a SyntaxError in a models.py file. On Saturday, December 6, 2014 12:32:17 PM UTC-5, Collin Anderson wrote: > > Hi, > > Yes, this happens to me frequently. It happens when editing models.py or > something imported by a models.py. It's on my mental dream list of things > to f

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-06 Thread Collin Anderson
Hi, Does this work? (What you've already tried, but not using autoslug at all.) from django.utils.text import slugify slug = models.SlugField(null=True, blank=True) def save(self, *args, **kwargs): self.slug = slugify(self.name or '') super(Shop, self).save(*args, **kwarg

Re: ManyToManyField with rating using 'through' on each ManyToMany relation in Django

2014-12-06 Thread Collin Anderson
Hi, To limit the number or rows in an inline, max_num is usually the way to go. https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin.max_num As far as having the list of all possibilities available as options goes, it gets a little more complicated and I

Re: post_save strange behavior (at least to me!)

2014-12-06 Thread Collin Anderson
Hi Vittorio, ManyToMany fields are technically stored in a separate table in the database and are technically a separate "record" from the parent model. The parent model needs to be saved first (firing the post_save signal), and only then can the ManyToMany values be updated. I'd override the

Re: Does ticket 19866 apply to Django 1.4

2014-12-06 Thread Collin Anderson
Hi Brian, If you're behind nginx, you can filter the hostname there before it hits django. I usually add an empty server {} block at the beginning of my conf to act as the default and catch server host names that are not defined so they don't hit django. Collin On Friday, December 5, 2014 12:

Re: django-ckeditor noop?

2014-12-06 Thread Collin Anderson
Hi, That should work. Did you restart the server? Are you using CKEDITOR_RESTRICT_BY_USER? Is "ckeditor" in the source of the page at all? Are there errors on the javascript console? What does your admin.py look like? Collin On Friday, December 5, 2014 1:09:59 PM UTC-5, Jonathan Hayward wr

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-06 Thread Collin Anderson
Hi, What do you mean by "parsing with updating of products"? I'd personally store everything in authoritatively in that 1 generalized table and get rid of the 10 smaller tables. Have a "manufacturer" CharField or ForeignKey to determine what fields are available and other custom logic. As you

Re: Error: 'NoneType' object has no attribute 'strip'

2014-12-06 Thread Danish Ali
No. It also did not work. It was also giving similar error. On Saturday, December 6, 2014, Collin Anderson wrote: > Hi, > > Does this work? (What you've already tried, but not using autoslug at all.) > > from django.utils.text import slugify > > slug = models.SlugField(null=True, blank=True)

Bug in staticfiles' HashedFileMixin?

2014-12-06 Thread Bernhard Mäder
Hey guys, HashedFileMixin's pattern variable looks like it could be extended for other file types: class HashedFilesMixin(object): default_template = """url("%s")""" patterns = ( ("*.css", ( r"""(url\(['"]{0,1}\s*(.*?)["']{0,1}\))""", (r"""(@import\s*[

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-06 Thread Cal Leeming
Hi Artie, First, I would strongly recommend reading some of the work by David Mytton at Server Density, he and his team have been using MongoDB extensively for many years and they have shared a lot of their insight [1]. It's also worth mentioning that Postgres has support for JSON field type [2] w

Re: TypeError: unbound method save() must be called with NagiosLog instance as first argument (got nothing instead)

2014-12-06 Thread Vijay Khemlani
Call k.save() instad of NagiosLog.save() On Sat, Dec 6, 2014 at 8:26 AM, Phil F wrote: > Hi, > > I am attempting to write a python script that will populate the Django db > from data stored in a dictionary. > > I'm currently getting the error :"TypeError: unbound method save() must be > cal

Re: TypeError: unbound method save() must be called with NagiosLog instance as first argument (got nothing instead)

2014-12-06 Thread monoBOT
Short answer is Vijay's ... long answer is you have to save() the instanced object of the class not the class itself. 2014-12-06 22:14 GMT+00:00 Vijay Khemlani : > Call > > k.save() > > instad of > > NagiosLog.save() > > > > On Sat, Dec 6, 2014 at 8:26 AM, Phil F wrote: > >> Hi, >> >> I am attem

Re: Add another link missing in Chrome

2014-12-06 Thread Russell Keith-Magee
Hi Timothy, No two browsers will ever render things *identically*, but it should certainly be functionally equivalent, and at least bear a striking resemblance to each other. There certainly shouldn't be a missing button or anything like that. My immediate reaction is that you've probably got som

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-06 Thread Mario Gudelj
Django ORM is the best thing since sliced bread! On 07/12/2014 8:17 am, "Cal Leeming" wrote: > Hi Artie, > > First, I would strongly recommend reading some of the work by David Mytton > at Server Density, he and his team have been using MongoDB extensively for > many years and they have shared a

Re: another CSRF question -- and django hitcount

2014-12-06 Thread Eric Abrahamsen
Eric Abrahamsen writes: Apologies for the very stupid posting below! I did my homework, and actually used the JQuery ajax function, like I was supposed to. Incidentally, I also had the "async" keyword on the tag in the head that loaded jquery, and that apparently killed the document.ready funct

[OFFTOPIC] Import Python Weekly Newsletter

2014-12-06 Thread Ankur Gupta
Hi Guys, Want to draw your attention to http://importpython.com a weekly python newsletter. Newsletter also features Django Articles, Projects on regular basis. Also have a look at http://importpython.com/books/ which list 53 free Python Books. Regards, Ankur -- You received this message bec

Re: Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
I need this connection for adding list items and save my users data on sharepoint database. I ran it in command line and when i write something like """ print site.lists[0] """ this error appear : File "", line 1, in File "/usr/lib/python2.6/site-packages/sharepoint/lists/__init__.py", li

Re: Connect django project with sharepoint 2013

2014-12-06 Thread Mario Gudelj
Urllib2 can't open the url http:// portal:8080. I assume that you can't visit that url from the browser either On 07/12/2014 3:46 pm, "Hossein Rashnoo" wrote: > I need this connection for adding list items and save my users data on > sharepoint database. I ran it in command line and when i write

Re: How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-06 Thread inoyon artlover KLANGRAUSCH
Hi Collin, yes exactly. It is as follows: User can select a main coummunication language which is connected as ForeignKey to the main langauges table. Withn the field below the user can select further languages but when I select english as main language, this language shouldn't be available withi

Re: Connect django project with sharepoint 2013

2014-12-06 Thread Hossein Rashnoo
I can access to http://portal:8080/ in my browser when i set our office proxy and port. And my linux server that i run django on it, is local. Do i need to set proxy to access sharepoint? On Sunday, December 7, 2014 8:30:18 AM UTC+3:30, somecallitblues wrote: > > Urllib2 can't open the url http: