Ok!

I think several times and solved the problem.

In fact I think the admin was waiting an address to build the http response
it self, not really a http response.

I remove the HttpResponse or HttpResponseRedirect method  from the return
statement, and it worked as I expected.

The wrong code line :
                       *#return HttpResponseRedirect('10.136.37.19:8080%s/'
% reverse 'app.views.job_exec_user_error', args=(self.jobhistory_id,)))   *

The correct code line :
                       #return (reverse('app.views.job_exec_user_error',
args=(self.jobhistory_id,)))

Now I'm dealing whith asyncronous communications.



2012/7/16 Eugène Ngontang <sympav...@gmail.com>

> Hi!
>
> To complete my HttpResponseRedirect issue, here is a screenshot i have
> when clinking on the link.
>
> The browser does not know the page content type, and I don't see the to
> set the content type with HttpResponseRedirect method, cause it takes only
> one argument, which is the address to redirect to.
>
> Thank for advance for your answer.
>
> 2012/7/15 Eugène Ngontang <sympav...@gmail.com>
>
>> Hi all!
>>
>> Hope you still remember this post which helps dive into django. I have
>> gone really ahead with my developments, and now i'm willing to make some
>> optimization and have some few issues. I don't know if I should open a new
>> thread for each one. You will tell me, but I prefered to do it here because
>> the initial thread was this one.
>>
>> - First I can't use the HttpResponseRedirect() method in my application,
>> it does not work like it should. In fact in my models module, I have a
>> JobHistory class and a member function in that class which returns a link
>> for the listdisplay of that model in the admin module.
>> But when the id i'm looking for in the database does not exist, i would
>> like to redirect the user to a custum error page. And to that I used
>> HttpResponseRedirect() wich is unable to return the right address to the
>> browser. I tried such things, read the documentation several times but
>> nothing. I thought it was the reverse function which does not locate the
>> page but no, because even with google address the browser receive a
>> response address with some headers concatanated, and the browser cannot
>> access the page, cause it has an invalid address:
>> the code line in the models module:
>>         def get_executing_user_url(self):
>>                 user_list = SystemUser.objects.filter(systemuser_name =
>> self.job_executing_user, host = self.job.host)
>>                 if not user_list:
>>                          return HttpResponseRedirect('
>> http://www.google.com/')
>>
>>                         #return HttpResponseRedirect('10.136.37.19:8080%s/'
>> % reverse('fancycron.views.job_exec_user_error',
>> args=(self.jobhistory_id,)))
>>                 else:
>>                         return '../systemuser/%s/' %
>> (user_list[0].systemuser_id)
>>
>> You can see I've even tried to hardput the server address, but it did not
>> work, and I even tested with google and it didn't work too. Tell me if I
>> missed something in the use of HttpResponseRedirect. The error is not a
>> django error, but the returned address is just not accessible each any time
>> i try.
>>
>> - The second issue is that I have implement my middleware (django) and
>> remote backend communication using django signals. It works, but as you can
>> expected, it's synchronous, and I would like now to do it asynchronously.
>> Is Celery the best option? If yes, could you please indicate me the
>> simplest and efficient way to set that up? Anyway, ho can I send messages
>> to my remote backend, without block in my browser rendering?
>>
>> Some good and working tutorials are welcome.
>>
>> Thank you a lot guys.
>> Eugène NG
>>
>>
>> 2012/5/20 Eugène Ngontang <sympav...@gmail.com>
>>
>>> Yes you're right Marc!
>>>
>>> It's just that I wanted to mention the fact my application is not only a
>>> web site accessible via a web browser only, but a client-server application
>>> with web-based GUI.
>>>
>>> But now things are clear, we're all now ok with the problematic and with
>>> your help and great responses, i noticed it's better to do all my system
>>> communication based on HTTP.
>>>
>>> I thank you for all your attention, all new ideas are still well come,
>>> and i'll let you follow up the evelution of the development.
>>>
>>> Thanks guys.
>>>
>>>
>>>
>>>
>>> 2012/5/20 Marc Aymerich <glicer...@gmail.com>
>>>
>>>> On Sat, May 19, 2012 at 8:01 PM, Eugène Ngontang <sympav...@gmail.com>
>>>> wrote:
>>>> > Hi Jani.
>>>> > I don't know why you say
>>>> >
>>>> > " 3) Are you now trying to figure out how to plug in Django in "Adming
>>>> > module/PC with GUI block"?"
>>>> >
>>>> > My admin module and the gui do not share anything. They are not on
>>>> the same
>>>> > pc.
>>>> > Gui is for displaying and admin for the page content management like
>>>> any web
>>>> > aplication works.
>>>> >
>>>> > I please us unot to build a myster arround this thread. The problem
>>>> was
>>>> > simple:
>>>>
>>>>
>>>> HI Eugène,
>>>> the problem was simple, but all we have misunderstood you because
>>>> usually the term GUI is used to refer "desktop application" rather
>>>> than a web page, which seems to be the case.
>>>>
>>>> br
>>>> --
>>>> Marc
>>>>
>>>> --
>>>> 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 email to
>>>> django-users+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/django-users?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> ngont...@epitech.net
>>> sympav...@gmail.com
>>> ------------------------------------------------------------
>>> *Aux hommes il faut un chef, et au** chef il faut des hommes!*
>>>
>>>
>>
>>
>> --
>> ngont...@epitech.net
>> sympav...@gmail.com
>> ------------------------------------------------------------
>> *Aux hommes il faut un chef, et au*
>> * chef il faut des hommes!
>> L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!
>> *
>>
>>
>
>
> --
> ngont...@epitech.net
> sympav...@gmail.com
> ------------------------------------------------------------
> *Aux hommes il faut un chef, et au** chef il faut des hommes!
> L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!
> *
>
>


-- 
ngont...@epitech.net
sympav...@gmail.com
------------------------------------------------------------
*Aux hommes il faut un chef, et au** chef il faut des hommes!
L'habit ne fait pas le moine, mais lorsqu'on te voit on te juge!
*

-- 
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 email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to