Re: Pre fork or worker MPM

2011-05-18 Thread Тимур Зарипов
Generally, mpm worker is more preferable, but there is one more thing: in which mode will you use mod_wsgi ? Embedded or daemon-mode ? I'd suggest you to read mod_wsgi main page first. On Wed, May 18, 2011 at 1:15 AM, ydjango wrote: > I am using Python 2.5, d

Re: Error when try to do ManyToMany relation with User class...

2011-05-18 Thread Daniel Roseman
On Wednesday, May 18, 2011 2:26:21 AM UTC+1, Chris Seberino wrote: > > I have 3 classes that have a ManyToMany relation with the User class. > > When I try to do syncdb I get this error > > Error: One or more models did not validate: > mvc.course: 'users' has an m2m relation with model User,

Re: How to register JS event handler

2011-05-18 Thread Thomas Guettler
On 17.05.2011 13:18, Michal Petrucha wrote: > On Tue, May 17, 2011 at 12:34:05PM +0200, Thomas Guettler wrote: >> Hi, >> >> I want to register some jquery event handler for some widgets of a form >> (FooForm). The >> form gets used in several views. >> >> It would be a pain to insert $(function(){

Re: How to register JS event handler

2011-05-18 Thread Piotr Zalewa
Make the JS code a callable function Include JS in pages you want to use it Create a small template in which you will call the function with these values. Include it in templates you need such a thing On 05/18/11 09:44, Thomas Guettler wrote: On 17.05.2011 13:18, Michal Petrucha wrote: On Tu

Re: Django FCGI process randomly dying

2011-05-18 Thread Vincent den Boer
On Monday 16 of May 2011 14:12:45 Alexander Schepanovski wrote: > Do you log django's stdout/stderr. You could do that with --outlog and > --outerr options of runfcgi command It's running with those options now. And I'm waiting for it to die again ;). -- You received this message because you are

Re: how use this snippet

2011-05-18 Thread Tonton
TOM > It's a management command. It belongs in > /management/commands/.py, and you then run it by > calling "python manage.py ". > > More on management commands: > http://docs.djangoproject.com/en/1.3/howto/custom-management-commands/ > > Yes Tom ! i never heard this before so i think it will be

ANN: DSE 2.0.0-RC1, now using the BSD license.

2011-05-18 Thread Thomas Weholt
Inserting or updating a lot of data using the django orm? Not too happy with the performance? Try DSE. Typical performance gain 3X on insert, 5-10x on updates - and still it's django-friendly and easy to use. No manual SQL-generating. Default values in models respected. DSE is now released under t

Need help with a form instance

2011-05-18 Thread piker
Ok, I've managed to create a ModelForm instance that enables me to input totally new items into the database, but i'm at a loss to work out how to display all the existing items in a model, on one page, edit them and submit them in one save(). Is that possible? I'd really appreciate some help here

Re: Running tests automatically as you work.

2011-05-18 Thread Jesse Heitler
Another alternative automated test runner is nosyd. It provides a similar service with notifications through Growl, etc and the ability to monitor any number of projects simultaneously. I've just started to maintain my fork at https://github.com/jesseh/nosyd This original code is from https://git

Re: Need help with a form instance

2011-05-18 Thread Oleg Lomaka
You need ModelFormSet. By default, it creates forms for all models from given queryset. On Wed, May 18, 2011 at 12:20 PM, piker wrote: > Ok, I've managed to create a ModelForm instance that enables me to > input total

Re: Running tests automatically as you work.

2011-05-18 Thread Faruque
How about using PyZen http://pypi.python.org/pypi/PyZen/ I got it a bit slow but works excellent. Faruque -- 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 t

Re: Django FCGI process randomly dying

2011-05-18 Thread Simon Connah
On 18 May 2011, at 10:14, Vincent den Boer wrote: > On Monday 16 of May 2011 14:12:45 Alexander Schepanovski wrote: >> Do you log django's stdout/stderr. You could do that with --outlog and >> --outerr options of runfcgi command > > It's running with those options now. And I'm waiting for it to

retrieving current user in view

2011-05-18 Thread Michel30
Hey all, I have a Django 1.3 app that retrieves user credentials from LDAP. Most views require the user to be authenticated so I use the @login_required decorator. Now, in a form a user can upload a document using a form: {% csrf_token %} {{ form }} I want to log the user's first and lastname

Re: Running tests automatically as you work.

2011-05-18 Thread Adrien Lemaire
The script you're looking for is : https://github.com/peterbe/python-gorun Cheers On Apr 28, 6:58 am, Shawn Milochik wrote: > http://dpaste.com/hold/536487/ > > I cobbled this little script together that monitors my project folder > and runs tests every time a .py file is saved. I'm sharing it i

Re: retrieving current user in view

2011-05-18 Thread Daniel Roseman
On Wednesday, May 18, 2011 2:16:00 PM UTC+1, Michel30 wrote: > > Hey all, > > I have a Django 1.3 app that retrieves user credentials from LDAP. > Most views require the user to be authenticated so I use the > @login_required decorator. > > Now, in a form a user can upload a document using a fo

Nested template variable lookup

2011-05-18 Thread Geoff Kuenning
I'm using Django 1.0.2, with plans to upgrade to 1.2.5 at some point. I have an application that basically just displays the results of a database lookup as a table. In a fit of DRY-ism, I decided it would be cool if my application inspected the model to figure out what columns to display; that w

Re: Nested template variable lookup

2011-05-18 Thread Tom Evans
On Wed, May 18, 2011 at 3:10 PM, Geoff Kuenning wrote: > I'm using Django 1.0.2, with plans to upgrade to 1.2.5 at some point. > >                {{ row.{{col.col_name}} }}       > > Am I up a creek?  Or is there some trick I'm missing here? > http://groups.google.com/group/django-users/browse_th

create a database

2011-05-18 Thread refreegrata
hello list. I have a question. With "python manage.py syncdb" the tables are created in a database. Is possible use the configuration declarated in the settings.py to create the database if this not exists and make a script with lines like : #---SCRIPT-- if not exists datab

Re: create a database

2011-05-18 Thread Shawn Milochik
Sure, you can do this. Just write a Python script that imports settings (it should be on your PYTHONPATH) and read the database config info, and do your thing. The Django settings file is just a Python script, and all the settings in it are just Python objects (dictionaries, tuples, etc.) -

Re: create a database

2011-05-18 Thread refreegrata
ok, thanks i forget that the settings.py is just a python script. On 18 mayo, 11:02, Shawn Milochik wrote: > Sure, you can do this. > > Just write a Python script that imports settings (it should be on your > PYTHONPATH) and read the database config info, and do your thing. The > Django settings

Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-18 Thread Ivan Galic
On May 18, 2011, at 8:34 AM, Gabriel Gunderson wrote: > On Tue, May 17, 2011 at 11:53 AM, igalic wrote: >> I went through the first part of the tutorial without problems, but >> when trying to turn on the admin app in tutorial 2, I got this error >> page with the message stated in subject line.

Static files

2011-05-18 Thread John Wheeler
Dude, STATICFILES_DIRS = ('/home/jwheeler/projects/pwscheduler/static',) STATIC_URL = '/static/' TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'django.template.loaders.eggs.Loader', ) INSTALLED_APPS = ( 'django.contrib.auth',

Re: Static files

2011-05-18 Thread Tom Evans
On Wed, May 18, 2011 at 4:42 PM, John Wheeler wrote: > Dude, > STATICFILES_DIRS = ('/home/jwheeler/projects/pwscheduler/static',) > STATIC_URL = '/static/' > TEMPLATE_LOADERS = ( > 'django.template.loaders.filesystem.Loader', > 'django.template.loaders.app_directories.Loader', > 'django.template.l

specify Postgres encoding as unicode

2011-05-18 Thread Thin Rhino
Hello, I am wondering if it is possible for me to specify the encoding to use for a postgresql database in the settings.py Going through the django documentation I could find how I could specify it for mysql. (http://docs.djangoproject.com/en/dev/ref/databases/) Tried google, but... !! My iss

Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-18 Thread Ivan Galic
Ok, I got it to work. Since the exception said " 'Site' matching query does not exist", and the docs said something about the SITE_ID describing the site in the django_site database table, I went ahead and took a look at my (sqlite) database. The django_site table was empty, so I added a row w

Intermediate table with custom to_field?

2011-05-18 Thread Carsten Fuchs
Hi all, in a many-to-many relationship, I would like to use a custom to_field, like in this intermediate model definition: class MitarbeiterBereiche(models.Model): mitarbeiter = models.ForeignKey(Mitarbeiter, to_field='key') bereich = models.ForeignKey(Bereich) class Meta:

Re: Static files

2011-05-18 Thread John Wheeler
I had to change return render_to_response('index.html', {'form': form}) to return render_to_response('index.html', {'form': form}, context_instance=RequestContext(request)) This very technical sounding bit escaped me If {{ STATIC_URL }} isn't working in your template, you're probably n

Re: specify Postgres encoding as unicode

2011-05-18 Thread Aditya Laghate
Thanks for your reply, will try it out on my setup :-) Cheers ThinRhino On 18 May 2011 21:26, Ernesto Guevara wrote: > Hello! > Open your pdAdminIII and create a database using UTF-8. > For aplication this is setting for your settings.py: > DEFAULT_CHARSET = 'utf-8' > FILE_CHARSET = 'utf-8' > >

Why is django-registration 0.8 not on PyPI?

2011-05-18 Thread cool-RR
Hey, Does anyone know what's up with django-registration 0.8 not being on PyPI? Ram. -- 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 emai

Re: specify Postgres encoding as unicode

2011-05-18 Thread Ernesto Guevara
Hello! Open your pdAdminIII and create a database using UTF-8. For aplication this is setting for your settings.py: DEFAULT_CHARSET = 'utf-8' FILE_CHARSET = 'utf-8' Regards! 2011/5/18 Thin Rhino > Hello, > > I am wondering if it is possible for me to specify the encoding to use for > a postgre

Re: retrieving current user in view

2011-05-18 Thread Oscar Carballal
As Daniel said, I dont' think also that the entire view is that, but if it helps, I'll let you a piece of my code for a form (gpl, no problem if you copy it). @permission_required('spaces.add_space') def create_space(request): """ Create new spaces. In this view the author field is automa

Re: Static files

2011-05-18 Thread Oscar Carballal
[OFFTOPIC] Whoa, I thought that only spanish people sounded rude (because of our way of talking between us) but now reading this mail (I mean no offense to John) I get the point of why our "talk-to-the-point" sounds pretty rude. 2011/5/18 Jacob Kaplan-Moss : > Hi John -- > > Next time, can you ple

Re: Static files

2011-05-18 Thread Jacob Kaplan-Moss
Hi John -- Next time, can you please try to be a bit more polite? If you adopted this sort of tone in person I'd write you off as a crazy person and get away as quickly as possible. What makes you think it's acceptable here? Most people -- and I'm one -- have a severe allergy to answering questio

Re: Why is django-registration 0.8 not on PyPI?

2011-05-18 Thread creecode
Hello Ram, James Bennett would be the final authority on that question. Perhaps because it's not actually been released as 0.8? It appears to be in alpha stage. Toodle-l... creecode -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Static files

2011-05-18 Thread Cal Leeming [Simplicity Media Ltd]
John, Just my two cents worth but, part of developing in Django is figuring out these kind of problems for yourself. Something you need to remember about Django, is that it isn't perfect, it's a community effort. If you think the devs have done something wrong, then do something about it by crea

Problem with Many2Many relations and intra-model class save() method

2011-05-18 Thread Marc Suñé
Hi everyone, We are developing a webapp using Django. We have found a problem with m2m relations. I will Expose a simplified example of the problem; say we have 2 classes: class A(models.Model): name = models.CharField(max_length = 128, default="", blank = True, null=True, verbose_na

Re: Django FCGI process randomly dying

2011-05-18 Thread Cal Leeming [Simplicity Media Ltd]
Might I recommend the OP try "Supervisor" (google for Supervisord and supervisorctl). They are absolutely marvellous for this sort of thing, we've been using it in production for over a year now :) On Wed, May 18, 2011 at 2:07 PM, Simon Connah wrote: > > On 18 May 2011, at 10:14, Vincent den Boe

Case insensitive filter

2011-05-18 Thread David
I have a table that stores file paths and it has about 80 million rows and I'm trying to optimize case insensitive SELECT queries. I have created an index on the lower() of the path column: CREATE INDEX lower_path_idx ON file_table ((lower(path))); A well constructed query like the one below uses

Database error: column table.column_id does not exist

2011-05-18 Thread wilbur
Hello, I continue to get errors when I try to view my model tables in Django admin (1.3.0). The errors invariably refer to the name of a foreign key defined in my models, with the '_id' appended to the name of the field. My understanding was that by using a 'related_name' in the column definition

Database error: column table.column_id does not exist

2011-05-18 Thread wilbur
Hello, I continue to get errors when I try to view my model tables in Django admin (1.3.0). The errors invariably refer to the name of a foreign key defined in my models, with the '_id' appended to the name of the field. My understanding was that by using a 'related_name' in the column definition

how transfer password hashes between old and new mysql databases for django app?

2011-05-18 Thread Chris Seberino
I am migrating my Django app from an old database to a new one with DIFFERENT model classes. How can I copy my passwords/hashes over? Is there some special way to copy over the hash? Is that even possible? A MySQL command line would be fine. cs -- You received this message because you are su

Re: Static files

2011-05-18 Thread John Wheeler
Yeah, I didn't mean to be a troll. I should've mentioned that everything else in django has been pretty fantastic despite this one, IMO, major usability oversight. Maybe I'm just not in with serving things off S3 or whatever you assume most people will do, which is probably a decent assumption

FormWizard not save data

2011-05-18 Thread Felipe Tomaz
how to save the information using the form FormWizard? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@go

Re: how transfer password hashes between old and new mysql databases for django app?

2011-05-18 Thread Shawn Milochik
Just copying them should work. The hashed password contains the hash type and salt, so it shouldn't make a difference. -- 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 uns

Re: Static files

2011-05-18 Thread Cal Leeming [Simplicity Media Ltd]
To be honest, you really shouldn't be using Django as a file server anyway :S On Wed, May 18, 2011 at 7:10 PM, John Wheeler wrote: > Yeah, I didn't mean to be a troll. I should've mentioned that everything > else in django has been pretty fantastic despite this one, IMO, major > usability oversig

Re: Database error: column table.column_id does not exist

2011-05-18 Thread Daniel Roseman
On Wednesday, May 18, 2011 6:46:49 PM UTC+1, wilbur wrote: > > Hello, > > I continue to get errors when I try to view my model tables in Django > admin (1.3.0). The errors invariably refer to the name of a foreign > key defined in my models, with the '_id' appended to the name of the > field. M

Re: Static files

2011-05-18 Thread Javier Guerra Giraldez
On Wed, May 18, 2011 at 1:10 PM, John Wheeler wrote: > Maybe I'm just not in with serving things off S3 or whatever you assume most > people will do not necesarily S3; but you definitely need a frontend webserver, which is much better for static files than Django -- Javier -- You received thi

Re: Admin page select boxes smashed

2011-05-18 Thread John
Just a heads up for anyone who comes across this. I inherited this project from someone else and did not realize that they copied all of the admin media files to a separate location. So when I did the diffs I did them on the wrong files. That is what it was though, messed up css files. Thanks. On

Re: Database error: column table.column_id does not exist

2011-05-18 Thread wilbur
Thanks for your help Daniel, that seems to have fixed my problem... On May 18, 12:27 pm, Daniel Roseman wrote: > On Wednesday, May 18, 2011 6:46:49 PM UTC+1, wilbur wrote: > > > Hello, > > > I continue to get errors when I try to view my model tables in Django > > admin (1.3.0). The errors invari

currval of sequence "sample_id_seq" is not yet defined in this session

2011-05-18 Thread wilbur
Hello, I have changed a number of field names and definitions in my models, and when I try to add a new record in the Django administration, I get the following error: currval of sequence "sample_id_seq" is not yet defined in this session When I look at the relevant postgresql table, the sequenc

Re: Anyone got experience of using django-fiber cms?

2011-05-18 Thread growlf
Actually, Django-CMS does have front-end editing, but it seems that the latest edition is a bit wonky atm with regards to the interface and the documentation on actually using it. I think the developers are moving towards a more stable MPTT solution, and this motion seems to be the cause. I have

Re: currval of sequence "sample_id_seq" is not yet defined in this session

2011-05-18 Thread Shawn Milochik
You have three choices. 1. Use South. #1 recommendation by me. http://south.aeracode.org/ 2. Delete your entire database and do another syncdb. 3. Write SQL manually to fix your database (don't do this). The reason is that, once you do syncdb and a table is created, running syncdb will never

Re: currval of sequence "sample_id_seq" is not yet defined in this session

2011-05-18 Thread wilbur
Thanks for responding Shawn, I am using south, and have tried using a schemamigration --auto on the database... I get the error: ? The field 'Photo_Log.sample_id' does not have a default specified, yet is NOT NULL. ? Since you are removing this field, you MUST specify a default ? value to use f

Re: currval of sequence "sample_id_seq" is not yet defined in this session

2011-05-18 Thread Shawn Milochik
Making manual changes to the database won't make a difference, as South just checks your Python models and not the database itself. In this case I'd set 'null = True, blank = True' in the model and run the migration. Then, if this really is a required field, then you should create a datamigr

Re: Static files

2011-05-18 Thread Kevin Monceaux
John, On Wed, May 18, 2011 at 09:12:59AM -0700, John Wheeler wrote: > I had to change > >return render_to_response('index.html', {'form': form}) > > to > >return render_to_response('index.html', {'form': form}, > context_instance=RequestContext(request)) And if you're running Django

Re: Static files

2011-05-18 Thread Kevin Monceaux
On Wed, May 18, 2011 at 03:03:42PM -0500, Kevin Monceaux wrote: > to: > >return render(response, 'index.html', {'form': form}) I should proof read more carefully. That should be: return render(request, 'index.html', {'form': form}) -- Kevin http://www.RawFedDogs.net http://www.Wac

pg_dump iom_catalog tables

2011-05-18 Thread William Hudspeth
pg_dump -C -h localhost -U wilbur -t achon_group -t achon_grouping -t brecciation -t chon_class -t chon_group -t chon_petro -t chon_petro_subtype -t iron_group -t iron_struc -t loan -t met_type -t metrefs1 -t other_notes -t photo_log -t sample -t sample_exporterrors -t specimen -t specimen_type -t

Re: Static files

2011-05-18 Thread Mário Neto
a detail, put only: urlpatterns += staticfiles_urlpatterns() instead: if settings.DEBUG: urlpatterns += staticfiles_urlpatterns() The django treat this in URLConf. 2011/5/18 Kevin Monceaux > On Wed, May 18, 2011 at 03:03:42PM -0500, Kevin Monceaux wrote: > > > to: > > > >return render(

Re: Need help with a form instance

2011-05-18 Thread piker
Thanks Oleg,that worked..its always the last thing that you try, isn't it? However.. I have it displaying beautifully now but it won't save.I can't pick whats wrong with this code that it won't save it.It just does nothing.Not even an error.If anyone can spot the mistake it would be much appreciate

modelformset_factory instance not saving

2011-05-18 Thread piker
I have a modelformset_factory instance displaying beautifully, but not saving to the database. If anyone can spot any mistake i've made in the code it would be much appreciated.(i'm using Django 1.3 by the way). def warning_entry (request): SpeciesFormSet = modelformset_factory(Species,fields=

Question

2011-05-18 Thread yevishere
Hi all, I am a newbie and I have a problem. I am using admin.py and I have a ton of numerical fields in columns I was wondering how I could have a little window where I could ask the user to filter a specific column by numerical value. Something like list all values from column 1, between 2 and 3.

Best django ecommerce aplication?

2011-05-18 Thread podio
I was thinking to migrate my page to python, I choose Django and know need a shop aplication I was thinking in http://satchmoproject.com/. There some other else better? Thanks! Sorry my english Im a bit rusty -- You received this message because you are subscribed to the Google Groups "Djang

Re: REMOTE_USER authentication to 'Admin'?

2011-05-18 Thread Jeff Blaine
I'm failing so far. I copied backends.py to my project root as mybackends.py I edited it and renamed ModelBackend to MyModelBackend I changed RemoteUserBackend(ModelBackend) to MyRemoteUserBackend(MyModelBackend) I changed settings.py to: AUTHENTICATION_BACKENDS = ( 'mybackends.MyRemoteUse

Virtualized Django app image for dev replication?

2011-05-18 Thread ydjango
I am thinking of creating a virtualized image of my complete django app with mysql so that I can clone/copy it on developers, qa and demo laptops. That way I do not have to do greenfield install on each developer computer which can take many hours. Any suggestions on what should I use - 1) vmware

Selecting distinct months from a QuerySet

2011-05-18 Thread Ian Turner
Hi, I would like to get a distinct list of months from a datetime field on an already defined QuerySet. SQL that I would use manually to get distinct from all records on the model. SELECT DISTINCT MONTH(`some_datetime_field`) as `month` FROM `some_model` ORDER BY `month` I don't need the year

Re: Virtualized Django app image for dev replication?

2011-05-18 Thread Martin Melin
On Thu, May 19, 2011 at 4:30 AM, ydjango wrote: > I am thinking of creating a virtualized image of my complete django > app with mysql so that I can clone/copy it on developers, qa and demo > laptops. That way I do not have to do greenfield install on each > developer computer which can take many

Re: retrieving current user in view

2011-05-18 Thread Michel30
This is the traceback: Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/ decorators.