Upload from mobile device using POST

2011-05-01 Thread Matias Hernandez Arellano
(sorry for my english) (i open this thread cuase the other thread was for another question) I have a mobile device application (iOS) and i want to upload an image to my django application In my mobile application i create the POST request (and disable csrf in my django app) using this: -

Re: Upload image using GET

2011-05-01 Thread Javier Guerra Giraldez
On Sun, May 1, 2011 at 11:53 PM, Matias Hernandez Arellano wrote: > i only use this to test > def upload_image(request): >    if request.method == 'POST': >        return "request.FILES['image']" >    return "NO imagen subida" is this your view function? if so, it should

Re: Upload image using GET

2011-05-01 Thread Matias Hernandez Arellano
yes, thanks.. i try using POST but i get a error 500 i only use this to test def upload_image(request): if request.method == 'POST': return "request.FILES['image']" return "NO imagen subida" El 01-05-2011, a las 23:11, А. Р. escribió: > 2011/5/2 Matias Hernandez Arellano

Form with manytomany field

2011-05-01 Thread Daniel França
Hi all, I'm trying to create a form from a model with ManyToManyField, I want something like this: You fill some fields from the referenced table and you click at 'Add' and this appears at a table below the fields, so when I click "Save" all the added items save (includind the new manytomany

Re: Upload image using GET

2011-05-01 Thread А . Р .
2011/5/2 Matias Hernandez Arellano <...@archlinux.cl>: > > And if it's not possible use GET to pass the image data to the django > application.. > how can i pass de data from a mobile application (without user actions like a > web form) to the django application, and upload, or copy de data into

Re: Upload image using GET

2011-05-01 Thread Matias Hernandez Arellano
Thrift: http://incubator.apache.org/thrift/ And if it's not possible use GET to pass the image data to the django application.. how can i pass de data from a mobile application (without user actions like a web form) to the django application, and upload, or copy de data into a new image??

Re: Upload image using GET

2011-05-01 Thread А . Р .
2011/5/2 msdark <...@gmail.com>: > The service is written in C++ and use thrift to create a Client with > python.. so i write a simple django application like and interface to > the C++ service. What is "thrift"? Do you really mean it? > > Now i need to upload an image to the django

Upload image using GET

2011-05-01 Thread msdark
(sorry for my english) Hi!, i have a mobile application (iOS and Android), this applciation need to upload an image (internally) to a service . The service is written in C++ and use thrift to create a Client with python.. so i write a simple django application like and interface to the C++

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
>  Oleg Lomaka <...@gmail.com> : > >> Hm... Again I think I have answered this question already. >> Book.objects.annotate(s_count=Count('sequences')).filter(s_count=0) > > Right, but if you're trying to get book by id, this is not an option. > Again, you will need to query db twice. > Besides,

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
Oleg Lomaka <...@gmail.com> : > Hm... Again I think I have answered this question already. > Book.objects.annotate(s_count=Count('sequences')).filter(s_count=0) Right, but if you're trying to get book by id, this is not an option. Again, you will need to query db twice. -- You received this

Re: Using User.add_to_class

2011-05-01 Thread Andre Terra
First of all, I'm a noob. But why not using a custom User model altogether? Such as UserProfile with an FK to auth User and run the checks against that in your app? This seems to be like the solution with less maintenance overhead. Sincerely, André Terra (airstrike) On Fri, Apr 29, 2011 at

Re: Resolve function ?

2011-05-01 Thread Calvin Spealman
On Sun, May 1, 2011 at 1:34 PM, doniyor wrote: > hi There, > > i am novice in django so i need your help, i read books but if i talk > to you guys, may be i get it faster than reading books. > > so, what doesnot give me peace is that i dont understand the function >

Re: Unable to log in to admin using RemoteUserMiddleware

2011-05-01 Thread Dustin
So I figured out a hack to solve this problem and hopefully this will save someone from this problem in the future. After RemoteUserMiddleware is included in the settings.py file, when you visit any area of the site where your server asks you to log in, once you log in it will automatically

Re: Unable to log in to admin using RemoteUserMiddleware

2011-05-01 Thread Dustin Dannenhauer
So I figured out a hack to solve this problem and hopefully this will save someone from this problem in the future. After RemoteUserMiddleware is included in the settings.py file, when you visit any area of the site where your server asks you to log in, once you log in it will automatically

Re: django postgre_psycopg2 error

2011-05-01 Thread Yasmany Cubela Medina
yes is the deploy enviroment that have the problem but i ask for help for fixit because if all other django framework works why this pacticullary db backend throw this error. if any one can put me in the right direction or gave some advices.

Re: How to setup the django progject to apache2

2011-05-01 Thread George Ajam
Did you tried to put your configuration in a file similar to default inside /etc/apache2/sites-available then try to make an enable to the site using a2ensite follwed by the name of your file, and I guess you should leave httpd.conf blank. Regards, George On May 1, 1:41 pm, Steven Han

Re: django postgre_psycopg2 error

2011-05-01 Thread Shawn Milochik
This has nothing to do with Postgres. This is a simple Python issue. Your production machine isn't set up the same as your development machine. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: django postgre_psycopg2 error

2011-05-01 Thread Yasmany Cubela Medina
yes the line tell that cant find util.py but this only happend with postgresql because i tested with mysql and work fine, so what is the problem, i have installed psycopg python 2.5 django 1.3 in my laptop this work perfect but in the host dont, i read som post in internet but the problem was

Re: django postgre_psycopg2 error

2011-05-01 Thread Shawn Milochik
Read the traceback you posted. The bottom line tells you exactly where the problem is. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send

django postgre_psycopg2 error

2011-05-01 Thread bitgandtter
hi, im deploying my django app in a webhost (mochahost) and i get this error MOD_PYTHON ERROR ProcessId: 23641 Interpreter:'gruporole.com' ServerName: 'gruporole.com' DocumentRoot: '/home/gruporol/public_html' URI:'/services' Location: None Directory:

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread Oleg Lomaka
Hm... Again I think I have answered this question already. Book.objects.annotate(s_count=Count('sequences')).filter(s_count=0) These are books, that doesn't belong to any sequence. And with one query (though quite heavy query). 2011/5/1 А. Р. <4d876...@gmail.com> > > That's right. But if we

Resolve function ?

2011-05-01 Thread doniyor
hi There, i am novice in django so i need your help, i read books but if i talk to you guys, may be i get it faster than reading books. so, what doesnot give me peace is that i dont understand the function resolve and how to use it. say, i want to get the view from this request: /s/?

Re: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
I got the error like this: Forbidden You don't have permission to access / on this server. -- Apache/2.2.16 (Ubuntu) Server at 127.0.0.1 Port 9000 when I modify the httpd.conf: Listen 9000

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
Oleg Lomaka <...@gmail.com> : > We don't need the first query for fetching books. All data about book > available from BookSequence too. And all filters you apply to books, you can > apply to BookSequence via book__ filter. Again, from my first example, and > using just one query > bs = >

Re: How to setup the django progject to apache2

2011-05-01 Thread Gianluca Sforna
On Sun, May 1, 2011 at 12:41 PM, Steven Han wrote: > But every time I run the URL http://127.0.0.1:9000 > it always displays: > > "Oops! Google Chrome could not connect to 127.0.0.1:9000 " > > :( > Do you know what I missed ? This is more an apache question than a django

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread Oleg Lomaka
We don't need the first query for fetching books. All data about book available from BookSequence too. And all filters you apply to books, you can apply to BookSequence via book__ filter. Again, from my first example, and using just one query bs =

Overwriting the handler404

2011-05-01 Thread doniyor
Hi there, i am trying to overwrite handler404 of django so that i can call my own view function when it doesnot find the appropriate view and if it tries to give Http404. the whole problem is as follows: i defined my view function called 'remap_test' in my proxy app. and i changed the default

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
Oleg Lomaka <...@gmail.com> : > Sorry, but your question is too general as for me. Django doesn't support > SQL joins directly. Could you specify with an example what data do you need > to get from database using "joins"? I just wonder if it is possible to get data from those three tables in one

Troubleshooting: How do I make JavaScript shotcuts 'today' and 'now' display?

2011-05-01 Thread dotcomboy
Hello and thanks in advance, I am running Django 1.3 on Firefox 4.0.1 under Python 2.7.1 on Windows Vista. The second page of the introductory tutorial at Django's official homepage says: "Each DateTimeField gets free JavaScript shortcuts. Dates get a 'Today' shortcut and calendar popup, and

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread Oleg Lomaka
Sorry, but your question is too general as for me. Django doesn't support SQL joins directly. Could you specify with an example what data do you need to get from database using "joins"? For example if you need to retrieve all books with zero associated sequences (empty sequences list), then code

Re: probably a simple query: looping for an integer number within an html page

2011-05-01 Thread Tiago Almeida
Can you provide more details? What error are you getting? Or you get no error and no output? Are you sure you are inserting "somelist" in the context? Is somelist a list of integers or is it an object with an attribute int_item that is a list of ints? Br, On Apr 30, 10:42 pm, Jason

Re: Attribute error

2011-05-01 Thread DJ Ango
Capitalize class names. class Wish(models.Model): the_wish = models.CharField(max_length=100) On Apr 30, 4:26 pm, Pulkit Mehrotra wrote: > changed the name but nothing happened > the django version is 1.3 -- You received this message because you are subscribed

Re: form input

2011-05-01 Thread DJ Ango
in models.py you define your database fields: The use a ModelForm: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#modelform Or try the generic create/update/delete views: http://docs.djangoproject.com/en/dev/ref/generic-views/?from=olddocs#create-update-delete-generic-views On

Re: How to setup the django progject to apache2

2011-05-01 Thread Robbington
Fair enough, But if you are in the stages of development then its best to use the development server due to the way apache caches data, as changes to your code may not always show straight away leaving you scratching your head as to what is causing any unforeseen errors. Anyways, if you are

Re: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
no , I don't And I can use pythom manage.py runserver to run the project. But I just want to use the apache server. After installing the apache. I didn't modify any files except the httpd.conf file. 2011/5/1 Robbington > Bit confused matey, > > Do you have a domain

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread А . Р .
2011/5/1 Oleg Lomaka <...@gmail.com>: > bs = BookSequence.objects.filter(book__pk=1).select_related() > for s in bs: >        print s.sequence.name, s.number_in_sequence Oh, thanks! Is it possible then to do left/right outer joins, as there may exist books without sequences and sequences without

Re: How to setup the django progject to apache2

2011-05-01 Thread Robbington
Bit confused matey, Do you have a domain name to serve those pages to? If you are just trying to run it from localhost, 127.0.0.1: why not just use the Django development server? Rob -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
Btw, the url.py is like this: from django.conf.urls.defaults import patterns, include, url from django.views.generic import DetailView,ListView from polls.models import Poll # Uncomment the next two lines to enable the admin:

Re: fetching data from intermediate many-to-many table

2011-05-01 Thread Oleg Lomaka
bs = BookSequence.objects.filter(book__pk=1).select_related() for s in bs: print s.sequence.name, s.number_in_sequence On Sun, May 1, 2011 at 1:30 PM, Alex <4d876...@gmail.com> wrote: > Hello! > Assume we have the following models: > > > class Book(models.Model): >title =

How to setup the django progject to apache2

2011-05-01 Thread Steven Han
Hi, I want to develop Django on the Apache2 server. And I have follow the some instruction about how to setup django app on the apache2 server. but allows failed. My system is Ubuntu 10.10. what my step as below: (1) sudo apt-get install apache2 (2) sudo apt-get install libapache2-mod-wsgi

Re: django-admin.py startproject mysite

2011-05-01 Thread Daisy
yes.I have installed it with the setuptools (python setup.py install) is that affect in my issue? On Apr 30, 5:25 pm, Yongning Liang wrote: > if you tried the command django-admin.py startproject mysite and it output > the usage, it mean the PATH of Python and

fetching data from intermediate many-to-many table

2011-05-01 Thread Alex
Hello! Assume we have the following models: class Book(models.Model): title = models.CharField() sequences = models.ManyToManyField(Sequence, through='BookSequence') class Sequence(models.Model): name = models.CharField(unique=True) class BookSequence(models.Model): class Meta:

blank=True, null=True dont work with UserProfile

2011-05-01 Thread Daniel Corbe
Hello friends, I have the following models, the problem is that the fields null = True and blank = True, are being validated when they should enter zero plumb, can someone help me? class UserProfile(models.Model): sexo =