How TinyMCE don't displays Html tags to vistors

2011-09-20 Thread Tsung-Hsien
I've been done my admin interface with TinyMCE. However, aftering editing, I see words with HTML tags update to my website. What's a good way to solve this? Thank you! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Create socket server in django

2011-09-20 Thread Micke
Thank you for your quick reply! My socket server is ready, but I dont know where to import it in django so it starts when django starts? br Mikael On Sep 19, 11:38 pm, Andy McKay wrote: > You could write a Python process that starts up a Socket Server and

Re: How TinyMCE don't displays Html tags to vistors

2011-09-20 Thread Aljoša Mohorović
On Tue, Sep 20, 2011 at 8:18 AM, Tsung-Hsien wrote: > I've been done my admin interface with TinyMCE. However,  aftering > editing, I see words with HTML tags update to my website. > > What's a good way to solve this? you need to add "{{ tinymce_content|safe }}", docs:

Re: Uploading and viewing images problem

2011-09-20 Thread Praveen Krishna R
*Have you done something like this in your project urls.py* * * * urlpatterns += patterns('', * (r'^site_media/(?P.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}), ) So that you can enable serving the media from the development server ?! *my MEDIA_URL =

Re: Create socket server in django

2011-09-20 Thread Thomas Orozco
You just have to run your server as a daemon and use Django's setup_environment so you can use the ORM to interact with your Django DB. I can try and find the lines you need to do that if you can't find them. Le 20 sept. 2011 09:08, "Micke" a écrit : -- You received

Passing multiple arguments to custom template filter

2011-09-20 Thread skazhy
Hi all! I was trying to pass multiple arguments to a custom template filter (in the same way as, eg {{ myvar|pluralize:"y","ies" }} but it didn't work. I saw some old tickets and posts in here on this subject & there was no ready sollution to this. Is it possible now (in 1.3)? Maybe someone

Re: Passing multiple arguments to custom template filter

2011-09-20 Thread Tom Evans
On Tue, Sep 20, 2011 at 10:31 AM, skazhy wrote: > Hi all! > > I was trying to pass multiple arguments to a custom template filter > (in the same way as, eg {{ myvar|pluralize:"y","ies" }} but it didn't That's not how pluralize works, from the manual: You have {{

Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Jonas Geiregat
Hello, I have a UserProfile model: class UserProfile(FacebookProfileModel): user = models.ForeignKey(User, unique=True)

Re: Create socket server in django

2011-09-20 Thread Thorsten Sanders
import sys,os sys.path.append('/path/to/your/django_project') os.environ['DJANGO_SETTINGS_MODULE'] = 'your_settings_file' This works fine for a cronjob I created On 20.09.2011 10:48, Thomas Orozco wrote: You just have to run your server as a daemon and use Django's setup_environment so you

Re: Passing multiple arguments to custom template filter

2011-09-20 Thread skazhy
Thanks for your answer, somehow I overlooked the pluralize syntax. ;) On 20 sept., 12:53, Tom Evans wrote: > On Tue, Sep 20, 2011 at 10:31 AM, skazhy wrote: > > Hi all! > > > I was trying to pass multiple arguments to a custom template filter > > (in

Virtualenv and Django in Production

2011-09-20 Thread adrian s
Hi all, I've been using virtualenv as recommended in my development environments. I am now migrating a project which was not using virtualenv, to another server and now have the opportunity to use it in production. I've spent a while googling this subject and I'm not sure what the best practice

Re: Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Ilian Iliev
Hi, ModelForm should automatically create a dropdown list for your foreign key. If there is nor such drop-down created probably you are doing something wrong. -- eng. Ilian Iliev Web Software Developer Mobile: +359 88 66 08 400 Website: http://ilian.i-n-i.org On Tue, Sep 20, 2011 at 1:26 PM,

Re: Virtualenv and Django in Production

2011-09-20 Thread Preston Holmes
How you use a virtualenv in production depends on all the parts of your production stack. If you are using mod_wsgi, search mod_wsgi + virtualenv, gunicorn, etc You might also consider one of the new "platform-as-a-service" hosting options that basically solve this for you. -P On Sep 19, 10:55 

Re: Create socket server in django

2011-09-20 Thread Preston Holmes
On Sep 20, 12:07 am, Micke wrote: > Thank you for your quick reply! > > My socket server is ready, but I dont know where to import it in > django so it starts when django starts? You are going to run your socket server in a different python process than Django.

Virtualenv and Django in Production

2011-09-20 Thread Matt Schinckel
I use virtualenv in production. It means you can install python packages using pip without having root or sudo access on the server. You can also isolate installs, and use no-site-packages. I can't think of a reason not to use it. Matt. -- You received this message because you are subscribed

Re: Virtualenv and Django in Production

2011-09-20 Thread DrBloodmoney
On Tue, Sep 20, 2011 at 1:55 AM, adrian s wrote: > Hi all, I've been using virtualenv as recommended in my development > environments. > I am now migrating a project which was not using virtualenv, to another > server and now > have the opportunity to use it in production.

Re: Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Jonas Geiregat
> Hi, > > ModelForm should automatically create a dropdown list for your foreign key. > If there is nor such drop-down created probably you are doing something wrong. > I don't want the dropdown list I want the values of the foreinkey to be expaneded into fields For example I have user as

Re: Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Ilian Iliev
So you want to edit the User object through the ModelForm of the other model, or you just want to display it? -- eng. Ilian Iliev Web Software Developer Mobile: +359 88 66 08 400 Website: http://ilian.i-n-i.org On Tue, Sep 20, 2011 at 4:37 PM, Jonas Geiregat wrote: > >

DjangoCon US 2011 Videos

2011-09-20 Thread Marc Aymerich
Hi, Anyone know if the talks from past djangocon US will be availabe for online watching? any posible date? Thanks -- 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

Re: Virtualenv and Django in Production

2011-09-20 Thread dm03514
Virtualenv provides you with more control over your production environments. We run apache/virtualenv on 10 of our production servers. There very well might be more overhead running through a virtualenv. For us it is too negligible to make a difference. We use fabric to deploy our django apps,

request.method not working as expected

2011-09-20 Thread Fabio Natali
Hi everybody! I have a very simple view which is supposed to print out GET or POST, depending which has been used to send data. The problem is I always get "GET" even when sending data via POST. ### views.py: def method(request): return HttpResponse(request.method) ### urls.py:

Re: request.method not working as expected

2011-09-20 Thread DrBloodmoney
On Tue, Sep 20, 2011 at 11:46 AM, Fabio Natali wrote: > Hi everybody! > > I have a very simple view which is supposed to print out GET or POST, > depending which has been used to send data. The problem is I always get > "GET" even when sending data via POST. > > ### views.py: >

Re: Virtualenv and Django in Production

2011-09-20 Thread Tom Evans
On Tue, Sep 20, 2011 at 4:35 PM, dm03514 wrote: > Virtualenv provides you with more control over your production > environments.   We run apache/virtualenv on 10 of our production > servers. > There very well might be more overhead running through a virtualenv. > For us it is

Re: Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Jonas Geiregat
> So you want to edit the User object through the ModelForm of the other model, > or you just want to display it? > I want to edit the User object through the ModelForm. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Virtualenv and Django in Production

2011-09-20 Thread Markus Gattol
- it's just symlinks i.e. not more overhead - you won't clutter your system Python or vice versa when you up/downgrade something - easy to detect http://www.markus-gattol.name/ws/python.html#detect_a_virtualenv - if you want a production setup use e.g. gunicorn/nginx or even better

Re: request.method not working as expected

2011-09-20 Thread Fabio Natali
On 09/20/2011 05:53 PM, DrBloodmoney wrote: On Tue, Sep 20, 2011 at 11:46 AM, Fabio Natali wrote: Hi everybody! I have a very simple view which is supposed to print out GET or POST, depending which has been used to send data. The problem is I always get "GET" even when

Testcases are not working with PREPEND_WWW

2011-09-20 Thread Felix Stiehler
Hello there, I am trying to use the Django way of testing, but it somehow does not work together with the PREPEND_WWW setting. All I get is the 301 status code and no redirect is followed even when follow=True. from django.test.client import Client c = Client() r = c.get('/users/login/',

Selecting field value for different tables in Admin Site

2011-09-20 Thread MiSTiX
Hi, I have a field named "deger". I want to bind deger value from 3 or 4 source tables via foreignkey, find mechanism or what ever ??. (ajax, jquery, customform ... etc) After the user choice "object_id" (source tables id) and releated field "field_id" (source table field name), user can select

Re: request.method not working as expected

2011-09-20 Thread Babatunde Akinyanmi
Correct me if I'm wrong but it seems your "method" function is supposed to return the request method type(POST or GET) sent to the view. If I'm correct then your syntax will always return GET. That's because I think all the django middleware workings adjust the initial arguments and the response

Re: request.method not working as expected

2011-09-20 Thread dm03514
Fabio in your dev server output is it saying the type of request is get? ARe you accessing "/method/" through your form or are you just directing your webserver to http://192.168.0.2:8000/method/??? On Sep 20, 11:46 am, Fabio Natali wrote: > Hi everybody! > > I have a very

Custom model field/form: __init__() got multiple values for keyword argument 'baz'

2011-09-20 Thread mhulse
Hello, The problematic code can be found here: TypeError: __init__() got multiple values for keyword argument 'baz' I have spent the last couple days trying to figure out how to pass a kwarg from model to fields/forms (and eventually to a widget). TBTH, I

Virtualenv and Hudson/Jenkins

2011-09-20 Thread Tim Sawyer
Has anyone any instructions for using VirtualEnv with Hudson/Jenkins? Thanks, Tim. -- 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

Where does form.is_valid() clean the form?

2011-09-20 Thread Jacob G
The Django documentation says that a form is cleaned when calling is_valid(): https://docs.djangoproject.com/en/dev/ref/forms/validation/ (see first paragraph) However, the is_valid soure code doesn't show that is does clean, as follows: def is_valid(self): """ Returns True if the form

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
Take your study/research one step further: https://code.djangoproject.com/browser/django/trunk/django/forms/forms.py When it checks for self.errors, the _get_errors() function calls the full_clean. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Jacob G
Thanks, I didn't realize errors is property that calls _get_errors(). On Sep 20, 4:11 pm, Shawn Milochik wrote: > Take your study/research one step further: > > https://code.djangoproject.com/browser/django/trunk/django/forms/form... > > When it checks for self.errors, the

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
On Tue, Sep 20, 2011 at 4:14 PM, Jacob G wrote: > Thanks, I didn't realize errors is property that calls _get_errors(). > Yeah, it's non-obvious. That's one of the nice things about open-source, though. You can go through the code and understand how your tools work so you

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Jacob G
I doubt I'm familiar enough with Django to fix bugs. I am puzzled by what I am see though with the BaseForm class in Aptana PyDev debugger. I noticed that full_clean() was not being called via a call to is_valid. So I stepped through the debugger, and for some strange reason, the BaseForm

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
On Tue, Sep 20, 2011 at 4:46 PM, Jacob G wrote: > I doubt I'm familiar enough with Django to fix bugs. > Wait until the talks from DjangoCon US 2011 are out, then watch my lightning talk. I guarantee you could submit at least three patches today alone. > I am puzzled by what

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Jacob G
I'm doing this because there's a problem in my code. I create a AuthenticationForm, and post a non-existing username and password, and call is_valid(). I expect to then that the errors property will return at least one error, but there are actually no errors. So I step through the debugger, and

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread Shawn Milochik
I think this can be easily explained by pointing out a misunderstanding. Whether or not a form's values are valid has nothing to do with whether the values are meaningful. That is, a login form with a present but incorrect password is in fact valid. I'm sure that full_clean is getting called,

Is it possible to run from Django script?

2011-09-20 Thread Stone
Dear users, I have simple question which regards with running script from view.py. Part of my view.py looks like: def updateSystem(request): print request.POST id = 20 idgrp = 0 print "ID: %d and IDGRP: %d" % (id, idgrp) if request.is_ajax(): message = "This is AJAX

Re: Where does form.is_valid() clean the form?

2011-09-20 Thread James Pyrich
My guess, for whatever it's worth, is that the debugger is evaluating the errors property before the form is bound, causing self._errors to be populated with an empty ErrorDict. If so, the state revealed by the debugger is not an accurate reflection of the code as it would normally execute.

Re: Custom model field/form: __init__() got multiple values for keyword argument 'baz'

2011-09-20 Thread Michal Petrucha
On Tue, Sep 20, 2011 at 10:38:15AM -0700, mhulse wrote: > Hello, > > The problematic code can be found here: > > > > TypeError: > > __init__() got multiple values for keyword argument 'baz' > > I have spent the last couple days trying to figure out how to

Re: Custom model field/form: __init__() got multiple values for keyword argument 'baz'

2011-09-20 Thread Micky Hulse
On Tue, Sep 20, 2011 at 3:36 PM, Michal Petrucha wrote: > Well, the problem is that your defined fields.TestField.__init__ takes > baz as either a keyword argument, or as the first positional arg. As > with related fields, to pass the verbose name in this case you have to

Re: Uploading and viewing images problem

2011-09-20 Thread Rodney Topor
Thank you. That solves my problem. I had mistakenly assumed that as the introduction of django.contrib.staticfiles made django.views.static.serve unnecessary for static files, it also had the same consequence for media files. Thanks again. Rodney On Sep 20, 6:34 pm, Praveen Krishna R

mysql installation error

2011-09-20 Thread PremAnand Lakshmanan
Hi, When I try to install mysql I get the following error, Pls provide your inputs. C:\MYSQL\MySQL-python-1.2.3\MySQL-python-1.2.3>python setup.py install Traceback (most recent call last): File "setup.py", line 15, in metadata, options = get_config() File

Re: mysql installation error

2011-09-20 Thread Ivan Ivanov
First – It's not a Django question, and second search, read, but try: http://www.fuyun.org/2009/12/install-mysql-for-python-on-windows/ That was the second result I found :) I hope, it is what you need, couse I don't use windows and cannot test the problem and its solution. Ivan На Tue, 20

Re: request.method not working as expected

2011-09-20 Thread Fabio Natali
On 09/20/2011 07:12 PM, Babatunde Akinyanmi wrote: Correct me if I'm wrong but it seems your "method" function is supposed to return the request method type(POST or GET) sent to the view. If I'm correct then your syntax will always return GET. That's because I think all the django middleware

Re: request.method not working as expected

2011-09-20 Thread Fabio Natali
On 09/20/2011 07:15 PM, dm03514 wrote: Fabio in your dev server output is it saying the type of request is get? ARe you accessing "/method/" through your form or are you just directing your webserver to http://192.168.0.2:8000/method/??? Hi dm03514 and thanks for your help! Thanks to your

Re: request.method not working as expected

2011-09-20 Thread Andres Reyes
I believe that the best practice is to always use the {% url %} template tag and not hardcoding your URL's 2011/9/20 Fabio Natali > On 09/20/2011 07:15 PM, dm03514 wrote: > >> Fabio in your dev server output is it saying the type of request is >> get? >> ARe you accessing