Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-05 Thread Carl Meyer
Hi Larry, On 12/05/2014 09:16 PM, Larry Martell wrote: > I have a django view that normally receives POSTed data from a web > page. That all works fine. But now we also want to call that view from > a python script. That is failing with a 403 because of a CSRF > mismatch. I can disable CSRF on my

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-05 Thread James Schneider
Check out Collin's email from earlier, it has an example using curl but you should be able to adapt your web request with the cookie and POST values via the python script. The cookie and POST values for the CSRF token can be anything, they just need to match.

Re: django, multi-tenancy and urls

2014-12-05 Thread Kelvin Wong
Take a look at Cartridge. It has multi-tenancy out of the box. The rewriting can be done in Nginx or Apache. K On Friday, December 5, 2014 3:10:36 AM UTC-8, vijay shanker wrote: > > am writing a e-commerce application where different people can have > stores with urls like this:

POSTing data to a django view from a stand alone script with CSRF

2014-12-05 Thread Larry Martell
I have a django view that normally receives POSTed data from a web page. That all works fine. But now we also want to call that view from a python script. That is failing with a 403 because of a CSRF mismatch. I can disable CSRF on my view and then it does work from the script. Is there some way

Re: django shell not respecting vi editing-mode in .inputrc

2014-12-05 Thread Collin Anderson
Hi, manage.py shell is either going to use the regular python shell or IPython under the hood. You could try manage.py shell --plain to see using the regular shell works if you're getting IPython. If nothing else it looks like you might be able to do ctrl+alt+j to switch to vi mode. Collin

modelformst save

2014-12-05 Thread Brad Rice
For the life of me I can't figure out how to use a modelformset with class view. I get it to display but it won't save. Also, when it goes into form_invalid, it doesn't display the 3 formsets. Can anyone shed a little light? I'm using crispy forms with this in my template: {% crispy

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-05 Thread Russell Keith-Magee
On Fri, Dec 5, 2014 at 8:56 PM, Artie wrote: > Good day, Community, > > I'm looking for advise on MySQL & MongoDB usage so please let me take your > time to describe the situation. > > I came to work on e-commerce shop of electrical components with about 10 > millions of

django-ckeditor noop?

2014-12-05 Thread Christos Jonathan Seth Hayward
At http://stackoverflow.com/questions/27321396/how-can-i-get-my-django-ckeditor-installation-to-recognize I asked what I could do to get a RichTextField() to be displayed with a CKeditor widget. Any advice for what I should change? Thanks, -- [image: Christos Jonathan Seth Hayward]

Re: Does ticket 19866 apply to Django 1.4

2014-12-05 Thread Carl Meyer
Hi Brian, On 12/04/2014 10:15 PM, yakkades...@gmail.com wrote: > > Does ticket 19866 apply to > Django 1.4? Reading through the notes, it seems it does but I'm still > getting a 500 error. If not, is there a way to keep Django from returning a >

Re: Mysql connector python 3

2014-12-05 Thread Andreas Kuhne
François, Merci! That is really good info! I will have to check that as well.. Problem is it's hard to count all of the places where I would need to add a ping, but I guess that'll have to be my step 2 if just changing the connector doesn't work. Regards, Andréas 2014-12-05 16:19 GMT+01:00

Add another link missing in Chrome

2014-12-05 Thread Timothy Good
Django Users, I am working through polls tutorial part 2 that enhances the admin page. Note that I did search for a solution in the recommended places but while I saw similar complaints, none seemed to match exactly. In poll tutorial 2 it says "At the end of the three current slots you will

post_save strange behavior (at least to me!)

2014-12-05 Thread Victor
Django 1.7.1 and Apache2 in a production context. I have the following situation = models.py class Items(models.Model): code = models.CharField(primary_key=True,db_index=True,unique=True,max_length=20,db_column='code') description = models.CharField(max_length=255)

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

2014-12-05 Thread Cal Leeming
You *could* write your JS/HTML in Python using a preprocessor such as pyjs [1] or markup [2], but I'd *strongly* recommend against it. This is mainly because of added complexity, you cannot guarantee your generated code will be optimized and you will most likely encounter weird edge cases, parser

Re: Mysql connector python 3

2014-12-05 Thread François Schiettecatte
Hi Couldn't resist and did a quick test. The original tests I did were with MySQLdb, and I just reran the tests with MySQL Connector/Python and mysqlclient (assuming that django prioritizes mysqlclient over MySQLdb if both are installed). If I make a request, then sleep for more than the

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

2014-12-05 Thread inoyon artlover KLANGRAUSCH
Did it in this fashion: models.py class Interests(models.Model): ORDER = [(y, y) for y in range(10, 200, 10)] interest = models.CharField( verbose_name='Interesse', max_length=40) interest_order = models.SmallIntegerField(default=None, choices=ORDER) interest_active =

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

2014-12-05 Thread Mariusz Wilk
Thanks for your advice! PhoneGap uses JS, HTML and CSS. Is there any way I could do this in Python or would it be unneccessarily complicated since maybe there's no PhoneGap-type-of-framework for Python? W dniu środa, 3 grudnia 2014 00:56:17 UTC użytkownik Cal Leeming napisał: > > Hi Mariusz,

Re: cURL or wget with contrib.auth and CSRF

2014-12-05 Thread Collin Anderson
Hi David, It's actually pretty easy in curl. curl -d"csrfmiddlewaretoken=a" -H"Cookie: csrftoken=a" http: //yourdjangosite.com Collin On Thursday, April 14, 2011 7:32:46 AM UTC-4, David wrote: > > Hello, > > I am sorry for asking this, I know similar questions have been asked > before but I

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

2014-12-05 Thread Collin Anderson
Hi, Create an admin Inline like this: class CustomInterestsInline(admin.TabularInline): model = CustomInterests class CustomUserprofileInterests(admin.ModelsAdmin): inlines = [CustomInterestsInline] Collin On Thursday, December 4, 2014 5:58:31 AM UTC-5, inoyon artlover KLANGRAUSCH

Re: How to restrict save function in Django admin

2014-12-05 Thread Collin Anderson
Hi, Would it work to validate the CSV in the form? Maybe start processing it, but if there's an error, raise a forms.ValidationError? Collin On Wednesday, December 3, 2014 12:03:56 AM UTC-5, Akshay Mukadam wrote: > > Hi, > I have developed application that loads CSV file, if the input

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

2014-12-05 Thread Danish Ali
If I remove slug code, then everything works fine. And can you tell me how can I expand the variables? Thanks On Fri, Dec 5, 2014 at 6:51 PM, Collin Anderson wrote: > Hi, > > If you remove all the slug code do you still get this error? If so, then > the error has nothing

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

2014-12-05 Thread Collin Anderson
Hi, If you remove all the slug code do you still get this error? If so, then the error has nothing to do with automatically creating a slug. Try expanding Local vars to see what "params" and "sql are. File "e:\python\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 920.

Re: Mysql connector python 3

2014-12-05 Thread Andreas Kuhne
François, Thanks for the offer, however I will be trying to change to mysqlclient instead of the mysql-connector-python connector. I can only do this by releasing to our production servers, which will not be until Tuesday. So unfortunately I will have to wait until then. Regards, Andréas

Re: Test client to a redirect requiring a login doesn't set redirect_chain properly? [2nd follow-up]

2014-12-05 Thread Collin Anderson
Hi, If you define your url before the admin, it might get your view instead. (I _think_ it will work, though I may be totally wrong.) Collin On Wednesday, December 3, 2014 2:02:42 PM UTC-5, Tim Chase wrote: > > On 2014-11-30 11:04, Collin Anderson wrote: > > As of django 1.7, the admin will

Re: django setup error using db2

2014-12-05 Thread Collin Anderson
Hi, I'd ask on the ibm-db list. http://groups.google.com/group/ibm_db Collin On Wednesday, December 3, 2014 1:40:05 PM UTC-5, 白夜 wrote: > > tristan@NorthStar:~/Coding/NorthStar$ python3 manage.py runserver > Performing system checks... > > System check identified no issues (0 silenced). >

Re: Mysql connector python 3

2014-12-05 Thread François Schiettecatte
Andreas I have had to use this workaround for scripts that run a long time between database accesses: from django.db import connection def checkConnection(): # Check the connection, close if needed try: connection.connection.ping() # print 'INFO:

Seeking for advise on usage MySQL together with MongoDB

2014-12-05 Thread Artie
Good day, Community, I'm looking for advise on MySQL & MongoDB usage so please let me take your time to describe the situation. I came to work on e-commerce shop of electrical components with about 10 millions of products. Now all of it stored in awful structure of tables in MySQL. Products

Re: Swampdragon, the realtime framework for Django seems interesting. But will it scale ?

2014-12-05 Thread hagstedt
You should be able to load balance SwampDragon (though I haven't actually tried this out yet). I ran some simple tests with 300 connections to a small linode instance, where I subscribed over 300 users (I think it was in the realms of 500 but I don't have the results anymore). I had each

django, multi-tenancy and urls

2014-12-05 Thread vijay shanker
am writing a e-commerce application where different people can have stores with urls like this: www.store-one.saas.com, www.store-two.saas.com, and so on. These domains have to be generated automatically when a user signs up for store. I have read somewhere that www.saas.com/store-one can be

Re: Matching wit XOR

2014-12-05 Thread Russell Keith-Magee
On Fri, Dec 5, 2014 at 5:24 PM, inoyon artlover KLANGRAUSCH < inoyonartlo...@googlemail.com> wrote: > Hi everybody, > > need to accomplish a matching in following fashion: > > Users have to edit their psychological profile and > select XOR characteristic on each category. > > Qestions: > 1. >

Re: Mysql connector python 3

2014-12-05 Thread Erik Cederstrand
> Den 05/12/2014 kl. 10.08 skrev Andreas Kuhne : > > I tried the CONN_MAX_AGE setting and it didn't work. We still get problems, > so I'll have to try changing the connector. The only thing left I think. Do you have access to the MySQL server logs? That might give

Matching wit XOR

2014-12-05 Thread inoyon artlover KLANGRAUSCH
Hi everybody, need to accomplish a matching in following fashion: Users have to edit their psychological profile and select XOR characteristic on each category. Qestions: 1. extroverted: (checkbox) or introverted: (checkbox) 2. organised: (checkbox) or spntaneous: (checkbox) So only ONE

Re: Mysql connector python 3

2014-12-05 Thread Andreas Kuhne
Hi Collin, Thanks! I tried the CONN_MAX_AGE setting and it didn't work. We still get problems, so I'll have to try changing the connector. The only thing left I think. Regards, Andréas 2014-12-05 5:07 GMT+01:00 Collin Anderson : > Hi Andréas, > > If it helps,