Re: Inserting literal % sign in QuerySet.extra()

2015-03-27 Thread Tim Graham
This is fixed in Django 1.8. See the fifth item in 
https://docs.djangoproject.com/en/dev/releases/1.8/#models.

On Friday, March 27, 2015 at 5:38:15 PM UTC-4, Gergely Polonkai wrote:
>
> Hello,
>
> I’d like to execute the following code:
>
> Booking.objects.filter(start_ts__isnull = False, end_ts__isnull = 
> False).extra(select = {'amount': "strftime('%s', end_ts) - strftime('%s', 
> start_ts)"})
>
> However, in the shell, I get the following error:
>
> Traceback (most recent call last): File "", line 1, in  
> File 
> "/home/polesz/Projects/duckbook/venv/lib/python3.4/site-packages/django/db/models/query.py",
>  
> line 835, in extra clone.query.add_extra(select, select_params, where, 
> params, tables, order_by) File 
> "/home/polesz/Projects/duckbook/venv/lib/python3.4/site-packages/django/db/models/sql/query.py",
>  
> line 1744, in add_extra entry_params.append(next(param_iter)) StopIteration
>
> I have tried doubling the percent signs (%%s) and escaping them with a 
> backslash (\%s), but neither helped. I also looked at this answer 
> [1], but that solution 
> doesn’t work with QuerySet.extra() (or I just miss the point).
>
> What is the correct way to solve this?
>
> I also tried to use select_params like this:
>
> Booking.objects.filter(start_ts__isnull = False, end_ts__isnull = 
> False).extra(select = {'amount': "strftime('%s', end_ts) - strftime(%s, 
> start_ts)"}, select_params = ['%s', '%s'])
>
> but regardless the usage of quote signs, the resulting query has \'%s\', 
> which gives an SQL error, of course.
>
> Best,
> Gergely
>
> [1] http://stackoverflow.com/a/18143147/1305139
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fa509ee1-6bb2-43c8-a1a1-e12ad70a123f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: QueryDict and its .dict() method - why does it do that?

2015-03-27 Thread Gabriel Pugliese
Thanks for kind answers guys.

Best Regards

On Fri, Mar 27, 2015, 5:31 PM Simon Charette  wrote:

> Hi Gabriel,
>
> One thing I dislike about how PHP/Rail deal with this is the fact they
> expose an easy way to shoot yourself in the foot.
>
> e.g. PHP
>
> Your code expects $_GET['foo'] to be an array() but the querystring is
> missing the trailing "[]" (?foo=bar) and crash. This also open a door for
> subtle attack vectors, let's not forget that those implementation assumes a
> parameter to be a collection or not based on user submitted data.
>
> I strongly prefer how Django forces you to explicitly declare you're
> expecting to retrieve a collection from a specific parameter.
>
> Simon
>
>
> Le vendredi 27 mars 2015 16:10:05 UTC-4, Gabriel Pugliese a écrit :
>>
>> Hi Carl,
>>
>> I perfectly understand what you are saying. It was very clear and
>> informative, but do not agree with the design chosen here. Below is just an
>> opinion and you do not have to agree with it:
>>
>> My buddies have given PHP and Rails examples, but there are other
>> frameworks from other languages that do that the same way. I mean, what's
>> the advantage here doing differently from others?
>> And I don't agree it follows KISS if I need to re-iterate on the result
>> again to get a dict from it (one clear example usage is destructuring as
>> named function parameters).
>>
>> Thanks again!
>>
>> On Thursday, March 26, 2015 at 2:52:48 PM UTC-3, Gabriel Pugliese wrote:
>>>
>>> This gist is self informative - some information from list is lost:
>>> https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c
>>>
>>> Some of my buddies have pasted Rails(Rack) and PHP conversion right
>>> below. Is that something I am missing? Does it have to do with laziness?
>>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/m3U7gfhWs2g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/28c33760-d9cf-4966-a249-aa1ab607909d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADqmskvsuBbeZa5NKHguwni9jsN2EnPH2JAzOMmx81wOaa%2BZ%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Inserting literal % sign in QuerySet.extra()

2015-03-27 Thread Gergely Polonkai
Hello,

I’d like to execute the following code:

Booking.objects.filter(start_ts__isnull = False, end_ts__isnull =
False).extra(select = {'amount': "strftime('%s', end_ts) - strftime('%s',
start_ts)"})

However, in the shell, I get the following error:

Traceback (most recent call last): File "", line 1, in 
File
"/home/polesz/Projects/duckbook/venv/lib/python3.4/site-packages/django/db/models/query.py",
line 835, in extra clone.query.add_extra(select, select_params, where,
params, tables, order_by) File
"/home/polesz/Projects/duckbook/venv/lib/python3.4/site-packages/django/db/models/sql/query.py",
line 1744, in add_extra entry_params.append(next(param_iter)) StopIteration

I have tried doubling the percent signs (%%s) and escaping them with a
backslash (\%s), but neither helped. I also looked at this answer
[1], but that solution doesn’t
work with QuerySet.extra() (or I just miss the point).

What is the correct way to solve this?

I also tried to use select_params like this:

Booking.objects.filter(start_ts__isnull = False, end_ts__isnull =
False).extra(select = {'amount': "strftime('%s', end_ts) - strftime(%s,
start_ts)"}, select_params = ['%s', '%s'])

but regardless the usage of quote signs, the resulting query has \'%s\',
which gives an SQL error, of course.

Best,
Gergely

[1] http://stackoverflow.com/a/18143147/1305139

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBULm5dPUvYc4Me-yNqsC%3DgS1grpa4Q%2BMVtPnHVEOCrzfcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: QueryDict and its .dict() method - why does it do that?

2015-03-27 Thread Simon Charette
Hi Gabriel,

One thing I dislike about how PHP/Rail deal with this is the fact they 
expose an easy way to shoot yourself in the foot.

e.g. PHP

Your code expects $_GET['foo'] to be an array() but the querystring is 
missing the trailing "[]" (?foo=bar) and crash. This also open a door for 
subtle attack vectors, let's not forget that those implementation assumes a 
parameter to be a collection or not based on user submitted data.

I strongly prefer how Django forces you to explicitly declare you're 
expecting to retrieve a collection from a specific parameter.

Simon

Le vendredi 27 mars 2015 16:10:05 UTC-4, Gabriel Pugliese a écrit :
>
> Hi Carl,
>
> I perfectly understand what you are saying. It was very clear and 
> informative, but do not agree with the design chosen here. Below is just an 
> opinion and you do not have to agree with it:
>
> My buddies have given PHP and Rails examples, but there are other 
> frameworks from other languages that do that the same way. I mean, what's 
> the advantage here doing differently from others?
> And I don't agree it follows KISS if I need to re-iterate on the result 
> again to get a dict from it (one clear example usage is destructuring as 
> named function parameters).
>
> Thanks again!
>
> On Thursday, March 26, 2015 at 2:52:48 PM UTC-3, Gabriel Pugliese wrote:
>>
>> This gist is self informative - some information from list is lost: 
>> https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c
>>
>> Some of my buddies have pasted Rails(Rack) and PHP conversion right 
>> below. Is that something I am missing? Does it have to do with laziness?
>>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28c33760-d9cf-4966-a249-aa1ab607909d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: QueryDict and its .dict() method - why does it do that?

2015-03-27 Thread Carl Meyer
Hi Gabriel,

On 03/27/2015 02:10 PM, Gabriel Pugliese wrote:
> I perfectly understand what you are saying. It was very clear and
> informative, but do not agree with the design chosen here. Below is just
> an opinion and you do not have to agree with it:

That's good :-) I probably won't continue with the design discussion
past this email, because I don't think we will reach a conclusion which
convinces the Django core team to change the design.

> My buddies have given PHP and Rails examples, but there are other
> frameworks from other languages that do that the same way.

I'm not personally aware of them, but I believe you. If this behavior
ever becomes part of an accepted RFC, I'm sure Django will implement it
in core :-)

> I mean,
> what's the advantage here doing differently from others?

I already tried to explain that: simple, predictable behavior that
exposes the underlying querystring data directly to the user, with no
munging of values which might be unexpected by some users.

Django provides the simple, predictable basic behavior. If you want this
extended special behavior, it's easy to implement it on top of what
Django provides.

> And I don't agree it follows KISS if I need to re-iterate on the result
> again to get a dict from it (one clear example usage is destructuring as
> named function parameters).

If you just want a dict, you don't need to iterate, you can just use the
.dict() method (or other options already explained earlier in this thread).

If you want a dict interpretation of the querystring *that handles keys
with brackets in their names in a special way*, then yes, you have to
implement that yourself. It wouldn't be hard to implement, and then that
code could be shared by all who want it.

Carl

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5515BB4F.3010502%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: Django TCP socket communication

2015-03-27 Thread Bill Freeman
There is a sense in which what you are describing, for the Django side, is
what a webserver, including one involving Django, ordinarily does.

The only requirement the web server makes (and some can get around it with
work) is that the data sent over the socket, at least from the client
(microcontroller) to the server be formatted as HTTP.  That's not a big
deal to do.  It could consist of a canned (or nearly so, if the length of
your data varies) header in front of what you actually want to send.

The format of the data in the reply is potentially even more flexible.

Particularly if the connection is closed after each round trip, that's very
vanilla web serving.

And if you can see your way to doing it as an HTTP request/response pair,
that will significantly reduce your need to code at a low level on the
server side.

As to what libraries you use on the microcontroller side, that depends on
what microcontroller, and what software it is running.  (With Linux on a
Raspberry Pi, this is a trivial Python program.  It is probably tougher on
a Teensy.)

On Fri, Mar 27, 2015 at 3:03 PM, Bobby  wrote:

> I am new to TCP socket programming. I have a django based server
> communicating with a microcontroller. Now, I want to implement TCP based
> socket on the server side in order to communicate with the TCP socket on
> the microcontroller. Can anyone give me an idea on how to do this ? What
> libraries should I use on my django server The microprocessor basically
> opens the socket every 5 seconds and sends a notification to the server. I
> on the server side should be able to read this and pump data back to the
> microprocessor using this socket which was opened by the microprocessor.
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5ea5bf85-0163-40cf-a4da-ec9edb27f3ac%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0skk4OL_Ofai%2Bwwd%3DhmGWWu6ZcfCmcxjOODjJL8FdS3%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: QueryDict and its .dict() method - why does it do that?

2015-03-27 Thread Gabriel Pugliese
Hi Carl,

I perfectly understand what you are saying. It was very clear and 
informative, but do not agree with the design chosen here. Below is just an 
opinion and you do not have to agree with it:

My buddies have given PHP and Rails examples, but there are other 
frameworks from other languages that do that the same way. I mean, what's 
the advantage here doing differently from others?
And I don't agree it follows KISS if I need to re-iterate on the result 
again to get a dict from it (one clear example usage is destructuring as 
named function parameters).

Thanks again!

On Thursday, March 26, 2015 at 2:52:48 PM UTC-3, Gabriel Pugliese wrote:
>
> This gist is self informative - some information from list is lost: 
> https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c
>
> Some of my buddies have pasted Rails(Rack) and PHP conversion right below. 
> Is that something I am missing? Does it have to do with laziness?
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/62854fcb-b139-4fa0-b10d-e629beb6d7ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Manage.py not found when deploying using chef (application_python cookbook)

2015-03-27 Thread Paul
I'm trying to deploy a django application on ec2 using chef. I followed 
blogs that got me to the point where the application(_python) cookbook has 
setup a clone of the repo to shared-copy and the chef client invokes the 
first command to syncdb. Then however a problem occurs that is easy to 
explain: manage.py cannot be found and the reason is because manage.py is 
not in the tip of the repo, it is in fact two levels lower.

I'm wondering what the best approach is to solve this;
- Can i change the cwd that the application cookbook uses?
- Symlink manage.py?
- Wrap manage somehow?

Thanks for any tips,
Paul Bormans

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2ba07b14-8a8f-4e3c-a261-aad1015da932%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django TCP Socket Communication

2015-03-27 Thread François Schiettecatte
Have you looked at the ‘socket’ python library ?

François

> On Mar 27, 2015, at 3:05 PM, bobdxcool  wrote:
> 
> I am new to TCP socket programming. I have a django based server
> communicating with a microcontroller. Now, I want to implement TCP based
> socket on the server side in order to communicate with the TCP socket on the
> microcontroller. Can anyone give me an idea on how to do this ? What
> libraries should I use on my django server The microprocessor basically
> opens the socket every 5 seconds and sends a notification to the server. I
> on the server side should be able to read this and pump data back to the
> microprocessor using this socket which was opened by the microprocessor.
> 
> 
> 
> --
> View this message in context: 
> http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792.html
> Sent from the django-users mailing list archive at Nabble.com.
> 
> -- 
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/1427483125637-5090792.post%40n6.nabble.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/DAE16363-2EEE-4E0F-A230-A31BB270E2F9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: QueryDict and its .dict() method - why does it do that?

2015-03-27 Thread Carl Meyer
Hi Gabriel,

On 03/27/2015 01:34 PM, Gabriel Pugliese wrote:
> @Masklinn
> That input is from jQuery's default serializer. It sends the data with
> contentType 'application/x-www-form-urlencoded; charset=UTF-8'. I just
> need to pass a data parameter with my JS Object (JSON) and it does the
> magic.

Yes, jQuery has chosen to adopt the same non-standard that Rails and PHP
use for smuggling nested lists and objects through a flat querystring.

> I understand I can use .getlist() or any other non-optimal solution.

request.GET.getlist('key') is the correct solution in Django for getting
a list of values from a querystring.

> I
> also understand what's going on about keys here (that's why I asked
> about laziness nature of QueryDict).

I don't understand what you think is lazy about a QueryDict, or how that
would be related to this issue. QueryDicts are not lazy; they parse the
querystring immediately on instantiation.

> But following DRY, KISS and other
> philosophies, couldn't Django do the same as other frameworks assuming
> it's widely adopted that way? What is the advantage of doing things so
> differently about that?

Django's philosophy here follows KISS. We give you the querystring in a
parsed format that allows you to easily get the data out of it by the
actual key names found in the querystring. We don't assume that you are
using jQuery on the client side, and we don't add any magical
non-standard features to smuggle nested objects through the querystring.
Such behavior might "do the expected thing" for some new users of
Django, at the expense of being very confusing to other new users of
Django, who understand HTTP and HTML but haven't been exposed to the
jQuery/Rails/PHP behavior.

> Why should I need to implement a lib that re-iterates over the same
> string that QueryDict already parses

You don't need to go back to the raw querystring. It would not be hard
to implement a small function that would take a QueryDict, iterate over
it and interpret it in the jQuery/Rails/PHP style, and return a
dictionary. I'd guess that someone may have already done this, though
I'm not sure what terms I'd use to search for it. If nobody has, then
you could be the first! Put it on PyPI, advertise it, and see what kind
of demand there is.

> to achieve the result that is
> expected to everyone that is new to Django?

I am a counter-example to your assertion that the Rails/PHP/jQuery
behavior is "expected to everyone that is new to Django." I had never
heard of the Rails/PHP/jQuery behavior when I was new to Django, and
Django's handling made perfect sense to me. The first time I ran across
jQuery's behavior, I was very confused.

> Anyway, thanks for the clear answer and information. And sorry about any
> grammar errors, English is not my first language.

No problem. I hope my answer was clear and informative.

Carl

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5515B49F.3010603%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Django TCP Socket Communication

2015-03-27 Thread bobdxcool
I am new to TCP socket programming. I have a django based server
communicating with a microcontroller. Now, I want to implement TCP based
socket on the server side in order to communicate with the TCP socket on the
microcontroller. Can anyone give me an idea on how to do this ? What
libraries should I use on my django server The microprocessor basically
opens the socket every 5 seconds and sends a notification to the server. I
on the server side should be able to read this and pump data back to the
microprocessor using this socket which was opened by the microprocessor.



--
View this message in context: 
http://python.6.x6.nabble.com/Django-TCP-Socket-Communication-tp5090792.html
Sent from the django-users mailing list archive at Nabble.com.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1427483125637-5090792.post%40n6.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: QueryDict and its .dict() method - why does it do that?

2015-03-27 Thread Gabriel Pugliese
@Daniel, oh really that Rails is not Django? Haven't noticed on my years of 
Python web development. Thanks!

@Masklinn
That input is from jQuery's default serializer. It sends the data with 
contentType 'application/x-www-form-urlencoded; charset=UTF-8'. I just need 
to pass a data parameter with my JS Object (JSON) and it does the magic.
I understand I can use .getlist() or any other non-optimal solution. I also 
understand what's going on about keys here (that's why I asked about 
laziness nature of QueryDict). But following DRY, KISS and other 
philosophies, couldn't Django do the same as other frameworks assuming it's 
widely adopted that way? What is the advantage of doing things so 
differently about that?
Why should I need to implement a lib that re-iterates over the same string 
that QueryDict already parses to achieve the result that is expected to 
everyone that is new to Django?

Anyway, thanks for the clear answer and information. And sorry about any 
grammar errors, English is not my first language.


On Thursday, March 26, 2015 at 2:52:48 PM UTC-3, Gabriel Pugliese wrote:
>
> This gist is self informative - some information from list is lost: 
> https://gist.github.com/gabrielhpugliese/640b69eefc5b7490a07c
>
> Some of my buddies have pasted Rails(Rack) and PHP conversion right below. 
> Is that something I am missing? Does it have to do with laziness?
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/800e3c5b-7f5d-457f-957d-9a23d6f83105%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django TCP socket communication

2015-03-27 Thread Bobby
I am new to TCP socket programming. I have a django based server 
communicating with a microcontroller. Now, I want to implement TCP based 
socket on the server side in order to communicate with the TCP socket on 
the microcontroller. Can anyone give me an idea on how to do this ? What 
libraries should I use on my django server The microprocessor basically 
opens the socket every 5 seconds and sends a notification to the server. I 
on the server side should be able to read this and pump data back to the 
microprocessor using this socket which was opened by the microprocessor.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ea5bf85-0163-40cf-a4da-ec9edb27f3ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread Stephen J. Butler
On Fri, Mar 27, 2015 at 10:30 AM, Thomas Güttler  wrote:
> You have an instance method to render one row of a search result (a custom
> paginator).
>
> One column of this row displays a link. Some users are allowed to follow the
> link,
> some are not. You need to check the (row level) permissions before
> displaying it as
> link or as plain text.
>
> The render_row() method is deep inside OOP python code. The method needs to
> know which user is logged in to return the correct result.
>
> Of course I could always return a hyperlink. And users which don't have
> the permission will see the permission denied page. But this is not user
> friendly.

How important is it that the legacy code retain the same structure?
You have the choice here to either break Django or refactor your
legacy code. Doing the refactor is what will cause you the least
headaches as you move forward (and as Django moves forward).

What you really need to do here is move render_row into a template
include or a template tag (which gets the template context, which
includes user). That's the proper place for it IMHO in the MVC
paradigm, which is the Django way.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD4ANxVjS3cHLn8yTpZGoKsM4Yf6DpXvxPOPop86VbUk1xs9uQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Textarea taking htnml tags

2015-03-27 Thread aRkadeFR

Hey,

He doubled post. A thread already exists about this called:
"textarea showing image instead of code"


On 03/27/2015 03:54 PM, Filipe Ximenes wrote:

Can you send us the code of the view and the template of this form?

On Fri, Mar 27, 2015 at 3:27 AM, > wrote:


Hie to all,
In one of my template i am using text area. The issue is that when
i write html tags with some image link using img tag, when i am
saving this i am getting image on the desription field.

Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest
-- 
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 django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout.




--

*Filipe Ximenes
*+55 (81) 8245-9204*
**Vinta Software Studio
*http://www.vinta.com.br

--
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 django-users@googlegroups.com 
.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA-QWB3OPdmK11XzPFf--2MBT6evTDu-RuRrPArem1PbZT2FmA%40mail.gmail.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55159AA1.9070605%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread Cal Leeming
Hmm this all sounds quite dirty :/

However if you absolutely want to have a global object, you could try
something like [1], although I don't recommend it at all. There are
some situations where your modelling needs request introspection, for
example row level auditing, but these are very specific situations and
most of the time it's just outright abuse/bad code.

If you're using template tags and performing rendering within Django,
then you are already doing things the wrong way [2], unless your
application has a heavy SEO requirement. Sadly this is where the
weaknesses of Django, and indeed many other web frameworks, start to
appear. As such, you probably shouldn't be worrying too much about the
"passing state around being ugly", because the code is already
architecturally flawed and inherently ugly to start with. Also,
abusing globals starts to get real ugly when you introduce co-routines
and overall makes for much less readable code (imho).

Cal

[1]: http://nedbatchelder.com/blog/201008/global_django_requests.html
[2]: http://en.wikipedia.org/wiki/Single-page_application

On Fri, Mar 27, 2015 at 3:30 PM, Thomas Güttler  wrote:
>
>
> Am 27.03.2015 um 15:49 schrieb Cal Leeming:
>>
>> There is a reason that state is passed around from method to method,
>> rather than being stored as a global, because this is the correct way
>> to do things.
>
>
> Is a threadlocal global state part of the correct way, or is it "evil"?
>
>> However, it sounds like the architectural design of your code is
>> flawed, as throwing around the request object indicates that you don't
>> have modularity.
>
>
> It is legacy code. Complaining does help your soul for a short time. But
> after
> that moment it is the same code :-)
>
>> If you only need the user object, then why not
>> replace all instances of "request=request" with "user=request.user".
>
>
> Yes, that could be done. But it is not much better. I am still searching
> a for a "third" way.
>
>> The alternative is to have some magic threadlocals which stores the
>> current user, but this is a particularly disgusting way of writing
>> code and I could not recommend it at all.
>>
>> It would be better if you could explain a little more about how/where
>> this request object is being passed around, then we'd be in a better
>> position to give you the correct advice.
>
>
> Example:
>
> You have an instance method to render one row of a search result (a custom
> paginator).
>
> One column of this row displays a link. Some users are allowed to follow the
> link,
> some are not. You need to check the (row level) permissions before
> displaying it as
> link or as plain text.
>
> The render_row() method is deep inside OOP python code. The method needs to
> know which user is logged in to return the correct result.
>
> Of course I could always return a hyperlink. And users which don't have
> the permission will see the permission denied page. But this is not user
> friendly.
>
> Can you understand this use case?
>
> Regards,
>   Thomas Güttler
>
>
> --
> Thomas Guettler, http://www.tbz-pariv.de/
> Bernsdorfer Str. 210-212, 09126 Chemnitz
> TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
> Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543
>
> --
> Thomas Güttler
> http://thomas-guettler.de/
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/55157785.20505%40tbz-pariv.de.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFJPnp2hY0W4rvRFmxuQKcnh037r68uN2AcWaXxjRke%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread Thomas Güttler



Am 27.03.2015 um 15:49 schrieb Cal Leeming:

There is a reason that state is passed around from method to method,
rather than being stored as a global, because this is the correct way
to do things.


Is a threadlocal global state part of the correct way, or is it "evil"?


However, it sounds like the architectural design of your code is
flawed, as throwing around the request object indicates that you don't
have modularity.


It is legacy code. Complaining does help your soul for a short time. But after
that moment it is the same code :-)


If you only need the user object, then why not
replace all instances of "request=request" with "user=request.user".


Yes, that could be done. But it is not much better. I am still searching
a for a "third" way.


The alternative is to have some magic threadlocals which stores the
current user, but this is a particularly disgusting way of writing
code and I could not recommend it at all.

It would be better if you could explain a little more about how/where
this request object is being passed around, then we'd be in a better
position to give you the correct advice.


Example:

You have an instance method to render one row of a search result (a custom 
paginator).

One column of this row displays a link. Some users are allowed to follow the 
link,
some are not. You need to check the (row level) permissions before displaying 
it as
link or as plain text.

The render_row() method is deep inside OOP python code. The method needs to
know which user is logged in to return the correct result.

Of course I could always return a hyperlink. And users which don't have
the permission will see the permission denied page. But this is not user 
friendly.

Can you understand this use case?

Regards,
  Thomas Güttler


--
Thomas Guettler, http://www.tbz-pariv.de/
Bernsdorfer Str. 210-212, 09126 Chemnitz
TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

--
Thomas Güttler
http://thomas-guettler.de/

--
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55157785.20505%40tbz-pariv.de.
For more options, visit https://groups.google.com/d/optout.


Re: Performance of file-based sessions vs database-backed sessions

2015-03-27 Thread Filipe Ximenes
>From what I understand, using file based sessions will work with no
problems in production environment. But, you will have a problem in case
you need to horizontally scale (have multiple machines serving your app)
your system. In this situation, since files from one machine wont be able
to access from others, the session engine will not always work.
I'm not sure about performance [in a single machine] compared to database
session though.

On Fri, Mar 27, 2015 at 12:14 PM, David Riddle  wrote:

> I am using Django 1.7, and I have read the documentation on
> the SESSION_ENGINE setting. It is not clear to me what are the advantages
> and disadvantages of using file-based sessions. Do file-based sessions have
> better or worse performance than database-backed sessions? Are file-based
> sessions appropriate for production environments with large amounts of
> traffic?
>
> Thank you,
>
> David Riddle
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABX-mpWYMZ9GQqTduk4RoJfagPAbQ9%3DnChkcu0znqQxtxMBoiQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA-QWB2Y8YKcZ47M1s%3Dkv1%3Dw2_HHGYEA-tu3xGchS%3Do6gnow%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Textarea taking htnml tags

2015-03-27 Thread Gabriel - Iulian Dumbrava
Have you checked if the html tags actually end up in the database?

If yes, then the problem is either in the view or in the template (like not 
using the safe filter).

vineri, 27 martie 2015, 08:27:15 UTC+2, akash...@ranosys.com a scris:
>
> Hie to all,
> In one of my template i am using text area. The issue is that when i write 
> html tags with some image link using img tag, when i am saving this i am 
> getting image on the desription field.
>
> Actual-Image is comming
>
> Expected-I want HTML code to be displayed in the discription.
>
> Please suggest
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a76ee5e3-3fad-46fd-91ad-d2d964e5839b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Performance of file-based sessions vs database-backed sessions

2015-03-27 Thread David Riddle
I am using Django 1.7, and I have read the documentation on
the SESSION_ENGINE setting. It is not clear to me what are the advantages
and disadvantages of using file-based sessions. Do file-based sessions have
better or worse performance than database-backed sessions? Are file-based
sessions appropriate for production environments with large amounts of
traffic?

Thank you,

David Riddle

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABX-mpWYMZ9GQqTduk4RoJfagPAbQ9%3DnChkcu0znqQxtxMBoiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Search user from Database

2015-03-27 Thread Filipe Ximenes
Just checking: when you say you are adding users using

Group.users.add(user)
​
in this case `Group` is an instance of the Group model and NOT the actual
model, correct?

if so, you can make a query using the same instance, looking for the user:

user = Group.user.filter(user).first()
if user:
print('user exists in this group')
else:
print('user does not exists in this group')

​

On Thu, Mar 26, 2015 at 11:24 PM, nobody  wrote:

> Hi,
>
> Sorry for asking a new B question. I have following code in a module.py:
>
>
> class Group(models.Model):
> ..
>  users = models.ManyToManyField(User, blank=True, null=True)
> .
>
> I can add user or delete user by calling Group.users.add(user) or
> Group.users.remove(user), but how can I check if the user has already in
> the database?
>
> Thank you.
>
>  -j
>
>  --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/017b0bc2-ff5c-4a42-936d-00da2b246cbf%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA-QWB19Dsbi7cC1XF8nSVvNEkbQm7_gQq84bXZDCTxj%3DBcVzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Textarea taking htnml tags

2015-03-27 Thread Filipe Ximenes
Can you send us the code of the view and the template of this form?

On Fri, Mar 27, 2015 at 3:27 AM,  wrote:

> Hie to all,
> In one of my template i am using text area. The issue is that when i write
> html tags with some image link using img tag, when i am saving this i am
> getting image on the desription field.
>
> Actual-Image is comming
>
> Expected-I want HTML code to be displayed in the discription.
>
> Please suggest
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA-QWB3OPdmK11XzPFf--2MBT6evTDu-RuRrPArem1PbZT2FmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread Cal Leeming
There is a reason that state is passed around from method to method,
rather than being stored as a global, because this is the correct way
to do things.

However, it sounds like the architectural design of your code is
flawed, as throwing around the request object indicates that you don't
have modularity. If you only need the user object, then why not
replace all instances of "request=request" with "user=request.user".
The alternative is to have some magic threadlocals which stores the
current user, but this is a particularly disgusting way of writing
code and I could not recommend it at all.

It would be better if you could explain a little more about how/where
this request object is being passed around, then we'd be in a better
position to give you the correct advice.

Cal


On Thu, Mar 26, 2015 at 10:38 AM, guettli  wrote:
> I have a large legacy application which passes around the request to nearly
> every method.
>
> Reading this source is no fun.
>
> In about 95% of all cases "request" is not used, but "request.user" is
> needed for
> permission checking.
>
> Example: there is a drop down box with the list of possible actions the user
> can perform now.
> The list of actions is filtered according to the logged in request.user.
>
> I want to get rid of the ugly passing around "request" from method to
> method.
>
> I have some ideas in mind, but won't post them today. I am afraid that if I
> would,
> the discussion would be only pro/contra my solution. But I guess there is
> a third way :-)
>
>
> --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fc2c1d65-fa3d-461b-9846-3802cf153e15%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHKQagFg6LZ18gRKWxccPiv0VkMsA8pKFt%2BF%2BzgiPx5J-65BqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Strange deployment problem

2015-03-27 Thread Miloš Kozák
 Hi, 

I have rather strange problem with already deployed application. I added 
some new ACL rules which I need to write to the database, so I wanted to 
call syncdb --all. However, using the command: 

./manage.py syncdb 

or 

./manage.py syncdb --settings=intranet.settings.demo 

I get this: 
Syncing... 
Traceback (most recent call last): 
  File "./manage.py", line 10, in  
execute_from_command_line(sys.argv) 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/core/management/*__init__.py",
 
line 399, in execute_from_command_line 
utility.execute() 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/core/management/*__init__.py",
 
line 392, in execute 
self.fetch_command(subcommand).run_from_argv(self.argv) 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 242, in run_from_argv 
self.execute(*args, **options.__dict__) 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 285, in execute 
output = self.handle(*args, **options) 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 415, in handle 
return self.handle_noargs(**options) 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
 
line 89, in handle_noargs 
db.connection_init() 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/south/db/mysql.py", 
line 183, in connection_init 
cursor = self._get_connection().cursor() 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/backends/*__init__.py",
 
line 162, in cursor 
cursor = util.CursorWrapper(self._cursor(), self) 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/backends/*__init__.py",
 
line 132, in _cursor 
self.ensure_connection() 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/backends/*__init__.py",
 
line 127, in ensure_connection 
self.connect() 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/utils.py", 
line 99, in __exit__ 
six.reraise(dj_exc_type, dj_exc_value, traceback) 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/backends/*__init__.py",
 
line 127, in ensure_connection 
self.connect() 
  File "
*/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/backends/*__init__.py",
 
line 115, in connect 
self.connection = self.get_new_connection(conn_params) 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
 
line 435, in get_new_connection 
conn = Database.connect(**conn_params) 
  File 
"*/var/www/demo/libs/local/lib/python2.7/site-packages/MySQLdb/*__init__.py", 
line 81, in Connect 
return Connection(*args, **kwargs) 
  File 
"/var/www/demo/libs/local/lib/python2.7/site-packages/MySQLdb/connections.py", 
line 193, in __init__ 
super(Connection, self).__init__(*args, **kwargs2) 
django.db.utils.OperationalError: (1045, "Access denied for user 
'root'@'localhost' (using password: YES)") 

As it is seems straightforward problem with wrong credentials, it is more 
complicated! I use special configuration file which is stored in 
intranet/settings/demo.py, and here I have: 

DATABASES = { 
'default': { 
 'ENGINE': "django.db.backends.mysql", 
 "NAME": "demo", 
 "USERNAME": "demo", 
 "PASSWORD": "X", 
 "HOST": "localhost" 
} 
} 

which means I do not use root with empty password. 


I have Django 1.6.11, Debian stable which is up-to-date. 


The strange thing is if I try different configurations at my desktop with 
Debian Jessy these alternative configuration files (profiles) work 
perfectly! 

Also, if I try MobaXterm syncdb works just fine. Do you think it could be 
related to some system variables? I have got no clue! 


I will be glad for any hint! 

Thank you, Milos 

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/77ef1b04-720f-4efc-9159-593e9ea3476d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread Anderson Resende
Other way is use sessions!
Django provide session midleware.
You can get the session dict out of the view!


Sorry my english, I am a Brazilian guy! 

>
>
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/892e4ff2-a85b-49a2-a13d-449319299f1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread Anderson Resende

Maybe a global state? Yes! 

https://docs.djangoproject.com/en/1.7/topics/http/middleware/#init

I never did that, but you can try!



-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6481f72f-aac4-4127-b496-b85c4dc1d987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Adding admin access for external users

2015-03-27 Thread Murthy Sandeep
Hi

I am setting up an admin user account to manage my Django app on
my local machine, but would it be possible for me to also give admin
access to external users using their own machines?  My machine is
not part of a LAN/WAN, just standalone, but I am thinking that to enable
this I should provide the admin URL to another external user and then
allow remote login access for them.


-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/E934EE83-6B33-4307-BF61-506A364698AB%40sandeepmurthy.is.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Problem at server startup

2015-03-27 Thread Sebastian Andres Guerra Montecino
Hi everyone, i'm just started on django... and i have a problem :(. I 
install django on windows (with Setuptools and PIP, according to the 
documentation), create a new project, use migrate but throws me a mistake:

C:\Users\Kompressor\Documents\lalolando>python manage.py runserver 8080
Performing system checks...


System check identified no issues (0 silenced).
March 27, 2015 - 09:48:37
Django version 1.7.7, using settings 'lalolando.settings'
Starting development server at http://127.0.0.1:8080/
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by .wrapper 
at 0x03678390>
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\django\utils\autoreload.py", line 222, 
in wrapper
fn(*args, **kwargs)
  File 
"C:\Python34\lib\site-packages\django\core\management\commands\runserver.py"
, line 134, in inner_run
ipv6=self.use_ipv6, threading=threading)
  File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", 
line 176, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
  File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", 
line 117, in __init__
super(WSGIServer, self).__init__(*args, **kwargs)
  File "C:\Python34\lib\socketserver.py", line 430, in __init__
self.server_bind()
  File "C:\Python34\lib\site-packages\django\core\servers\basehttp.py", 
line 121, in server_bind
super(WSGIServer, self).server_bind()
  File "C:\Python34\lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
  File "C:\Python34\lib\http\server.py", line 135, in server_bind
self.server_name = socket.getfqdn(host)
  File "C:\Python34\lib\socket.py", line 463, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 7: 
invalid continuation byte

Please, someone can help me?? :)
thanks

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbfc6422-d1c3-43af-8cb1-625388c5c03f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: textarea showing image instead of code

2015-03-27 Thread aRkadeFR

What is db.TextProperty!? Is it Django?
Where the "result" variable comes from?

please read:
https://docs.djangoproject.com/en/1.7/ref/models/


On 03/27/2015 10:20 AM, Akash Patni wrote:

Hi This is my html

{% block content %}



  
src="/site_media/images/digital-assets-note-icon.png" alt="Notes" />

View Notes
See your notes details.
  
  

{% for i in result %}

 Note Title
 {{i.note_title}}



 Note
*{{i.note}*




 Beneficiaries
 
   {% if all_nominees %}
   {% for nominee in all_nominees %}
   {% if nominee.1 %}
 {{nominee.0.first_name}} {% if nominee.last_name 
%}{{nominee.last_name}}{% endif %} {% if nominee.0.is_charity 
%}(charity){% else %}(individual){% endif %}

 
   {% endif %}
   {% endfor %}
{% else %}
No beneficiaries at the moment.
{% endif %}
 




 Action
 
 href="/user/notes/edit?id={{i.key}}">Edit
 href="/user/notes/delete?id={{i.key}}" onclick="return 
deleteConfirmation();">Delete

 


  {% endfor %}

{% endblock %}

This is my model

class AssetNotes(db.Model):
user_id = db.ReferenceProperty(User)
written_on = db.DateProperty(verbose_name="Note Date")
note_title = db.StringProperty(verbose_name = "Note Title *")
note = db.TextProperty(verbose_name = "Note")
add_date = db.DateTimeProperty(verbose_name=None, auto_now_add=True)
update_date = db.DateTimeProperty(verbose_name=None, auto_now=True)
client_id = db.StringProperty(verbose_name = "Client ID", default="")
def __unicode__(self):
return self.note_title
I want to show only code but instead of that it is showing image in 
descrption field.


and the code contains image url.

On Fri, Mar 27, 2015 at 2:41 PM, aRkadeFR > wrote:


Hello,

You could provide us more information when asking for
help please. Your template and view code at least.

I guess your problem is in your HTML but to be sure, please
dump your information at the POST request to see what
is send. Then review your template. Maybe there's a "name"
attribute on the img tag?

Have a good one

On 03/27/2015 08:36 AM, akash.pa...@ranosys.com
 wrote:

Hie to all,
In one of my template i am using text area. The issue is that
when i write html tags with some image link using img tag, when i
am saving this i am getting image on the desription field.

Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest

-- 
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
django-users@googlegroups.com .
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com

.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to a topic in

the Google Groups "Django users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/django-users/6bheSzmXFGc/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/55151EC7.3090403%40arkade.info

.


For more options, visit https://groups.google.com/d/optout.




--
*Best Regards,*
Akash Patni
Software Engineer
*
*
*
**
ranosys 
facebook  	twitter 
 	linkedin 
 
googleplus  	


*Head Office: *
Oxley Bizhub, #06-48 | 73 Ubi Road 1 | Singapore - 408733
*Tel:* +65 66331556 | *HP: *+65 98573420

**

*
**

*Global Offices:*
San Francisco, USA | Jaipur, India | Bikaner, India

**
*

**
*
**
--
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 

Re: Global access to request.user

2015-03-27 Thread Daniel França
I don't understand how middlware or filter would help on those cases.
Why not only pass the variable where it's needed?
On Fri 27 Mar 2015 at 10:18 guettli  wrote:

>
>
> Am Donnerstag, 26. März 2015 15:52:07 UTC+1 schrieb Anderson Resende:
>>
>> You can use middlewares!!! It is a way...
>>
>>
>>
> I don't understand how middleware can help here.
>
> The only way I see is that the middleware updates a global variable for
> the data. In my case request.user.
>
> Anderson, is this what you meant?
>
> This would work. But a lot of people say that you should not use global
> variables 
>
> Regards,
>   Thomas Güttler
>
>  --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/30c13358-9be7-40fc-87c3-5419d31b4b13%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACPst9LrCABjwecJ3WjQFJRTHY%3Dq%2BMmyVEfLcHiMaHCkMGFaEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django project for multiple clients

2015-03-27 Thread Gabriel - Iulian Dumbrava
If your clients are using different subdomains, like client1.webapp.com, 
client2.webapp.com then you can have separate settings file per subdomain 
and completely isolate the client data, but still use the same virtualenv 
and codebase. You must also take care of the file upload/access because you 
also need to isolate it.

joi, 26 martie 2015, 18:23:38 UTC+2, Steven Nash a scris:
>
> We are design a DJango based application to be used my multiple clients.  
> Each client will have there own database but share the same code base.
>
> In the past, when I've done something like this, I have configure a 
> separate virtual host for each client.
>
> This time we are thinking about using URL routing to select the clients 
> database, and creating a small Django Webapp to allow an admin team to 
> setup new clients etc.
>
> I'd be interested to hear how others have tackled this, I have Googled 
> quite a bit on this topic.
>
> Steve
>

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0db98454-b9f4-4ed0-9924-e528d0b11174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: textarea showing image instead of code

2015-03-27 Thread Akash Patni
Hi This is my html

{% block content %}



  

View Notes
See your notes details.
  
  

{% for i in result %}

Note Title
{{i.note_title}}



Note
*{{i.note}*





Beneficiaries

{% if all_nominees %}
{% for nominee in all_nominees %}
{% if nominee.1 %}
{{nominee.0.first_name}} {% if nominee.last_name
%}{{nominee.last_name}}{% endif %} {% if nominee.0.is_charity %}(charity){%
else %}(individual){% endif %}

{% endif %}
{% endfor %}
{% else %}
No beneficiaries at the moment.
{% endif %}





Action

Edit
Delete



  {% endfor %}

{% endblock %}

This is my model

class AssetNotes(db.Model):
user_id = db.ReferenceProperty(User)
written_on = db.DateProperty(verbose_name="Note Date")
note_title = db.StringProperty(verbose_name = "Note Title *")
note = db.TextProperty(verbose_name = "Note")
add_date = db.DateTimeProperty(verbose_name=None, auto_now_add=True)
update_date = db.DateTimeProperty(verbose_name=None, auto_now=True)
client_id = db.StringProperty(verbose_name = "Client ID", default="")
def __unicode__(self):
return self.note_title
I want to show only code but instead of that it is showing image in
descrption field.

and the code contains image url.

On Fri, Mar 27, 2015 at 2:41 PM, aRkadeFR  wrote:

>  Hello,
>
> You could provide us more information when asking for
> help please. Your template and view code at least.
>
> I guess your problem is in your HTML but to be sure, please
> dump your information at the POST request to see what
> is send. Then review your template. Maybe there's a "name"
> attribute on the img tag?
>
> Have a good one
>
> On 03/27/2015 08:36 AM, akash.pa...@ranosys.com wrote:
>
> Hie to all,
> In one of my template i am using text area. The issue is that when i write
> html tags with some image link using img tag, when i am saving this i am
> getting image on the desription field.
>
> Actual-Image is comming
>
> Expected-I want HTML code to be displayed in the discription.
>
> Please suggest
>
>  --
> 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 django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/6bheSzmXFGc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/55151EC7.3090403%40arkade.info
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Best Regards,*
Akash Patni
Software Engineer




*[image: ranosys]   [image: facebook]
[image: twitter]
[image: linkedin]
[image:
googleplus]  Head Office: Oxley Bizhub,
#06-48 | 73 Ubi Road 1 | Singapore - 408733Tel: +65 66331556  |  HP: +65
98573420Global Offices:San Francisco, USA | Jaipur, India | Bikaner, India*

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANSMZiRzDaCqCJG-QF-t6Bk6ckKsk4fgZFcTq%3DbgVYNPVrHiMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread guettli


Am Donnerstag, 26. März 2015 15:52:07 UTC+1 schrieb Anderson Resende:
>
> You can use middlewares!!! It is a way...
>
>
>
I don't understand how middleware can help here.

The only way I see is that the middleware updates a global variable for the 
data. In my case request.user.

Anderson, is this what you meant?

This would work. But a lot of people say that you should not use global 
variables 

Regards,
  Thomas Güttler

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/30c13358-9be7-40fc-87c3-5419d31b4b13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When I mark to delete the formset, django requires complete all fields, he does not ignore the marked form to delete.

2015-03-27 Thread aRkadeFR

Thanks for the code paste.

You mean in your views, the formset.is_valid() returns False
and so does not delete your form tagged to delete?

I don't quite understand where exactly is the problem?


On 03/27/2015 12:17 AM, Neto wrote:
When I mark to delete the formset, django requires complete all 
fields, he does not ignore the marked form to delete. How do I solve 
this? I wanna that django delete the form marked or ignore him.


from  django.forms.formsets  import  formset_factory
>>>from  myapp.forms  import  ArticleForm
>>>ArticleFormSet  =  formset_factory(ArticleForm,  can_delete=True, min_num=1, 
extra=0)


 {{  formset.management_form  }}
 {%  for  form  in  formset  %}
 
 {{  form.title  }}
 {{  form.pub_date  }}
 {%  if  formset.can_delete  %}
 {{  form.DELETE  }}
 {%  endif  %}
 
 {%  endfor  %}

--
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 django-users@googlegroups.com 
.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7ecb3486-818c-4051-84e2-168b506b5c10%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55151F97.8020400%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


Re: textarea showing image instead of code

2015-03-27 Thread aRkadeFR

Hello,

You could provide us more information when asking for
help please. Your template and view code at least.

I guess your problem is in your HTML but to be sure, please
dump your information at the POST request to see what
is send. Then review your template. Maybe there's a "name"
attribute on the img tag?

Have a good one

On 03/27/2015 08:36 AM, akash.pa...@ranosys.com wrote:

Hie to all,
In one of my template i am using text area. The issue is that when i 
write html tags with some image link using img tag, when i am saving 
this i am getting image on the desription field.


Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest

--
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 django-users@googlegroups.com 
.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55151EC7.3090403%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


Re: Global access to request.user

2015-03-27 Thread aRkadeFR

I agree with Anderson, this is one solution, even
though I don't know if it's a good way.

For example a middleware is used to add the user to
the request. You could do the same with the request
to a singleton instance and get it back then from your
form, view etc.? But be aware that some function should
work within the request cycle or without.

A filter or tag is only a way to process/render data inside
the templates. I don't see it as a solution.

On 03/26/2015 05:19 PM, Esau Rodriguez wrote:

I don't see how middleware could be used to avoid passing the user or
request parameter to the inner methods.

As this is part of the view, I'd probably write a custom filter or tag, I dunno.

Regards,
Esau.

On Thu, Mar 26, 2015 at 2:52 PM, Anderson Resende
 wrote:

You can use middlewares!!! It is a way...


--
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/2c55f576-7012-49a2-bd53-a8e5fdc4754a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.





--
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55151A6B.2030100%40arkade.info.
For more options, visit https://groups.google.com/d/optout.


textarea showing image instead of code

2015-03-27 Thread akash . patni
Hie to all,
In one of my template i am using text area. The issue is that when i write 
html tags with some image link using img tag, when i am saving this i am 
getting image on the desription field.

Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/597ca45f-a1d9-43a4-a77b-a4ffc29d1b69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Textarea taking htnml tags

2015-03-27 Thread akash . patni
Hie to all,
In one of my template i am using text area. The issue is that when i write 
html tags with some image link using img tag, when i am saving this i am 
getting image on the desription field.

Actual-Image is comming

Expected-I want HTML code to be displayed in the discription.

Please suggest

-- 
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 django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/32bb3e0a-1eb1-46d1-94fe-4135c7c916df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.