django template variables

2010-07-10 Thread commonzenpython
hey guys, im trying to create a template that uses variables like {{ paragraph }} , but i cannot find how to get django to render the paragraph into the variable, i know i have to create a .py file that uses django's render class to render the paragraph but how can i connect the html file to the .p

Re: django template variables

2010-07-10 Thread Syed Ali Saim
you can use django render_to_response which by far the most common and preferred way, i found as newbie my self. here is an example: (roughly but will give you an idea) --- Now following this is an extremly crude tut by myself, for a superb one

Re: Database caching and multi db

2010-07-10 Thread Russell Keith-Magee
On Fri, Jul 9, 2010 at 1:41 AM, tiemonster wrote: > It seems that when running unit tests, the test runner not only > creates all tables on both of my connections (which it should not do, > if I read the documentation correctly), Tables will be created on all connections, according to the syncdb

could not join irc #django channel

2010-07-10 Thread evileyes
hi all, When I join irc #django channel, the server response "Cannot join channel (+r) - you need to be identified with services", does anyone know what is it means? how can I join #django channel? -- You received this message because you are subscribed to the Google Groups "Django users" group

Re: Cannot connect to #django on irc

2010-07-10 Thread Ran Zhu
what is nickServ? it's a server like "irc.freenode.net" or the nick name I want to registerd? On Sat, Jul 10, 2010 at 7:57 AM, Kenneth Gonsalves wrote: > On Friday 09 July 2010 14:34:15 david ally wrote: > > I have been trying to join the irc channel for django and it is always > > giving me one

Re: Cannot connect to #django on irc

2010-07-10 Thread Ran Zhu
*I try every thing I can do, but still can't join #django, it really drive me crazy!* * * *I already register a nick name named "zhuran", how can I join #django?* 2010/7/10 Ran Zhu > what is nickServ? it's a server like "irc.freenode.net" or the nick name I > want to registerd? > > > On Sat, Jul

Re: Cannot connect to #django on irc

2010-07-10 Thread Ran Zhu
finally, I get it... */msg nickserv register * nickserv is not a server name or the nick name you want to register... it just the word "nickserv" *type the command then the server will send you a confirm email, then you can join the channel... * On Sat, Jul 10, 2010 at 2:12 PM, Ran Zhu wrote: >

IntegrityError

2010-07-10 Thread Fynn
Hi everyone, I'm using Nathan Borror's blog application which uses django's comment framework. I'm using django with a postgres database. Now, each time I try to add a comment, there is an IntegrityError: Environment: Request Method: POST Request URL: http://10.10.10.3:8080/comments/post/ Django

Re: django template variables

2010-07-10 Thread commonzenpython
thanks, unfortunately i keep getting a 404, the templates name is 2col.html, its inside ash/templates, the url i have is (r'^paragraph/ $', 'show_para'), and the views is from django.http import HttpResponse from django.shortcuts import render_to_response def show_para(request): para = "I lo

Re: Cannot connect to #django on irc

2010-07-10 Thread Syed Ali Saim
given you have a registered nick here is the simple step by step way. 1: Launch irc client 2: type /server irc.freenode.net 3: once connected to the server use password to identify you nick by typing /msg nickserv identify 4: joind channel django by typing /j #django and have fun! On Sat, Jul

Re: translation for variables

2010-07-10 Thread Lachlan Musicman
On Sat, Jul 10, 2010 at 05:26, Börni wrote: >> > Hello together, >> >> Are you running "django-admin.py compilemessages" to create the >> relevant django.mo file after the event? > > Yes, i've tried it with the existing django.po file. And my other try > was to create an additional file called dat

Re: django template variables

2010-07-10 Thread Syed Ali Saim
dude I missed 1 important import. first add this, - from django.template import RequestContext also makesure your template path is set in settings.py mine looks something like this TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templa

Re: could not join irc #django channel

2010-07-10 Thread Kenneth Gonsalves
On Saturday 10 July 2010 10:12:21 evileyes wrote: > When I join irc #django channel, the server response "Cannot join > channel (+r) - you need to be identified with services", does anyone > know what is it means? > how can I join #django channel? > please do a google search on this list - the sa

mod_wsgi problem with installation

2010-07-10 Thread tazimk
hi, Trying to figure out why make gives following errors . What is wrong with installation ? mod_wsgi.c:14532: error: initializer element is not constant mod_wsgi.c:14532: warning: data definition has no type or storage class mod_wsgi.c:14533: warning: parameter names (without types) in functio

Re: www.djangoproject.com

2010-07-10 Thread Russell Keith-Magee
On Thu, Jul 8, 2010 at 11:53 PM, Nick Raptis wrote: > Sorry for the rant but I can finally express my delayed frustration on this > bug.. > > I first I spent some 2-3 hours trying to find out if this problem came from > a broken ipv6 configuration. > Then, I actually had to delete all my profile f

Re: IntegrityError

2010-07-10 Thread Karen Tracey
On Sat, Jul 10, 2010 at 2:04 AM, Fynn wrote: > Exception Type: IntegrityError at /comments/post/ > Exception Value: insert or update on table "django_comments" violates > foreign key constraint "django_comments_site_id_fkey" > DETAIL: Key (site_id)=(1) is not present in table "django_site". > >

Testing many-to-many models on a legacy database

2010-07-10 Thread Derek
Running Django 1.2.1 under Python 2.6. I am obviously missing something cruccial, but I am just not sure where this is... I have a setup which includes a number of many-to-many models in a legacy database. For example: class Grouping(models.Model): id = models.AutoField(primary_key=True, db

Re: how to dynamically update model fields?

2010-07-10 Thread Rolando Espinoza La Fuente
On Sat, Jul 10, 2010 at 12:01 AM, zweb wrote: > I want to provide a method as follows, > > def update_some_model_field(key, field_name, value): >  '''user provides the primary key of row, field name in model and the > value and the method updates the field for that row with the value''' > > 1.  mo

Re: Testing many-to-many models on a legacy database

2010-07-10 Thread Rolando Espinoza La Fuente
On Sat, Jul 10, 2010 at 9:31 AM, Derek wrote: > Running Django 1.2.1 under Python 2.6. > I am obviously missing something cruccial, but I am just not sure where this > is... > I have a setup which includes a number of many-to-many models in a legacy > database.  For example: > > class Grouping(mod

Re: What causes request.session to be erased?...When you go to different view?

2010-07-10 Thread Chris Seberino
Wow beautiful. Thanks. I needed that. cs On Jul 10, 12:14 am, Javier Guerra Giraldez wrote: > On Fri, Jul 9, 2010 at 11:36 PM, Chris Seberino wrote: > > elif form.is_valid(): > >        ... > >        request.session["posts"].append(form.cleaned_data) > >         > > > I noticed that ever

"SESSION_SAVE_EVERY_REQUEST = True" performance hog? Any other cons?

2010-07-10 Thread Chris Seberino
SESSION_SAVE_EVERY_REQUEST = True (in settings.py) seems to avoid a lot of potential bugs from forgetting to set request.session.modified = True when necessary. Is this a serious performance problem? If not, I would think this would be a good *default* value for Django no? Chris -- You receiv

Re: defining custom attributes for a model

2010-07-10 Thread Rolando Espinoza La Fuente
On Fri, Jul 9, 2010 at 4:52 PM, Sells, Fred wrote: > I've got a model as illustrated below.  Is there any way I can define my > own attributes that are not columns like the "fredsstuff" below? > > > class A(MDSSection): >    A0100A    = models.CharField(max_length=10, help_text='''Text      : > Fa

Reversing URL with unnamed capturing groups

2010-07-10 Thread Phui Hock
Hi, It seems that if I split a URL with unnamed capturing groups into different urls.py files, urlresolvers.reverse(..) doesn't work as expected. For example: --- root urls.py --- (r'^foo/(.*)/', include('foo.urls')) --- foo/urls.py --- url('^(.*)/$', blackhole, name='foo_1') When I do urlresolv

Serving static files

2010-07-10 Thread shwetanka
Hi Below is my code: settings.py MEDIA_URL = '/static/' STATIC_DOC_ROOT = 'C:/djangotest/codificador/static/' urls.py urlpatterns = patterns(' ', (r'^static/(?P.*)$', 'django.static.views.serve', {'document_root': settings.STATIC_DOC_ROOT}), ) base.html in style tag:

Apache configuration

2010-07-10 Thread octopusgrabbus
I worked through samples in the Visual Quickpro Guide Django. I used python manage.py runserver while running through the examples. Now, I want to configure this in Apache. Django is complaining about finding modules underneath my top directory. Here's the apache configuration: SetHandler pytho

Admin site not formatted

2010-07-10 Thread octopusgrabbus
Using Apache and not the built-in Django web server, I can reach the admin site, but it's not formatted well, as it is with the built-in web server. Any ideas on what to do? Here's the location directive in apache SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJA

Re: Apache configuration

2010-07-10 Thread Anders Petersson
Hi, Please use mod_wsgi instead of mod_python, it is better in all ways. http://docs.djangoproject.com/en/1.2/howto/deployment/modwsgi/#howto-deployment-modwsgi Best, Anders Petersson On Jul 10, 7:49 pm, octopusgrabbus wrote: > I worked through samples in the Visual Quickpro Guide Django. I us

Re: IntegrityError

2010-07-10 Thread Justin Myers
As another idea, can you just update your SITE_ID setting (http:// docs.djangoproject.com/en/1.2/ref/settings/#site-id)? It defaults to 1 (for the example.com instance), but if you've got a new Site object for your actual domain, you should just be able to use its id instead. -Justin On Jul 10, 7:

Calendar Templatetag

2010-07-10 Thread Mario
Hello, I am currently using the Calendar Templatetag found at http://djangosnippets.org/snippets/129/ and it suites my current needs. However, I would like to extend the functionality of the templatetag by rendering previous and next months i.e., June 2010, July 2010, August 2010, September 2010

Re: How to modify many to many data without auto saving to DB?

2010-07-10 Thread ydjango
Is there a reason why Django does auto save to DB in following stmts? Any way to tell it not to auto save to db? examples, where publications and articles are many to many.. a_publication.articles = [article11] or request.user.groups = [group1] On Jul 9, 5:06 pm, zweb wrote: > Assume there i

How to pass a GET param that contains multiple items

2010-07-10 Thread Margie Roginski
I have a url in my app that needs to get info from a GET param. For example, let's say my url is retrieving books by any of a set of authors, so the url might be this to get books authored by smith, johnson, or klein: www.example.com/books/?author=smith+johnson+klein I notice that when I look at

Re: mod_wsgi problem with installation

2010-07-10 Thread Graham Dumpleton
You have not supplied all the output, but likely that you don't have either python-dev or httpd-dev packages installed and so cant find header files for one of the other. Read the README in the mod_wsgi source code for requirements as to what must be installed on your system. Graham On Jul 10, 9:

Re: Admin site not formatted

2010-07-10 Thread Graham Dumpleton
Read: http://docs.djangoproject.com/en/dev/howto/deployment/modpython/?from=olddocs#id1 It tells you about serving static files with mod_python. Graham On Jul 11, 3:50 am, octopusgrabbus wrote: > Using Apache and not the built-in Django web server, I can reach the > admin site, but it's not

Re: Reversing URL with unnamed capturing groups

2010-07-10 Thread Russell Keith-Magee
On Sunday, July 11, 2010, Phui Hock wrote: > Hi, > It seems that if I split a URL with unnamed capturing groups into > different urls.py files, urlresolvers.reverse(..) doesn't work as > expected. For example: > > --- root urls.py --- > (r'^foo/(.*)/', include('foo.urls')) > > --- foo/urls.py ---

Re: How to modify many to many data without auto saving to DB?

2010-07-10 Thread Russell Keith-Magee
On Saturday, July 10, 2010, zweb wrote: > Assume there is many to many between publication and article. (example > from django docs) > > By default following stmt will auto save the relationship between > a_publication and article11 in database. > > a_publication.articles = [article11] > > how do

Nose Testing

2010-07-10 Thread Binh
Hi, Does anyone know how to get nose testing to work on Google App Engine (dev_appserver.py)? I have given django-nose a try. It works fine on django1.2.1 without dev_appserver. Also, does anyone know how to hook up nose plugins with django-nose such as freshen? Thank you so much for helping. B

doctests not running

2010-07-10 Thread Jeff
Hi, I have a rather complicated get_absolute_url method in a models.py file that I wanted to use two doctests to check. Unfortunately the doctests do not appear to run when I run python manage.py test according to the verbose output. Here is the method: def get_absolute_url(self): ""

Re: doctests not running

2010-07-10 Thread Jeff
Just to follow-up, the syntax itself does not appear to be a problem: >>> import doctest >>> import osl_flatpages >>> doctest.testmod(osl_flatpages.models, verbose=1) Trying: home_fp = Flatpage.objects.get(page_name="Home") Expecting nothing ok Trying: home_fp.get_absolute_url() Expecting:

Re: doctests not running

2010-07-10 Thread Jeff
Just for a case of more weirdness, here is my model.py with some extra doctests thrown in: import markdown from django.db import models from django.forms import ModelForm import settings class Flatpage(models.Model): """ >>> 1 + 2 3 """ page_name = models.CharField(max_lengt

Re: django template variables

2010-07-10 Thread commonzenpython
alright, thanks a lot Syed :P -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more

update least syntax?

2010-07-10 Thread Doug Warren
Can Django support an update by setting a field to the least of two args? I have a model that looks like: class Bar maxval = models.FloatField() rate = models.FloatField() class Foo(models.Model): bar = models.ForeignKey(Bar) current = models.FloatField() and i'd like to increas