Re: Sqlite3 to Postgres Migration?

2015-02-20 Thread Mike Dewhirst
On 21/02/2015 9:55 AM, talex wrote: Thanks for your helpful comments. Andrew, thanks for your migration article at http://afrg.co/updj17/a2 . It is slightly daunting for me at this point, but I may need to come back to it later. Your book looks interesting. Mike, thanks for the dump/load

Problem whit Stripe payment setup (stripeToken)

2015-02-20 Thread Petar Pilipovic
Hello there I am making an e_commerc django app, and I am trying to setup stripe as a payment. I have done all the tutorial setup from stripe.com site and when I use stripe test credit card I only get : I do not see mine stripeToken. I have tried to google it on the web and they have told me

Re: Create a new object for the newly registered user

2015-02-20 Thread Vijay Khemlani
You can use a post_save signal for the User Model https://docs.djangoproject.com/en/1.7/ref/signals/#post-save from django.db.models.signals import post_save from django.contrib.auth.models import User def create_about(sender, **kwargs): user = kwargs['instance'] if kwargs['created']:

Re: How to filter results using forms in Django/Python (best approach) ?

2015-02-20 Thread Vijay Khemlani
It's not clear what's the purpose of the view you are showing. ¿Is it supposed to display a form with "haircolor" and "status" fields and filter the results it displays based on that? In that case you can declare a form: from django import forms class ScreeningForm(forms.Form): haircolor =

Re: html response to be loaded in a div

2015-02-20 Thread Vijay Khemlani
If you're using jQuery 1.5.1 or above you can do this instead // using jQuery function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) {

Re: Design question: Is it really a good idea for models having “side effects”?

2015-02-20 Thread Russell Keith-Magee
On Fri, Feb 20, 2015 at 4:23 PM, Gergely Polonkai wrote: > Hello, > > I’m currently implementing a finite state machine in my application using > Django FSM[1]. In the Usage section of the README the author said that > “This function may contain side-effects, like updating

Re: JSON Response

2015-02-20 Thread elcaiaimar
I solved it! Sorry, at last I had a bad called to jquery library in my base.html. I had to check all my project Thank you for your answers, you have helped me a lot! El viernes, 20 de febrero de 2015, 21:01:46 (UTC+1), elcaiaimar escribió: > > Please, have a look at this tutorial: >

Re: Sqlite3 to Postgres Migration?

2015-02-20 Thread Andrew Farrell
One approach may be to use django-import-export to add to the admin interface the capability to export your data to CSV (or JSON or Excel) and likewise to import it. Then, simply run two instances of your app: one on top of postgres, one on

Re: matplotlib pyplot stop working

2015-02-20 Thread dk
yep I get the same issue the guy is commenting, were it happen when I run it more than once, I will try to do the multiprocess that he mention and I will see what happen. On Friday, February 20, 2015 at 11:22:32 AM UTC-6, Collin Anderson wrote: > > Hi, > > The freezing could be a memory leak.

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread George Silva
check merge migrations. some migrations the framework will combine whenever possible. Em 20/02/2015 17:15, "Martin Kapfhammer" escreveu: > Yep, I can drop the column and create a new one as integer. > The only problem I have is that creating the field as a char was in

Re: Sqlite3 to Postgres Migration?

2015-02-20 Thread talex
Thanks for your helpful comments. Andrew, thanks for your migration article at http://afrg.co/updj17/a2 . It is slightly daunting for me at this point, but I may need to come back to it later. Your book looks interesting. Mike, thanks for the dump/load load suggestion. For the moment, I

Create a new object for the newly registered user

2015-02-20 Thread tiklitaba123
I am very new to django, so please bear with me. What I want is whenever a new user is registered I would like to create an `About` for that user. How will I do that? Please help me. Thank you. views: def register(request): if request.method == 'POST': form =

How to filter results using forms in Django/Python (best approach) ?

2015-02-20 Thread Ronaldo Bahia
I'm kind of new in python/django and I'd like to know: What's the best approach to filter results in Django using forms in a view? I need to filter candidates by haircolor, according to the model CandidateLook and by status, according to CandidateToJob model. Thanks in advance. Here is my

Re: JSON Response

2015-02-20 Thread elcaiaimar
Please, have a look at this tutorial: https://www.youtube.com/watch?v=Pxn5L1qJTAw Sorry, It's in spanish, but it's what I'm doing. I've tried to put the same code but it doesn't work because he uses an older version of django. If you don't want to see all the video, you can see the minute 12:16.

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread Martin Kapfhammer
Yep, I can drop the column and create a new one as integer. The only problem I have is that creating the field as a char was in migration number 0020, changing it to a foreign key was in migration number 0028 and now I have already 0036 migrations. Therefore I have to "hang in" the dropping and

Re: html response to be loaded in a div

2015-02-20 Thread João Marques
Oh I see. Meanwhile I'm trying to implement the token but I cant get this to work, I copied the code from Django's docs and now Im getting a javascript error syaing that the function sameOrigin is not defined. *Code*function getCookie(name) { var cookieValue = null; if

Re: JSON Response

2015-02-20 Thread Daniel Roseman
What it sounds like actually is that the OP is not preventing the default action of the form, so the page is being submitted normally and displaying the response. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: JSON Response

2015-02-20 Thread Collin Anderson
Hi, It sounds like you click "submit" and then get a page showing the raw json? That sounds like it could be a bug in your code. Either the event handler is not connected, or there's an error. You could try checking "Preserve Log" in the developer console. Collin On Thursday, February 19,

Re: matplotlib pyplot stop working

2015-02-20 Thread Collin Anderson
Hi, The freezing could be a memory leak. http://stackoverflow.com/questions/7125710/matplotlib-errors-result-in-a-memory-leak-how-can-i-free-up-that-memory Could the image be cached by the browser, does shift+F5 refresh it? The easiest way to fix it would be to use a different url/filename

Re: How to host django application in redhat using virtual environment?

2015-02-20 Thread Collin Anderson
Hi, Here's a tutorial. https://devops.profitbricks.com/tutorials/deploy-django-with-virtualenv-on-centos-7/ Collin On Thursday, February 19, 2015 at 8:29:47 AM UTC-5, SHINTO PETER wrote: > > How to host django application in redhat using virtual environment? > -- You received this message

Re: Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread George Silva
The deal here is that the model Currency has an ID, which is well, integer. Your data that is already on that column, is char (original field). If you are not in production, I would recommend dropping the field (comment the code), make migrations and apply. that will remove the currency column.

Re: OperationalError: ORA-03114: not connected to ORACLE.

2015-02-20 Thread Andreas Kuhne
2015-02-20 17:18 GMT+01:00 : > Hi, > > I migrated my project to a new infrastructure but i kept the same versions > Apache 2.2 + mod_wsgi + python 2.6.1 + Django 1.2.1 > > I am trying to run my project and i am getting the below exception that > seems to be from

Django 1.7 migrate for postgres fails: Charfield to ForeignKey

2015-02-20 Thread Martin Kapfhammer
First I created a CharField: ('currency', models.CharField(max_length=30)), In a later migration I changed it to a foreign key field: field=models.ForeignKey(to='web.Currency'), It worked on a local MySql instance, but not on Postgres on Heroku: django.db.utils.ProgrammingError: column

OperationalError: ORA-03114: not connected to ORACLE

2015-02-20 Thread alexandrosstylianou88
Hi, I have migrated my project to a new installation of Apache + mod_wsgi 3.2.1 + python 2.6.1 + Django 1.2.1, i kept the same versions just to be sure that i do not have any problems with my project. I am trying to run the project and i am getting this Oracle exception... The DB is fine

OperationalError: ORA-03114: not connected to ORACLE.

2015-02-20 Thread alexandrosstylianou88
Hi, I migrated my project to a new infrastructure but i kept the same versions Apache 2.2 + mod_wsgi + python 2.6.1 + Django 1.2.1 I am trying to run my project and i am getting the below exception that seems to be from Django and i need help pin pointing the exact cause, because i think

Re: html response to be loaded in a div

2015-02-20 Thread James Schneider
In most cases, including the CSRF token in AJAX requests is trivial, and processing the token is handled automatically by Django. I would recommend spending a few minutes to implement the CSRF protection in your code of you plan to ever move to production. It is easy enough and pays good dividends

Deploying Django, nginx , gunicorn, postgresql

2015-02-20 Thread Tony Kyriakidis
Hello, It's been a week now since the day i started trying to deploy a test blog application on digital ocean. I tried everthing and if you go to the IP: http://188.166.62.146 you get a Welcome to Nginx page. when i go to http://188.166.62.146:8001 i get a (400 Bad Request) error. Here on

Re: Transcode video using celery and ffmpeg in django

2015-02-20 Thread Vijay Khemlani
The task is just a function, you finished the tutorial, it's the same thing @app.task def trascode(video): subprocess.call('ffmpeg -i path/.../original path/.../mp4_720') # Change the path to the one given by video.original video.mp4_480 = # Something video.mp4_720 = # Something else

Re: Real time and Django - approaches

2015-02-20 Thread Carlos Aguilar
I build something related with realtime using gevent-socketio more than 1 year ago and works really well. Best Regards On Fri, Feb 20, 2015 at 6:37 AM, Aaron Reabow wrote: > Hi. > > I wanted to see what the Django community thought about realtime circa > 2015. > > My

Re: Migrating to initial migration: "ORA-00955: name is already used by an existing object"

2015-02-20 Thread Carsten Fuchs
Hi all, another update: My developer system's local Oracle database content was created from importing a dump of a production database. On Monday night I'll have a chance to safely try to create and apply the initial migrations on the production database, rather than my dev system. Maybe

Re: Can migrated apps depend on unmigrated apps?

2015-02-20 Thread Carsten Fuchs
Hi Collin, thank you very much for your reply! Am 19.02.2015 um 19:35 schrieb Collin Anderson: If you haven't yet, you could try generating migrations for the unmigrated app, and reference them using MIGRATION_MODULES. I've tried this, and my real problem is that I have problems with this

Re: django

2015-02-20 Thread François Schiettecatte
Two options: https://docs.djangoproject.com/en/1.7/ref/django-admin/#django-admin-dumpdata http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html François > On Feb 20, 2015, at 8:49 AM, raviki...@inndata.in wrote: > > how to dump mysql database table in our django project >

Re: Transcode video using celery and ffmpeg in django

2015-02-20 Thread Robin Lery
So mp4_480 and mp4_720 should be blank=True and null=True. And then pass the video instance object to the delay() ??? And also, could you please show me how to write the tasks.py, so that I can use ffmpeg code (subprocess.call('ffmpeg -i path/.../original path/.../mp4_720') to transcode. Thank

django

2015-02-20 Thread ravikiran
how to dump mysql database table in our django project -- 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

Re: Design question: Is it really a good idea for models having “side effects”?

2015-02-20 Thread Vijay Khemlani
I'm not sure if there's an official stance on that, but I believe that since Django is a "MVT" framework, that kind of logic does not seem to be appropiate neither for templates nor views, so models seem like the logical choice. That way you can also make sure that the side-effect that you want

Re: html response to be loaded in a div

2015-02-20 Thread Vijay Khemlani
Is is required by default. I would recommend including the csrf token in your ajax request. If you still want to prevent the CSRF verification in your view then you can use the "csrf_exempt" decorator https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#utilities On Fri, Feb 20, 2015 at 9:05

Re: Transcode video using celery and ffmpeg in django

2015-02-20 Thread Vijay Khemlani
Then in your task function you can get the file from the video model instance, trascode it, and store it in the corresponding fields of the object (mp4_480, mp4_720) On Fri, Feb 20, 2015 at 10:18 AM, Vijay Khemlani wrote: > I would do something like this > > video = Video()

Re: Transcode video using celery and ffmpeg in django

2015-02-20 Thread Vijay Khemlani
I would do something like this video = Video() video.original = form.cleaned_data['video'] # Assuming the form field is "video" video.user = user video.title = form.cleaned_data['title'] # Assuming the form field is "title" video.save() # You might need to make the mp4_480 and

Transcode video using celery and ffmpeg in django

2015-02-20 Thread Robin Lery
I would like to transcode user uploaded videos using celery. I think first I should upload the video, and spawn a celery task for transcoding. Maybe something like this in the tasks.py: subprocess.call('ffmpeg -i path/.../original path/.../output') > Just completed First steps with celery

Real time and Django - approaches

2015-02-20 Thread Aaron Reabow
Hi. I wanted to see what the Django community thought about realtime circa 2015. My impression (and I could be very wrong) is that if you want real time, you should build your own stack up from scratch. There are frameworks - like swampdragon/socketio - that promise to do the hard yards for

Django Admin Page

2015-02-20 Thread Tim Co
Hello, We are trying to run a local development server for our django python app. We are able to connect to our localhost index and get the "It Worked!" Dango page. However when we try to connect to 127.0.0.1/admin/ we are getting an error that the server dropped the connection. Here is the

Design question: Is it really a good idea for models having “side effects”?

2015-02-20 Thread Gergely Polonkai
Hello, I’m currently implementing a finite state machine in my application using Django FSM[1]. In the Usage section of the README the author said that “This function may contain side-effects, like updating caches, notifying users, etc.” Opposing this statement, the Symfony PHP framework’s

Re: html response to be loaded in a div

2015-02-20 Thread João Marques
According to Django documentation I can include a crsf token to prevent malicious acts, but it is not necessary right? Or am I getting this wrong? Because right now I wouldn't mind skipping the crsf token step for a little while I manage to get the rest of the essential things to work.

Re: extracting data from three tables

2015-02-20 Thread James Schneider
I would suggest reading this: https://docs.djangoproject.com/en/1.7/topics/db/queries/#lookups-that-span-relationships and see if that helps out. You can span relationships (in this case, using FK's) using the double-underscore notation. I would also check out using select_related() if you

Re: How to filter by Group_BY ?

2015-02-20 Thread James Schneider
Without more detail, a good place to start would be with the ORM aggregation documentation: https://docs.djangoproject.com/en/1.7/topics/db/aggregation/#filter-and-exclude I would advise reading the whole page, though. Note that the placement/order of filters are much more significant than with

How to filter by Group_BY ?

2015-02-20 Thread SHINTO PETER
How to filter by Group_BY ? -- 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

Re: Handling FormSet client side with javascript

2015-02-20 Thread aRkadeFR
Hello, Yes {{ formset.media }} works. But the problem is wider. How to include/manage the javascript around the formset? I want to add a media file (js) only on formset and not inside a form contained in a formset. Let me know if I'm not clear in my first message (it's a bit long to read, I

How to filter by Group_BY ?

2015-02-20 Thread SHINTO PETER
How to filter by Group_BY ? -- 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

Re: Seems like a geodjango bug with multiple databases

2015-02-20 Thread Jani Tiainen
On Wed, 18 Feb 2015 06:45:15 -0800 (PST) Luan Nguyen wrote: > I'm using geodjango and multiple databases, and experiencing a quite weird > situation, I guess it's a kind of bug but not absolutely sure since I'm > pretty new to Django. > > Here is how to reproduce the