Re: Does Django Template Support Nested Tags?

2012-05-11 Thread Wally Yu
Thanks Aziz. You really helps a lot. But what if I have deeper level of looping? Say I have a template like this: {% for module, tests in module_tests.items %} Automation Test Result for Test Suite: {{ module}}

Re: Does Django Template Support Nested Tags?

2012-05-11 Thread azizmb.in
Off the top of my head, you could keep nesting the dictionary. eg: module_tests = { "module1": { "test1": { "action1": ["step1", "step2", "step3"], "action2": ["step1", "step2", "step3"] }, "test2": { "action1": ["step1",

Re: How to serve staticfiles with full URL for local development?

2012-05-11 Thread e.generalov
On 11 май, 01:54, doniyor wrote: > if your problem is how to serve your static files, just create a folder > with name static in your main app, then put all of your static files and > and your STATIC_URL is /static/. Thanks. I found some more ways to get around the

Re: Only Two Users Get : Forbidden (403) CSRF verification failed. Request aborted. Options

2012-05-11 Thread Johan
Hi thanks for the quick reply. After some more investigation I am quite sure that this is exactly the issue. Thanks again for the quick reply. Now to just find an elegant way to let the user know that they need to have Cookies enabled to access my site :) On Thursday, 10 May 2012 18:24:13

Re: Does Django Template Support Nested Tags?

2012-05-11 Thread Wally Yu
Got it. Thanks Aziz :) On May 11, 2:12 pm, "azizmb.in" wrote: > Off the top of my head, you could keep nesting the dictionary. > > eg: > > module_tests = { >     "module1": { >         "test1": { >             "action1": ["step1", "step2", "step3"], >             "action2":

Re: Only Two Users Get : Forbidden (403) CSRF verification failed. Request aborted. Options

2012-05-11 Thread Sebastian Goll
On Thu, 10 May 2012 23:56:50 -0700 (PDT) Johan wrote: > Hi thanks for the quick reply. After some more investigation I am quite > sure that this is exactly the issue. Thanks again for the quick reply. Now > to just find an elegant way to let the user know that they need to

Best practices for calling an external service in a Django app

2012-05-11 Thread Thomas Orozco
Hi, Here's my situation: one of my views needs to call an external service (through a socket ; actually the said service is on the same server). I don't even need to know about the service's response as I'll inquire about it asynchronously in an effort to avoid delay on the user's end. What are

Re: Best practices for calling an external service in a Django app

2012-05-11 Thread Marcin Tustin
I use a celery task to make this sort of job asynchronous. The task makes a new connection to the "remote" (same server) service each time. This proves to be sufficiently fast. If you are making a lot of requests, the overhead of making new connections may prove to be significant. I wouldn't

Re: Language Translation using multilingual in django

2012-05-11 Thread Madhu
Thanks for the reply I create flatpages using multilingual flagpages in different languages. I want to call that pages in different urls, how it should be done? Mulilingual package has its own views & urls. On Thursday, May 10, 2012 7:05:53 PM UTC+5:30, juanpex wrote: > > If you only want to

How to tell Apache to see my Djangoproject??

2012-05-11 Thread doniyor
hey guys, i am stuck here.. please help me :( i cannot serve my project on server, it says 403 You don't have permission to access / on this server. this is my httpd.conf file. ServerAdmin webmaster Servername afect.stahlbaron.de Serveralias www.afect.stahlbaron.de

Re: Best practices for calling an external service in a Django app

2012-05-11 Thread Thomas Orozco
Thanks for the information! Using celery was my first idea too, but here it is not practical as I'll be transferring sensitive information through the socket and I'd rather avoid having hanging around in the Celery queue. So I guess opening the socket from inside the view code and then closing

Re: Best practices for calling an external service in a Django app

2012-05-11 Thread Marcin Tustin
The thing is, you will then be doing it synchronously, because python's global interpreter lock means that threads are never really parallel. To avoid having the sensitive data in your celery queues, have your task retrieve the sensitive data from the database (if that's where its coming from).

Invalid block tag: 'admin_list_filter_output'

2012-05-11 Thread krocozabr
Hi all! I use the old example of template from Django 1.1 and I have got error now, in Django 1.4. Surprise!)) Django Version: 1.4 Exception Type: TemplateSyntaxError Exception Value: Invalid block tag: 'admin_list_filter_output', expected 'empty' или 'endfor' Help me please! How I can fix

Re: How to tell Apache to see my Djangoproject??

2012-05-11 Thread doniyor
i solved this, but not all. now i see the folders and files downloadable in browser instead of a webpage. Why is this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Fwd: Django models and different types

2012-05-11 Thread Michael da Silva Pereira
Hi, Looking for some ideas around a type / conversion matching issue I'm having with a big django model. The model has tons of variables, and all being of different types (int, nullbool, date, datetime, string). I'm trying to pass data from a different database into the django model, but the

Re: Django models and different types

2012-05-11 Thread Tom Evans
On Fri, May 11, 2012 at 12:39 PM, Michael da Silva Pereira wrote: > > Hi, > > Looking for some ideas around a type / conversion matching > issue I'm having with a big django model. > The model has tons of variables, and all being of different types > (int, nullbool, date,

Django unit test. Access the 'real data base'

2012-05-11 Thread Gelonida
For one unit test I would like to use the real data base and not the test data base. Basically this unit test shall verify that the server database fulfills certain consistency criterea. How can I write one django test, that uses the 'default' (non test database) I tried to use

Re: How to tell Apache to see my Djangoproject??

2012-05-11 Thread Bolkin
It looks close enough, but try commenting out other virtual hosts to reduce noise, and also comment out: #DocumentRoot /usr/local/httpd/vhtdocs/stahlbaron/ You might need to add: Order deny,allow Allow from all On Friday, May 11, 2012 7:25:59 AM UTC-4, doniyor wrote: > > i solved this,

Re: Prototype of a web based code editor for Django

2012-05-11 Thread Alec Taylor
It looks alright, be sure to add code highlighting and debugging to the online text editor (http://ace.ajax.org/). Also need restart buttons and whatnot On Sat, May 12, 2012 at 12:06 AM, Timothy Clemans wrote: > I've created a basic web based code editor for Django,

Re: How to tell Apache to see my Djangoproject??

2012-05-11 Thread Bolkin
Sorry, supposed to be on different lines: Order deny,allow Allow from all On Friday, May 11, 2012 10:19:24 AM UTC-4, Bolkin wrote: > > It looks close enough, but try commenting out other virtual hosts to > reduce noise, and also comment out: > > #DocumentRoot

Re: Django models and different types

2012-05-11 Thread Michael da Silva Pereira
Hi, Using a form did the trick, I did however have a issue with datetime formats. It appears the formats I got from the string values are not recognized. This sorted me out with that: from dateutil import parser if str(Customer._meta.get_field("pastel_"+col).get_internal_type())

Heroku.com experiences?

2012-05-11 Thread Bob Carlson
Thanks for the pointer. That's one of the nicest sites I have ever seen. It makes me want to work with them. Could people out there describe their experiences working with this company? My needs are low volume, but very high reliability, security and availability. And of course, ease of use

Re: Heroku.com experiences?

2012-05-11 Thread yati sagade
You also have the option of using OpenShift by redhat. https://openshift.redhat.com/app/ Best part: No restrictions on any framework - use whatever you want and it was Open Sourced recently. On Fri, May 11, 2012 at 9:28 PM, Bob Carlson wrote: > Thanks for the pointer. That’s

Re: Heroku.com experiences?

2012-05-11 Thread Chris Czub
Heroku has been good to me and some of my colleagues so far. They host on AWS so if there was an AWS outage obviously your site would be down(would be nice to be able to fail over to Rackspace or something) but other than that reliability is fine. Their support is very good and responsive as

Re: Django psycopg error

2012-05-11 Thread Mike Di Domenico
I have the python-psycopg2 package installed and the settings for my engine are 'django.db.backends.postgresql_psycopg2' and I am still getting the error. When I do "python manage.py shell" I get the error "Error: No module named psycopg". The contents of manage.py are the following: from

Tables with Foreign Key does not get filled

2012-05-11 Thread Sandeep kaur
In my application, I am using forms for the users to enter the information. In this, I have linked two tables by using foreign key. Here are the 2 tables: models.py> - class

Easy Blog

2012-05-11 Thread Kevin Anthony
Hello, I am a student and i have an existing django website that i'd like to add a blog to, what is the simplest way to do this? Also, it would be nice if i could use a standared CSS file to skin the blog to look like the rest of my website. Thanks in advance Kevin -- Thanks Kevin Anthony

Django & uWSGI best practices

2012-05-11 Thread chuwy
Hi. I'm going to deploy a few (8-12) Django projects on my VDS with Ubuntu 12.04 and nginx. And I wonder how should configuration look like, to be explicit, simple and easy-to-understand for others (it will be maintained by another dude). Should I use emperor-mode for such a small amount of

Re: Django & uWSGI best practices

2012-05-11 Thread Roberto De Ioris
> Hi. > I'm going to deploy a few (8-12) Django projects on my VDS with Ubuntu > 12.04 and nginx. And I wonder how should configuration look like, to be > explicit, simple and easy-to-understand for others (it will be maintained > by another dude). > Should I use emperor-mode for such a small

Re: Django psycopg error

2012-05-11 Thread akaariai
On May 11, 7:37 pm, Mike Di Domenico wrote: > I have the python-psycopg2 package installed and the settings for my engine > are 'django.db.backends.postgresql_psycopg2' and I am still getting the > error. > > When I do "python manage.py shell" I get the error "Error:

Re: Django unit test. Access the 'real data base'

2012-05-11 Thread akaariai
On May 11, 4:38 pm, Gelonida wrote: > For one unit test I would like to use the real data base and not the > test data base. > > Basically this unit test shall verify that the server database fulfills > certain consistency criterea. > > How can I write one django test, that

unique=True doesn't work

2012-05-11 Thread .
Hi there, Here is my class: MyClass(User): foo = IPAddressField(unique=True) unique doesn't work: python manage.py shell from myproject.models import MyClass bar = MyClass(foo="12", username="first", password="secret") bar.save() baz = MyClass(foo="12", username="second",

Re: unique=True doesn't work

2012-05-11 Thread Javier Guerra Giraldez
On Fri, May 11, 2012 at 3:16 PM, . wrote: > It should raise an exception, but there is no one. > (username's unique=True works.) my guess: the IPAddress field didn't have unique=True at first, but it was added afterwards. the syncdb command doesn't modify existing tables. if

Re: unique=True doesn't work

2012-05-11 Thread Nikolas Stevenson-Molnar
Take a look at your database schema and make sure that table actually has a unique key for the `foo` column. _Nik On 5/11/2012 1:16 PM, . wrote: > Hi there, > > Here is my class: > > MyClass(User): > foo = IPAddressField(unique=True) > > unique doesn't work: > > python manage.py shell > > from

Admin user privilege elevation (how to prevent it)

2012-05-11 Thread Josh Cartmell
I work a lot with Mezzanine which is a CMS that uses Django. A security issue was recently revealed where an admin user, lets call him A, (they can post rich content) could put a cleverly constructed javascript on a page such that if a superuser, let's call her B, then visited the page it would

Re: unique=True doesn't work

2012-05-11 Thread .
Thanks for you comments. I've recreated my repo and it worked. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to

Pass data from html to views.

2012-05-11 Thread voss
A list is created dynamically by users, and the code looks like: dojo.create("li", {innerHTML: detail}, dojo.byId("test")); , how to pass the list values (i.e., item1, item2, and item3) to views -- You received this message because you are subscribed to the Google Groups "Django

Pass data from html to views.

2012-05-11 Thread voss
Hello, I have a list that is created dynamically, and the code looks like: ... ... for (i=0; i

scroll to form on error

2012-05-11 Thread brian
I have form that is toward the bottom of a web page. If someone submits some bad data, I want the page to scroll to the form. Currently if the data is bad, I can see the page get refreshed and the browser scrolls to the top of the screen. When I get an error in a submitted form, how do I get it

Re: Admin user privilege elevation (how to prevent it)

2012-05-11 Thread Nikolas Stevenson-Molnar
I imagine you could prevent this by storing the CSRF token in the user session rather than directly in a cookie. That way, JS on the site wouldn't be able to get at it. It looks like at least one project does this: https://github.com/mozilla/django-session-csrf _Nik On 5/11/2012 2:11 PM, Josh

Re: Pass data from html to views.

2012-05-11 Thread Nikolas Stevenson-Molnar
How about creating hidden input nodes inside a form for each li node you create? For example, add after your dojo.create: dojo.create("input", {name: "values[]", type: "hidden", value: array[i]}, dojo.byId("myForm")); _Nik On 5/11/2012 2:37 PM, voss wrote: > Hello, > > I have a list that is

Re: Admin user privilege elevation (how to prevent it)

2012-05-11 Thread Russell Keith-Magee
On Sat, May 12, 2012 at 5:11 AM, Josh Cartmell wrote: > I work a lot with Mezzanine which is a CMS that uses Django.  A > security issue was recently revealed where an admin user, lets call > him A, (they can post rich content) could put a cleverly constructed > javascript

is django for me?

2012-05-11 Thread giraffasaurus
Hi everyone, i recently got my first web design job and i am wondering if django is the software for me. I will be working solo, doing both the graphic design and the coding. i am interested in django because i can already use python. The commission requires something highly customised, with a

disabled or readonly field 's problem

2012-05-11 Thread Min Hong Tan
hi, i have a problem on the formmodel. basically, to set the field read only and disabled is easy. but, the problem which I facing now, is a bit complicated. - if set field "read-only" field. We can actually modify the record by using web developer tools by press "F12" to modify the record and

Re: is django for me?

2012-05-11 Thread Michael Ray
Well you are talking about a backend language vs a front end language, so theoretically yes django can work with flash. The Flash replacement though is HTML5 methods which include CSS Transitions, CSS Animations, and the Canvas elements paired with intermediate Jacascript knowledge. All of

Re: disabled or readonly field 's problem

2012-05-11 Thread azizmb.in
Hey! You could clean the protected fields from the model data by overriding "clean" methods of the form. The documentation is here . On Sat, May 12, 2012 at 8:56 AM, Min Hong Tan

Re: is django for me?

2012-05-11 Thread doniyor
i should say, django is the most beautiful framework for working with big pages also. may be it is because i like python, language is not a chaos language, it is clean and powerful. and django can work with flash although flash is a different topic from django.. Am Samstag, 12. Mai 2012

Re: How to tell Apache to see my Djangoproject??

2012-05-11 Thread doniyor
hey thanks thanks, but now i have 500 Internal Server Error. What i now have is: a folder 'apache' next to my django project folder. Apache folder has: apache_django_wsgi.conf, myproject.wsgi, __init__.py, urls_production.py, settings_production.py and in httpd.conf i have this (stahlhandel

Re: Pass data from html to views.

2012-05-11 Thread doniyor
just after your for loop, you can call ajax function which takes the values of your newly created lists and submits this further to your view. you dont need to load the whole page and the data will silently go to your view. Am Freitag, 11. Mai 2012 23:37:08 UTC+2 schrieb voss: > > Hello, > >

files are downloadable in browser because of apache conf file! help!!!

2012-05-11 Thread doniyor
hey guys, i was configuring my django project on server, in httpd.conf file. suddenly i have 500 Internal Server Error. before that i had the page where files can be just downloaded. how can i fix this? apache2.2 is running and mod_wsgi is installed. i think, i dont know how to tell apache

Re: during putting my djangosite on server, i cannot restart the apache server, apachectl nor apache2 is not found. why?

2012-05-11 Thread kenneth gonsalves
On Thu, 2012-05-10 at 13:01 -0700, doniyor wrote: > Hi there, i need a small help. as the titel says, i cannot restart > the > apache, i can get the version of apache, so it is there, but i cannot > restart it. OS is Linux. what can be the problem, anyone has had > experience > with this? > >

Re: during putting my djangosite on server, i cannot restart the apache server, apachectl nor apache2 is not found. why?

2012-05-11 Thread doniyor
hey, thanks, now i can with 'service httpd restart'. now i have another problem here, may be you can help me. many thanks Am Samstag, 12. Mai 2012 07:25:19 UTC+2 schrieb lawgon: > > On Thu, 2012-05-10 at 13:01 -0700,

Re: during putting my djangosite on server, i cannot restart the apache server, apachectl nor apache2 is not found. why?

2012-05-11 Thread kenneth gonsalves
On Fri, 2012-05-11 at 22:45 -0700, doniyor wrote: > hey, thanks, now i can with 'service httpd restart'. so you have redhat, fedora or centos - mention this when you ask such questions. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups

Re: scroll to form on error

2012-05-11 Thread doniyor
cannot you 'redirect' to the whole url like this: if form.is_valid(): thank you page else: *return redirect('http://www.test.com/form#filled') * * * or you can also redirect just to /form#form/ i think... * * * * Am Freitag, 11. Mai 2012 23:43:50 UTC+2 schrieb brian: > > I have form that

Re: during putting my djangosite on server, i cannot restart the apache server, apachectl nor apache2 is not found. why?

2012-05-11 Thread doniyor
i think, i have SuSe. Am Samstag, 12. Mai 2012 07:51:23 UTC+2 schrieb lawgon: > > On Fri, 2012-05-11 at 22:45 -0700, doniyor wrote: > > hey, thanks, now i can with 'service httpd restart'. > > so you have redhat, fedora or centos - mention this when you ask such > questions. > -- > regards