Re: FeinCMS 1.3.0 final has been released!
Congratulations! I can't wait for what's to come! On Sun, Apr 10, 2011 at 11:44 PM, Matthias Kestenholzwrote: > Hello everyone > > FeinCMS 1.3.0 has just been released and is available at the usual places. > > > > What is FeinCMS anyway? > === > > > FeinCMS is one of the most advanced Content Management Systems built on top > of Django. FeinCMS not only includes a page module with many bundled > content > types (plugins), a media library and up-to-date documentation but also the > tools to build your own CMS if our view of how a page CMS is supposed to > act like does not fit your requirements. > > > PyPI: http://pypi.python.org/pypi/FeinCMS/ > Github: https://github.com/matthiask/feincms/ > Docs: http://www.feinheit.ch/media/labs/feincms/ > > Please report any issues you find in the issue tracker of github: > https://github.com/matthiask/feincms/issues > > > Changes since the last announcement mail (1.3.0.rc1): > > * The test runner has been converted to the class-based test runner API > * Several last-minute bugfixes > > > > This release would not have been possible without the contributions by the > community. Thanks for all the patches, bug reports and ideas which went > into > this release. > > > > > = > FeinCMS 1.3 release notes > = > > > FeinCMS 1.3 includes many bugfixes and cleanups and a number of new > features. > The cleanups and features caused a few backwards incompatible changes. The > upgrade path is outlined below. > > Highlights > == > > * FeinCMS pages use the standard Django permalink mechanism inside the > ``get_absolute_url`` implementation. This means that you have to update > the > URL definition if you did not include ``feincms.urls`` directly. > > Change this:: > > url(r'^$|^(.*)/$', 'feincms.views.base.handler'), > > to this:: > > url(r'', include('feincms.urls')), > > Defining the URL patterns directly is still possible. Have a look at > ``feincms.urls`` to find out how this should be done. > > * FeinCMS requires at least Django 1.2 but already has support for Django > 1.3 > features such as staticfiles. The FeinCMS media file folder has been moved > from ``feincms/media/feincms`` to ``feincms/static/feincms`` - if you use > ``django.contrib.staticfiles`` with Django 1.3 (and you should!), FeinCMS' > media files for the administration interface will automatically be made > available without any further work on your part. > > * Content types can specify the media files (Javascript and CSS files) they > need to work correctly. See :ref:`contenttypes-extramedia` for information > on how to use this in your own content types. > > * The content type loading process has been streamlined and requires much > less database queries than before. The performance hit on sites with deep > page hierarchies, inheritance and many regions is several times smaller > than before. > > * The content type interface has been extended with two new methods, > available > for all content types which need it: ``process`` is called before > rendering > pages and is guaranteed to receive the current request instance. Each and > every content type (not only application contents as before) has the > ability to return full HTTP responses which are returned directly to the > user. ``finalize`` is called after rendering and can be used to set > HTTP headers and do other post-processing tasks. See > :ref:`contenttypes-processfinalize` for more information. > > > (Backwards incompatible and other) Changes > == > > * The default ``ContentProxy`` has been rewritten to load all content type > instances on initialization. The instances stay around for the full > request-response cycle which allows us to remove many quasi-global > variables > (variables attached to the ``request`` object). The new initialization is > much more efficient in terms of SQL queries needed; the implementation is > contained inside the ``ContentProxy`` class and not distributed all over > the place. > > * The ``ContactFormContent`` has been updated to take advantage of the > new content type interface where content types can influence the > request-response cycle in more ways. > > * The ``ct_tracker`` extension has been rewritten to take advantage of the > new ``ContentProxy`` features. This means that the format of > ``_ct_inventory`` > could not be kept backwards compatible and has been changed. The inventory > is versioned now, therefore upgrading should not require any action on > your part. > > * ``feincms_site`` is not available in the context anymore. It was > undocumented, > mostly unused and badly named anyway. If you still need this functionality > you > should use ``django.contrib.sites`` directly yourself. > > * The ``_feincms_appcontent_parameters`` has been folded into the > ``_feincms_extra_context`` attribute on the current request. The >
run function on session.flush()
I would like to run a function (in my case, send an email summarizing recent activity) when a user logs out *or* when their session expires. Is there an easy way to do it without making a new version of the Session class? --~--~-~--~~~---~--~~ 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...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: mod_python setup on Apache virtual host
I just witnessed the same behavior but haven't found the solution. I'm using Ubuntu 8.04, Django 1.0, and Apache 2.2 with mod_python. Abe On Nov 15, 10:16 pm, Chuck22 <[EMAIL PROTECTED]> wrote: > I did not use ErrorDocument directives in my httpd.config. > > Here is my Apache error log: > > [Sun Nov 16 03:00:12 2008] [error] [client ] mod_python (pid=3296, > interpreter='domain.com', phase='PythonHandler', > handler='django.core.handlers.modpython'): Application error > [Sun Nov 16 03:00:12 2008] [error] [client ] ServerName: 'domain.com' > [Sun Nov 16 03:00:12 2008] [error] [client] DocumentRoot: 'C:/Apache/ > homedomain' > [Sun Nov 16 03:00:12 2008] [error] [client ] URI: '/' > [Sun Nov 16 03:00:12 2008] [error] [client ] Location: None > [Sun Nov 16 03:00:12 2008] [error] [client ] Directory: None > [Sun Nov 16 03:00:12 2008] [error] [client] Filename: 'C:/Apache/ > homedomain/' > [Sun Nov 16 03:00:12 2008] [error] [client] PathInfo: '' > [Sun Nov 16 03:00:12 2008] [error] [client ] Traceback (most recent > call last): > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\Lib\ > \site-packages\\mod_python\\importer.py", line 1537, in HandlerDispatch > \n default=default_handler, arg=req, silent=hlist.silent) > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\Lib\ > \site-packages\\mod_python\\importer.py", line 1229, in _process_target > \n result = _execute_target(config, req, object, arg) > [Sun Nov 16 03:00:12 2008] [error] [client ] File "C:\\Python25\\Lib\ > \site-packages\\mod_python\\importer.py", line 1128, in _execute_target > \n result = object(arg) > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\lib\ > \site-packages\\django\\core\\handlers\\modpython.py", line 222, in > handler\n return ModPythonHandler()(req) > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\lib\ > \site-packages\\django\\core\\handlers\\modpython.py", line 195, in > __call__\n response = self.get_response(request) > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\lib\ > \site-packages\\django\\core\\handlers\\base.py", line 128, in > get_response\n return self.handle_uncaught_exception(request, > resolver, exc_info) > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\lib\ > \site-packages\\django\\core\\handlers\\base.py", line 160, in > handle_uncaught_exception\n return callback(request, **param_dict) > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\lib\ > \site-packages\\django\\views\\defaults.py", line 88, in server_error > \n t = loader.get_template(template_name) # You need to create a > 500.html template. > [Sun Nov 16 03:00:12 2008] [error] [client] File "C:\\Python25\\lib\ > \site-packages\\django\\template\\loader.py", line 80, in get_template > \n source, origin = find_template_source(template_name) > [Sun Nov 16 03:00:12 2008] [error] [client ] File "C:\\Python25\\lib\ > \site-packages\\django\\template\\loader.py", line 73, in > find_template_source\n raise TemplateDoesNotExist, name > [Sun Nov 16 03:00:12 2008] [error] [client ] TemplateDoesNotExist: > 500.html > > It seems an internal applicaiton error - 500 error. But I don't know > where is the problem. Can you see what's wrong with my Virtual Host > setup? Or tell me what is the correct way to set up Apache Virtual > Host for Django. > > On Nov 16, 6:12 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote:> Are you setting ErrorDocument directives in Apache configuration? > > > If you are then disable them and then actual error may not be masked. > > > Have you looked in Apache error log for more information? > > > Graham > > > On Nov 16, 5:53 am, Chuck22 <[EMAIL PROTECTED]> wrote: > > > > Here is what I tried. > > > > > > > DocumentRoot "C:/Apache/homedomain" > > > ServerName domain.com > > > ServerAliaswww.domain.com > > > > SetEnv DJANGO_SETTINGS_MODULE homedomain.settings > > > SetHandler mod_python > > > PythonHandler django.core.handlers.modpython > > > PythonPath "['C:/Apache'] + sys.path" > > > PythonDebug On > > > > > > > > But I got error: > > > > *** > > > MOD_PYTHON ERROR > > > > ProcessId: 1708 > > > Interpreter: 'domain.com' > > > > ServerName: 'domain.com' > > > DocumentRoot: 'C:/Apache/homedomain' > > > > URI: '/' >
Re: Nice representation for Querying with ForeignKeys
If B has __unicode__ defined and the output is printed somehow, then it should display the output of __unicode__ whenever this happens. If this isn't being used in a string somehow, then just run a loop over the query set. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: list_filter in newforms-admin doesn't worj
ok, I'll do that. thanks -E On Jun 26, 5:13 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-06-25 at 16:10 +, abe wrote: > > > I'm using the newforms-admin branch, and have specified > > some admin options for a Experiment model like this > > > class ExperimentalDataOptions(admin.ModelAdmin): > > list_display = > > ('project_name','experiment_nr','experiment_date','short_title') > > search_fields = > > ('experiment_nr','project_name','experiment_date','title') > > list_filter = ('project_name',) # > > 'experiment_date','project_name',) > > > if I leaveout the list_filter line it works ok. > > with list_filter I get the following message > > > AttributeError at /yyy/admin/zb/experimentaldata/ > > type object 'ModelAdmin' has no attribute 'manager' > > Request Method:GET > > Request URL: https://xxx.xxx.xxx.xxx/yyy/admin/zb/experimentaldata/ > > Exception Type:AttributeError > > Exception Value: type object 'ModelAdmin' has no attribute 'manager' > > Exception Location:/usr/lib/python2.3/site-packages/django/contrib/ > > admin/filterspecs.py in __init__, line 161 > > Python Executable: /usr/bin/python > > Python Version:2.3.4 > > > Any idea how to get this working? > > I can't immediately see what is wrong. You'll either have to dive into > the code and work out what should be happening, or file a ticket in > Trac. Bugs reported to this list are not too likely to be remembered by > the newforms-admin developers when they next come to work on the code. > It's just too high-volume here to be an effective bug reporting forum. > > If you do file a ticket, include the smallest example possible that > fails. That might be a single field model with an admin class that only > has list_filter or something. That will make it easier for somebody to > repeat the problem. > > Regards, > Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
list_filter in newforms-admin doesn't worj
I'm using the newforms-admin branch, and have specified some admin options for a Experiment model like this class ExperimentalDataOptions(admin.ModelAdmin): list_display = ('project_name','experiment_nr','experiment_date','short_title') search_fields = ('experiment_nr','project_name','experiment_date','title') list_filter = ('project_name',) # 'experiment_date','project_name',) if I leaveout the list_filter line it works ok. with list_filter I get the following message AttributeError at /yyy/admin/zb/experimentaldata/ type object 'ModelAdmin' has no attribute 'manager' Request Method: GET Request URL:https://xxx.xxx.xxx.xxx/yyy/admin/zb/experimentaldata/ Exception Type: AttributeError Exception Value:type object 'ModelAdmin' has no attribute 'manager' Exception Location: /usr/lib/python2.3/site-packages/django/contrib/ admin/filterspecs.py in __init__, line 161 Python Executable: /usr/bin/python Python Version: 2.3.4 Any idea how to get this working? thanks, Eiso --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: __search works in mysterious ways.
On Mar 19, 11:41 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 3/19/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > That's not what I would have expected to see. Have a look at the SQL > > that Django is generating and see if there are any clues there. To do > > that, make sure you have DEBUG=True in your settings file (which you > > will have by default) and then do this: > > That's actually the correct behavior on MySQL -- it defaults to > ignoring words of less than four characters in full-text searches (it > also ignores "stop words"). > > These are configurable in MySQL via the 'ft_min_word_len' and > 'ft_stopword_file' options. hmm, I see, thanks. setting 'ft_min_word_len=2 solved it. still pretty annoying. could django take care of changing this setting? (assuming that this is not how __search is supposed to work). thanks -abe > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: __search works in mysterious ways.
On Mar 19, 11:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2007-03-19 at 14:09 +, abe wrote: > > I'm getting unexpected (missing) results from the __search field > > lookup > > it looks like it can only finds whole words, but only if they're > > larger than > > 3 chars. is this correct? and is it supposed to work like this? > > > In [65]: c.choice='ABC123\ncde456' > > > In [66]: c.save() > > > In [67]: Choice.objects.filter(choice__search='abc123') > > Out[67]: > > [ABC123 > > cde456] > > > In [68]: c.choice='ABC\ncde' > > > In [69]: c.save() > > > In [70]: Choice.objects.filter(choice__search='abc') > > Out[70]: [] > > That's not what I would have expected to see. me neither. > Have a look at the SQL > that Django is generating and see if there are any clues there. To do > that, make sure you have DEBUG=True in your settings file (which you > will have by default) and then do this: > > from django.db import connection > connection.query[-1]['sql'] nothing strange in the SQL I guess. In [16]: Choice.objects.filter(choice__search='ABC') Out[16]: [] In [17]: Choice.objects.filter(choice__search='efgh') Out[17]: [ABC efgh] In[18]: connection.queries[-2]['sql'] Out[18]: 'SELECT `polls_choice`.`id`,`polls_choice`.`poll_id`,`polls_choice`.`choice`,`polls_choice`.`votes` FROM `polls_choice` WHERE (MATCH (`polls_choice`.`choice`) AGAINST (ABC IN BOOLEAN MODE))' In [19]: connection.queries[-1]['sql'] Out[19]: 'SELECT `polls_choice`.`id`,`polls_choice`.`poll_id`,`polls_choice`.`choice`,`polls_choice`.`votes` FROM `polls_choice` WHERE (MATCH (`polls_choice`.`choice`) AGAINST (efgh IN BOOLEAN MODE))' -abe > > (from the interactive prompt). The connection.query object is a list of > all the SQL queries from the session -- or a single request if you are > using it in webserver mode. > > Regards, > Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
__search works in mysterious ways.
I'm getting unexpected (missing) results from the __search field lookup it looks like it can only finds whole words, but only if they're larger than 3 chars. is this correct? and is it supposed to work like this? In [65]: c.choice='ABC123\ncde456' In [66]: c.save() In [67]: Choice.objects.filter(choice__search='abc123') Out[67]: [ABC123 cde456] In [68]: c.choice='ABC\ncde' In [69]: c.save() In [70]: Choice.objects.filter(choice__search='abc') Out[70]: [] abe --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: error in SQL syntax for allow_empty=True in list_detail.py
thanks, that patch solved it. -abe On Feb 21, 4:52 pm, Michael Radziej <[EMAIL PROTECTED]> wrote: > abe: > > > > > I'm trying to call object_list in > > > django/views/generic/list_detail.py > > > with allow_empty=True > > > but if I use {{object_list.count}} in a template I get the following > > error: > > > (1064, "You have an error in your SQL syntax; check the manual that > > corresponds to your MySQL server version for the right syntax to use > > near 'count,1' at line 1") > > > the generated sql looks like: > > > SELECT DISTINCT > > `db_tmpcompound`.`id`,`db_tmpcompound`.`name`,`db_tmpcompound`.`mol_weight` > > FROM `db_tmpcompound` > > WHERE ((`db_tmpcompound`.`db_nr` < 5)) > > ORDER BY `db_tmpcompound`.`db_nr` ASC LIMIT count,1 > > See this ticket: > > http://code.djangoproject.com/ticket/2351 > > Michael > > -- > noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - > Tel +49-911-9352-0 - Fax +49-911-9352-100http://www.noris.de- The > IT-Outsourcing Company > > Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk - > Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: how to make a list of allowable arguments for filter()
> > I really tried hard to understand your problem, but then my brain > started to leak out of my ears and I had to stop. :-( > > Could you post an example of how all these models are related? You seem > to have Relmodl2, model2 and model1 and I'm not sure what all the > linkages are. > > I think what you are asking is why does the reverse end of a ForeignKey > show up in get_all_related_objects(), but the forward direction does > not. If that is the question, the forward direction (the ForeignKey > field itself), is just an object of class ForeignKey in the _meta.fields > attribute on the model it is defined on. So you need to inspect the > class types in _meta.fields to see which are the forwards relations. > > If that isn't your question, I apologise and ask only for a simple > example to illustrate the problem. > > Regards, > Malcolm sorry, shouldn't post so late I guess... I would like to make a list of allowable arguments for filter to supply that as a selection list on a search page. so I have to get a list of 'model__field' like strings derived from models (models.get_all_models()) class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(maxlength=200) votes = models.IntegerField() relfieldargs = ['%s__%s' % (m.model._meta.module_name,f.name) for m in Poll._meta.get_all_related_objects() for f in m.model._meta.fields ] relfieldargs: ['choice__id', 'choice__poll', 'choice__choice', 'choice__votes'] I can use these as (part of)arguments for filter Poll.objects.filter(choice__votes__gt=0) but the other way around doesn't work (from Choice->Poll) relfieldargs = ['%s__%s' % (m.model._meta.module_name,f.name) for m in Choice._meta.get_all_related_objects() for f in m.model._meta.fields ] relfieldargs: [] so I need some other way to get those. Now you seem to say that the answer is in here, In [18]: [f for f in Choice._meta.fields] Out[18]: [, , , ] which I can see. but how do a make an expression to test for foreignkey (except for 'fields.related' in `f` which seems a bit clumsy) and then of course I would like to find the 2nd (or higher) order cases too 'model1__model2__field_of_model2' any simple ways to find those? thanks for your help. abe --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: how to make a list of allowable arguments for filter()
sorry for the previous post. accidentally pressed send too early. I can find the models which have a certain model as a ForeignKey like this modl=models.get_model('myapp','model1') relfieldargs = ['%s__%s' % (m.model._meta.module_name,f.name) for m in modl._meta.get_all_related_objects() for f in m.model._meta.fields ] relfieldargs Out[ ]: ['relmodl2__id', 'relmodl2__name', 'relmodl2__foo', etc. ] where {relmodl2__name:value} etc can be use as argument to modl.objects.filter(...) this works if model Relmodl2 has model2 as ForeignKey but not the other way round. is there an eay way to find those model and field names? for example relmodl2.objects.filter({'model1__nr__gt':5}) where I'm looking for the other allowed strings like 'model1__nr' or is there an alltogether easier way to do this. thanks-abe --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
how to make a list of allowable arguments for filter()
I can find the models which have a certain model as a ForeignKey like this relfieldargs = ['%s__%s' % (m.model._meta.module_name,f.name) for m in models.get_model('zb','compound')._meta.get_all_related_objects() for f in m.model._meta.fields] --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
using curly brace in template
I wanted to use a {{forlppo.counter}} just behind a curly brace in a djang template {{{forloop.counter}}.0} but I get an error TemplateSyntaxError Exception Value:Could not parse the remainder: {forloop.counter can I somehow escape the curlybrace? -abe --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: psycopg installation error: C compiler cannot create executables
Sorry, ignore the "bold --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
psycopg installation error: C compiler cannot create executables
Hey all. Im trying to get django up and running on my Mac (powerbook, powerpc chip, 10.4 OSX). I got postgresql v 8.2.0 up and going, along with Python 2.4. I go to install psycopg to get the two communicating with one another, and, following the directions on the SetupOnTiger (http://code.djangoproject.com/wiki/SetupOnTiger) part of the Django page, got to configuring psycopg. When I typed ./configure --with-postgres-libraries=$(pg_config --libdir) --with-postgres-includes=$(pg_config --includedir) it gave me: bold -bash: pg_config: command not found -bash: pg_config: command not found checking for python... /Library/Frameworks/Python.framework/Versions/Current/bin/python checking python version... 2.4 checking python installation prefix... /Library/Frameworks/Python.framework/Versions/2.4 checking python installation exec_prefix... /Library/Frameworks/Python.framework/Versions/2.4 checking definitions in Python library makefile... done checking location of python library... $(prefix)/lib/python2.4/site-packages checking location of python shared modules... $(exec_prefix)/lib/python2.4/site-packages checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. Any ideas? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: manage.py syncdb error
Kenneth Gonsalves wrote: > On 08-Aug-06, at 7:37 PM, abe wrote: > > > > > I'm sometimes creating extra models, sometimes deleting an old model, > > and then run syncdb to update the database. > > if you are deleting old model, syncdb wont do it for you > I know, but the complaint is about an currently existing model. abe --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: manage.py syncdb error
Seth Buntin wrote: > Are you trying to insert initial data into you db when running this > script? not sure exactly what yuo mean by initial data. I'm sometimes creating extra models, sometimes deleting an old model, and then run syncdb to update the database. Eiso --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
manage.py syncdb error
if I apply syncdb for one of my apps ./manage.py syncdb xxapp I get the traceback below that ends with [...] _mysql_exceptions.IntegrityError: (1062, "Duplicate entry '17-add_status' for key 2") I can't find an obvious error in the database. does anyone know what could be wrong.? abe Traceback (most recent call last): File "./manage.py", line 11, in ? execute_manager(settings) File "/usr/lib/python2.3/site-packages/django/core/management.py", line 1226, in execute_manager execute_from_command_line(action_mapping) File "/usr/lib/python2.3/site-packages/django/core/management.py", line 1152, in execute_from_command_line action_mapping[action]() File "/usr/lib/python2.3/site-packages/django/core/management.py", line 472, in syncdb app=app, created_models=created_models) File "/usr/lib/python2.3/site-packages/django/dispatch/dispatcher.py", line 347, in send sender=sender, File "/usr/lib/python2.3/site-packages/django/dispatch/robustapply.py", line 47, in robustApply return receiver(*arguments, **named) File "/usr/lib/python2.3/site-packages/django/contrib/auth/management.py", line 34, in create_permissions p.save() File "/usr/lib/python2.3/site-packages/django/db/models/base.py", line 185, in save ','.join(placeholders)), db_values) File "/usr/lib/python2.3/site-packages/django/db/backends/util.py", line 12, in execute return self.cursor.execute(sql, params) File "/usr/lib/python2.3/site-packages/django/db/backends/mysql/base.py", line 31, in execute return self.cursor.execute(sql, params) File "/usr/lib/python2.3/site-packages/MySQLdb/cursors.py", line 137, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.IntegrityError: (1062, "Duplicate entry '17-add_status' for key 2") --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: admin apache solved? / now mysql problem
Andy Dustman wrote: > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > Andy Dustman wrote: > > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > Andy Dustman wrote: > > > > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > OperationalError: (2002, "Can't connect to local MySQL server > > > > > > through > > > > > > socket '/var/lib/mysql/mysql.sock' (13)") > > > > > > > > > > This indicates your MySQL server isn't running, > > > > I think it is, since the admin site works fine if I use > > > > manage.py runserver , doesn't it also use the server? > > > > > > > > %myproject]# ps -eadf|grep sql > > > > root 18240 18044 0 12:32 pts/200:00:00 /bin/sh > > > > /usr/bin/mysqld_safe > > > > mysql18268 18240 0 12:32 pts/200:00:00 /usr/libexec/mysqld > > > > --basedir=/usr --datadir=/var/lib/mysql --user=mysql > > > > --pid-file=/var/run/mysqld/mysqld.pid --skip-locking > > > > --socket=/var/lib/mysql/mysql.sock > > > > > > > > unless 'MYSQL server' means somthing different from mysqld ?? > > > > > > > > > > > > > and you are using DATABASE_HOST="localhost". > > > > well I use ='', but that should be the same > > > > > > > > but isn't that correct, since mysqld runs on the same host as django? > > > > > > Make sure apache can read /var/ilbmysql/mysql.sock. I'm a little > > how do I do that? I can't 'become' apache > > from the permissions it looks readable > > > > myproject$ ls -lst /var/lib/mysql/mysql.sock > > 4 srwxrwxrwx 1 mysql mysql 0 Mar 28 12:32 /var/lib/mysql/mysql.sock > > myproject$ ls -lst /tmp/mysql.sock > > But is the parent directory world-readable? i.e. ls -ld /var/lib/mysql looks so: ls -ld /var/lib/mysql drwxr-xr-x 5 mysql mysql 4096 Mar 29 10:30 /var/lib/mysql > > there a link to it in /tmp : > > 4 lrwxrwxrwx 1 mysql mysql 25 Mar 23 16:58 /tmp/mysql.sock -> > > /var/lib/mysql/mysql.sock > > [EMAIL PROTECTED] myproject]$ > > > > > surprised to see it put the socket there, since (on Gentoo) > > > /var/lib/mysql is only accessible by the user the mysql server runs > > > as, so it puts the socket (which needs to be world-readable and > > > writable) in /var/run. > > > > > > > > When you run manage.py runserver, are you running as root? > > yes (should I?), but I can also run as myself, doesn't matter > > You probably shoudn't run it as root on general principle. Make sure > you can access it as a non-root user. The error indicates it did not > get as far as the authentication phase so I am still leaning towards > filesystem permissions. > You're not running a chroot apache by any chance, are you? not that I know, but I didn't setup the system myself. how do I to find out? > SELinux? Some sort of virtualization? idem. it's a scientific linux installlation (RHEL-like), I saw the selinux libraries are installed. > I guess you could try 127.0.0.1 for the database host which will make it use > TCP > and see if that makes a difference. Ah, that helped! but I also had to change the mysqld that I'm running from /usr/bin/mysqld_safe (mysql 4) to /usr/local/mysql/bin/mysqld_safe (mysql 5) although the sockets they use are the same, and I still use mysqldb that is compiled with the mysql.h from mysql4 I can login to the admin site now, great! but it seems that the css files are not accessible because there is no layout . I copied the dir /usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/contrib/admin/media/css to /var/www// (where my project is, wasn't able to use it under my own dir) but that didn't help according to the admin page it expects the css in //css : my settings.py has: ADMIN_MEDIA_PREFIX = 'zbdb/' thanks for the help and patience, -E --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: admin apache solved? / now mysql problem
Todd O'Bryan wrote: > On Mar 28, 2006, at 8:20 AM, Andy Dustman wrote: > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > >> OperationalError: (2002, "Can't connect to local MySQL server through > >> socket '/var/lib/mysql/mysql.sock' (13)") > > > > This indicates your MySQL server isn't running, and you are using > > DATABASE_HOST="localhost". > > We saw this problem because the mysql.sock file was in /tmp/ instead > of /var/lib/mysql. A symbolic link from /var/lib/mysql/mysql.sock to / > tmp/mysql.sock solved the problem. this is already the case, see my previous post. -E --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: admin apache solved? / now mysql problem
Andy Dustman wrote: > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > > > Andy Dustman wrote: > > > On 3/28/06, abe <[EMAIL PROTECTED]> wrote: > > > > > > > OperationalError: (2002, "Can't connect to local MySQL server through > > > > socket '/var/lib/mysql/mysql.sock' (13)") > > > > > > This indicates your MySQL server isn't running, > > I think it is, since the admin site works fine if I use > > manage.py runserver , doesn't it also use the server? > > > > %myproject]# ps -eadf|grep sql > > root 18240 18044 0 12:32 pts/200:00:00 /bin/sh > > /usr/bin/mysqld_safe > > mysql18268 18240 0 12:32 pts/200:00:00 /usr/libexec/mysqld > > --basedir=/usr --datadir=/var/lib/mysql --user=mysql > > --pid-file=/var/run/mysqld/mysqld.pid --skip-locking > > --socket=/var/lib/mysql/mysql.sock > > > > unless 'MYSQL server' means somthing different from mysqld ?? > > > > > > > and you are using DATABASE_HOST="localhost". > > well I use ='', but that should be the same > > > > but isn't that correct, since mysqld runs on the same host as django? > > Make sure apache can read /var/ilbmysql/mysql.sock. I'm a little how do I do that? I can't 'become' apache from the permissions it looks readable myproject$ ls -lst /var/lib/mysql/mysql.sock 4 srwxrwxrwx 1 mysql mysql 0 Mar 28 12:32 /var/lib/mysql/mysql.sock myproject$ ls -lst /tmp/mysql.sock there a link to it in /tmp : 4 lrwxrwxrwx 1 mysql mysql 25 Mar 23 16:58 /tmp/mysql.sock -> /var/lib/mysql/mysql.sock [EMAIL PROTECTED] myproject]$ > surprised to see it put the socket there, since (on Gentoo) > /var/lib/mysql is only accessible by the user the mysql server runs > as, so it puts the socket (which needs to be world-readable and > writable) in /var/run. > > When you run manage.py runserver, are you running as root? yes (should I?), but I can also run as myself, doesn't matter thanks, -E --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: admin apache solved? / now mysql problem
Adrian Holovaty wrote: > On 3/24/06, abe <[EMAIL PROTECTED]> wrote: > > I get a blank screen (in the browser) and the > > httpd error logs say : > > > > [Fri Mar 24 18:36:09 2006] [notice] mod_python: (Re)importing module > > 'django.core.handlers.modpython' > > [Fri Mar 24 18:36:17 2006] [notice] child pid 13817 exit signal > > Segmentation fault (11) > > > > does anybody have an idea what goes wrong? > > Hey there, > > Check out the Django/mod_python docs for some possible explanations/solutions. > > http://www.djangoproject.com/documentation/modpython/#if-you-get-a-segmentation-fault > > Adrian slowly making progress... I removed mod_php from the httpd.conf and installed a newer version of MySQLdb (1.0 -> 1.2.0) It seems to get a bit further (not completely sure about that) but now mysql gives problems. If I try to reach te admin site I get the following error message in the browser window (just plain text, not the django error page type): Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py", line 165, in handler return ModPythonHandler()(req) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py", line 145, in __call__ response = middleware_method(request, response) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/middleware/sessions.py", line 74, in process_response session_key = request.session.session_key or sessions.get_new_session_key() File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/models/core.py", line 110, in _module_get_new_session_key get_object(session_key__exact=session_key) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/utils/functional.py", line 3, in _curried return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items())) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/meta/__init__.py", line 1355, in function_get_object obj_list = function_get_list(opts, klass, **kwargs) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/meta/__init__.py", line 1395, in function_get_list return list(function_get_iterator(opts, klass, **kwargs)) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/meta/__init__.py", line 1376, in function_get_iterator cursor = db.db.cursor() File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/db/backends/mysql.py", line 67, in cursor self.connection = Database.connect(**kwargs) File "/usr/lib/python2.3/site-packages/MySQLdb/__init__.py", line 66, in Connect return Connection(*args, **kwargs) File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line 134, in __init__ super(Connection, self).__init__(*args, **kwargs2) OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)") if I use manage.py runserver on the localhost, I get the normal admin login page. any idea's how to solve this? I googled for the error message but I don't find much django specific thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
admin apache
hi, trying to use the admin site vi apache/mod_python/mysql I get a blank screen (in the browser) and the httpd error logs say : [Fri Mar 24 18:36:09 2006] [notice] mod_python: (Re)importing module 'django.core.handlers.modpython' [Fri Mar 24 18:36:17 2006] [notice] child pid 13817 exit signal Segmentation fault (11) does anybody have an idea what goes wrong? -E --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
django/mod_python/apache import problem
hi, I'm having trouble getting django to work together with apache an mod_python if I try to access the admin page through my browser it displas the following message Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py", line 165, in handler return ModPythonHandler()(req) File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/core/handlers/modpython.py", line 130, in __call__ from django.conf import settings File "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/conf/settings.py", line 34, in ? raise EnvironmentError, "Could not import %s '%s' (is it on sys.path?): %s %s" % (ENVIRONMENT_VARIABLE, me.SETTINGS_MODULE, e,sys.path) EnvironmentError: Could not import DJANGO_SETTINGS_MODULE 'myproject.settings' (is it on sys.path?): No module named myproject.settings ['/data1/zbdb', '/usr/lib/python23.zip', '/usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk', '/usr/lib/python2.3/lib-dynload', '/usr/lib/python2.3/site-packages', '/usr/lib/python2.3/site-packages/PIL', '/usr/lib/python2.3/site-packages/setuptools-0.6a9-py2.3.egg', '/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg', '/usr/lib/python2.3/site-packages/gtk-2.0'] I added the printing of sys.path to "/usr/lib/python2.3/site-packages/Django-0.91-py2.3.egg/django/conf/settings.py" to see if the path is correct myproject.setting can't be imported but it should be on the sys.path because /data1/zbdb is in sys.path and /data1/zbdb/myproject/settings.py exists ls -lst /data1/zbdb/myproject/settings.py 8 -rw-r--r-- 1 root root 2601 Mar 22 20:32 /data1/zbdb/myproject/settings.py this is in my httpd.conf SetHandler python-program PythonPath "['/data1/zbdb'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE myproject.settings PythonDebug On PythonAutoReload On Any idea what am I doing wrong? thanks, E --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: table needs all fields filled in?
thanks, that seems to work. having trouble understanding what this core=True is actually meaning. -E --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
table needs all fields filled in?
hi, I use the class below to define molecule properties: In the admin interface I get a nice mol_properties table to fill, but the values are only accepted if I enter values for all columns of the table. Is this correct behaviour? What can I do to make it accept a partially filled in table? class MolProperties(meta.Model): compound = meta.ForeignKey(Compound,edit_inline=meta.TABULAR,num_in_admin=1,unique=True) mol_weight = meta.FloatField(max_digits=8,decimal_places=4,blank=True,core=True) ClogP_calc = meta.FloatField(max_digits=8,decimal_places=4,blank=True,core=True) ClogP_exp = meta.FloatField(max_digits=8,decimal_places=4,blank=True,core=True,) solubility = meta.CharField(maxlength=600,blank=True,core=True,) solubilize_howto = meta.CharField(maxlength=600,blank=True,core=True,) class META: db_table = 'mol_properties' admin=meta.Admin() def __repr__(self): return `self.compound_id` --thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: mod_python error (help please)
Maniac, Thanks for your quick response and the reference. I looked into the symlinking going on... I'm not entirely sure what the root cause was, but I deleted the symlink, copied the files to the ...site-packages directory and viola! everything is cool. Cheers, Abe
mod_python error (help please)
I've searched through the documentation on the djangoproject page, and several of the postings here... but I have not been able to solve a mysterious mod_python problem: --snip-- Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch log=debug) File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 454, in import_module f, p, d = imp.find_module(parts[i], path) ImportError: No module named django --snip-- Any ideas? Cheers, Abe