Re: Multithreaded Dev Server
http://www.oebfare.com/blog/2008/nov/03/writing-custom-management-command/ The CherryPy WSGI server should make this really, you could probably even deploy on it if you wanted. On Nov 16, 1:15 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Nov 16, 4:40 pm, Chris <[EMAIL PROTECTED]> wrote: > > > I understand what you're saying. It's just unfortunate we're throwing > > out the convenience of the dev server. > > > What's up withhttp://code.djangoproject.com/ticket/3357?Looks like > > this idea isn't new. > > Using daemon mode of mod_wsgi can almost give you the convenience you > want. The main issue with Apache is generally the need to restart > Apache on all code changes. With mod_wsgi daemon mode, you only need > touch the modification time of the WSGI script file after a set of > code changes have been made and mod_wsgi will ensure application is > reloaded. If you want, you can add your own monitor thread which looks > for changed files and automatically triggers an application restart. > See: > > http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode > > Graham > > > Chris > > > On Nov 16, 12:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > > wrote: > > > > On Sat, 2008-11-15 at 21:17 -0800, Chris wrote: > > > > Do you mean easier in that runserver doesn't support multithreading at > > > > all? Or easier in that it supports multi-threading, but it's difficult > > > > to set up? > > > > The dev server is single-threaded by design. It wouldn't be impossible > > > to make it multi-threaded with code changes, but it would be fiddly and > > > in the past we've said we really aren't interested, since it adds a lot > > > of maintenance burden. If you want multi-threaded behaviour, use a real > > > web server. > > > > 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 -~--~~~~--~~--~--~---
Re: Multithreaded Dev Server
On Nov 16, 4:40 pm, Chris <[EMAIL PROTECTED]> wrote: > I understand what you're saying. It's just unfortunate we're throwing > out the convenience of the dev server. > > What's up withhttp://code.djangoproject.com/ticket/3357? Looks like > this idea isn't new. Using daemon mode of mod_wsgi can almost give you the convenience you want. The main issue with Apache is generally the need to restart Apache on all code changes. With mod_wsgi daemon mode, you only need touch the modification time of the WSGI script file after a set of code changes have been made and mod_wsgi will ensure application is reloaded. If you want, you can add your own monitor thread which looks for changed files and automatically triggers an application restart. See: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode Graham > Chris > > On Nov 16, 12:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > > On Sat, 2008-11-15 at 21:17 -0800, Chris wrote: > > > Do you mean easier in that runserver doesn't support multithreading at > > > all? Or easier in that it supports multi-threading, but it's difficult > > > to set up? > > > The dev server is single-threaded by design. It wouldn't be impossible > > to make it multi-threaded with code changes, but it would be fiddly and > > in the past we've said we really aren't interested, since it adds a lot > > of maintenance burden. If you want multi-threaded behaviour, use a real > > web server. > > > 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 -~--~~~~--~~--~--~---
Re: Multithreaded Dev Server
On Sun, Nov 16, 2008 at 12:40 AM, Chris <[EMAIL PROTECTED]> wrote: > I understand what you're saying. It's just unfortunate we're throwing > out the convenience of the dev server. If you're not interested in setting up something like apache, you can also maybe use one of the pure python servers out there. See: http://www.eflorenzano.com/blog/post/hosting-django-site-pure-python/ -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: mod_python setup on Apache virtual host
On Sat, 2008-11-15 at 21:36 -0800, Chuck22 wrote: > Because my application works fine with Django development server > (http://locahost:8000) on the same machine, I assume the problem does > not reside in my application code. Then it must be due to the > configuration of Apache. Presumably that's a reply to my question about why you are suspecting your VirtualHost configuration? Or is it an answer to something else? > Do I need to modify my code to make it work > with Apache/mod_python? Not necessarily, but you'll see what the real error is and why Django is raising it. The error you posted the first time was Django reporting a different problem (that you're missing a 500.html template). Now that we can see the real error, it help narrow down whether it's a configuration issue, or a file permission issue (which could be one difference) or a database access issue (another difference), etc. In this case, seeing the error suggests almost immediately what the problem is likely to be: > > Here is the information after I set DEBUG=True. > > * > ViewDoesNotExist at / > Could not import views. Error was: No module named viewsRequest > Method: GET > Request URL: http://www.domain.com/ > Exception Type: ViewDoesNotExist > Exception Value: Could not import views. Error was: No module named > views > Exception Location: C:\Python25\lib\site-packages\django\core > \urlresolvers.py in _get_callback, line 132 > Python Executable: C:\Program Files\Apache Software Foundation > \Apache2.2\bin\httpd.exe > Python Version: 2.5.2 > > > Traceback Switch to copy-and-paste view See that last line? In future, it will be better to click on that and use the cut-and-paste view when cutting and pasting. Makes things a lot easier to read. The view you pasted is good for viewing in a web browser, but it's obviously a bit verbose for an email message. Not to worry this time, since you've provided the information needed, but keep it in mind for the future. Trimming the next bunch of lines -- since they're important to know, but in this case just say the problem occurred when trying to resolve the initial URL -- we get to this: > Exception Value: Could not import views. Error was: No module named > views So it cannot import a particular file. This suggests one of two problems. Either your Python path isn't set correctly (how to set that is documented in Django's mod_python documentation) or Apache doesn't have permission to read the file or one of the directories leading to the file. Check your Python path to make sure it includes the parent directories of everything you import. If that's correct, check that Apache has permission to read the necessary files (I have absolutely no idea what permission setting/enforcement involves on a Windows system). 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 -~--~~~~--~~--~--~---
Re: Multithreaded Dev Server
On Sat, 2008-11-15 at 21:40 -0800, Chris wrote: [...] > What's up with http://code.djangoproject.com/ticket/3357 ? Looks like > this idea isn't new. Actually, it shows that there are people who can't read instructions. Once a ticket has been wontifxed by a developer, it shouldn't be reopened without discussion on django-dev and agreement from the maintainers. That's happened not once, but twice on that ticket. It's just not that hard to read and understand contributing.txt. It's written with small words and short sentences. People ignore it at their peril. 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 -~--~~~~--~~--~--~---
Re: Multithreaded Dev Server
I understand what you're saying. It's just unfortunate we're throwing out the convenience of the dev server. What's up with http://code.djangoproject.com/ticket/3357 ? Looks like this idea isn't new. Chris On Nov 16, 12:30 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-11-15 at 21:17 -0800, Chris wrote: > > Do you mean easier in that runserver doesn't support multithreading at > > all? Or easier in that it supports multi-threading, but it's difficult > > to set up? > > The dev server is single-threaded by design. It wouldn't be impossible > to make it multi-threaded with code changes, but it would be fiddly and > in the past we've said we really aren't interested, since it adds a lot > of maintenance burden. If you want multi-threaded behaviour, use a real > web server. > > 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 -~--~~~~--~~--~--~---
Re: mod_python setup on Apache virtual host
Because my application works fine with Django development server (http://locahost:8000) on the same machine, I assume the problem does not reside in my application code. Then it must be due to the configuration of Apache. Do I need to modify my code to make it work with Apache/mod_python? Here is the information after I set DEBUG=True. * ViewDoesNotExist at / Could not import views. Error was: No module named viewsRequest Method: GET Request URL: http://www.domain.com/ Exception Type: ViewDoesNotExist Exception Value: Could not import views. Error was: No module named views Exception Location: C:\Python25\lib\site-packages\django\core \urlresolvers.py in _get_callback, line 132 Python Executable: C:\Program Files\Apache Software Foundation \Apache2.2\bin\httpd.exe Python Version: 2.5.2 Traceback Switch to copy-and-paste view C:\Python25\lib\site-packages\django\core\handlers\base.py in get_response # Get urlconf from request object, if available. Otherwise use default.urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)resolver = urlresolvers.RegexURLResolver (r'^/', urlconf)try:callback, callback_args, callback_kwargs = resolver.resolve (request.path_info) ...# Apply view middlewarefor middleware_method in self._view_middleware:response = middleware_method (request, callback, callback_args, callback_kwargs)if response:return response? Local vars Variable Value exc_info (, ViewDoesNotExist('Could not import views. Error was: No module named views',), ) exceptions middleware_method > receivers [(, None)] request , POST:, , META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0L, 'CONTENT_TYPE': 'httpd/unix-directory', 'GATEWAY_INTERFACE': 'CGI/ 1.1', 'HTTP_ACCEPT': '*/*', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', ;q=0.5', 'HTTP_CONNECTION': 'Keep-Alive', , 'HTTP_HOST': 'www.domain.com', 'HTTP_IF_MODIFIED_SINCE': 'Sat, 15 Nov 2008 03:40:20 GMT', , 'HTTP_UA_CPU': 'x86', ', 'PATH_INFO': u'/', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, , 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'domain.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}> resolver response None self settings urlconf 'homedomain.urls' urlresolvers C:\Python25\lib\site-packages\django\core\urlresolvers.py in resolve def resolve(self, path):tried = []match = self.regex.search(path)if match:new_path = path [match.end():]for pattern in self.urlconf_module.urlpatterns: try:sub_match = pattern.resolve (new_path) ...except Resolver404, e:tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']]) else:if sub_match: sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict ().items()])sub_match_dict.update (self.default_kwargs)? Local vars Variable Value match <_sre.SRE_Match object at 0x02140AA0> new_path u'' path u'/' pattern self sub_match None tried ['^admin/(.*)'] C:\Python25\lib\site-packages\django\core\urlresolvers.py in resolve if kwargs:args = () else:args = match.groups()# In both cases, pass any extra_kwargs as **kwargs.kwargs.update (self.default_args)return self.callback, args, kwargs ...def _get_callback(self):if self._callback is not None:return self._callbacktry: self._callback = get_callable(self._callback_str)? Local vars Variable Value args () kwargs {} match <_sre.SRE_Match object at 0x022FA330> path u'' self C:\Python25\lib\site-packages\django\core\urlresolvers.py in _get_callback def _get_callback(self):if self._callback is not None:return self._callbacktry: self._callback = get_callable(self._callback_str)except ImportError, e:mod_name, _ = get_mod_func (self._callback_str)raise ViewDoesNotExist, "Could not import %s. Error was: %s" % (mod_name, str(e)) ...except AttributeError, e:mod_name, func_name = get_mod_func (self._callback_str)raise ViewDoesNotExist, "Tried %s in module %s. Error was: %s" % (func_name, mod_name, str(e)) return self._callbackcallback = property(_get_callback)? Local vars Variable Value _ 'index' e ImportError('No module named views',) mod_name 'views' self Environment: Request Method: GET Request URL: http://www.domain.com/ Django Version: 1.0-final-SVN-unknown Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'homedomain.product'] Installed Middleware:
Re: Multithreaded Dev Server
On Sat, 2008-11-15 at 21:17 -0800, Chris wrote: > Do you mean easier in that runserver doesn't support multithreading at > all? Or easier in that it supports multi-threading, but it's difficult > to set up? The dev server is single-threaded by design. It wouldn't be impossible to make it multi-threaded with code changes, but it would be fiddly and in the past we've said we really aren't interested, since it adds a lot of maintenance burden. If you want multi-threaded behaviour, use a real web server. 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 -~--~~~~--~~--~--~---
Re: Multithreaded Dev Server
Do you mean easier in that runserver doesn't support multithreading at all? Or easier in that it supports multi-threading, but it's difficult to set up? I'd like to use the dev server, because, well, I'm developing. On Nov 16, 12:14 am, "David Zhou" <[EMAIL PROTECTED]> wrote: > On Sun, Nov 16, 2008 at 12:11 AM, Chris <[EMAIL PROTECTED]> wrote: > > I'm trying to write a basic Ajax app, which submits a file in one long- > > running request, and periodically polls the status in another request. > > However, it seems like runserver is single threaded, so the second > > request just hangs until the file upload completes, preventing the > > status update. Is there any way to make the dev server multi-threaded? > > It's probably easier to just use apache at that point. > > -- > --- > David Zhou > [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 create a form with dynamic number of fields?
Dear all, Could anyone here please let me know of the logic or example of doing a form with dynamic number of fields (ie. a field with a 'Add more field' button). I know how to do it using javascript. However it's the logic behind that gets me. Suggestions? -- Low Kian Seong blog: http://lowkster.blogspot.com --~--~-~--~~~---~--~~ 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: Multithreaded Dev Server
On Sun, Nov 16, 2008 at 12:11 AM, Chris <[EMAIL PROTECTED]> wrote: > I'm trying to write a basic Ajax app, which submits a file in one long- > running request, and periodically polls the status in another request. > However, it seems like runserver is single threaded, so the second > request just hangs until the file upload completes, preventing the > status update. Is there any way to make the dev server multi-threaded? It's probably easier to just use apache at that point. -- --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Multithreaded Dev Server
I'm trying to write a basic Ajax app, which submits a file in one long- running request, and periodically polls the status in another request. However, it seems like runserver is single threaded, so the second request just hangs until the file upload completes, preventing the status update. Is there any way to make the dev server multi-threaded? Thanks, Chris --~--~-~--~~~---~--~~ 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: Models Not Showing In Admin
On Sat, 2008-11-15 at 21:06 -0800, Chris wrote: > Heh, thanks. That answers my question exactly. > > Are there any plans on removing the obsolete docs, or at least > forwarding users to the new docs? Django's documentation (http://docs.djangoproject.com/ -- also redirect to from django.project.com/docs/ ) is already fully up to date (including the tutorials). What you are reading is a book that, whilst written by some of the people who also contribute to Django in a significant fashion, is not part of Django itself. We can't be responsible for third-party documentation. 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 -~--~~~~--~~--~--~---
Re: Models Not Showing In Admin
Heh, thanks. That answers my question exactly. Are there any plans on removing the obsolete docs, or at least forwarding users to the new docs? It seems like everything that comes up in a Google search is 5 years out of date. On Nov 15, 10:38 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-11-15 at 19:28 -0800, Chris wrote: > > I'm trying to get my models to show in admin. I've followed > >http://www.djangobook.com/en/1.0/chapter06/and while I'm able to > > login to admin and view the Auth and Sites sections, I can't see my > > models even though they have the Admin class and the correct > > middleware's enabled. Is there some other step the guide's not > > mentioning, or some obscure gotcha that would prevent models from > > showing in admin? > > This thread from earlier today will be of use to you: > > http://groups.google.com/group/django-users/browse_thread/thread/9f6c... > > 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 -~--~~~~--~~--~--~---
Re: ANN: Django 1.0.1 released
On Sat, Nov 15, 2008 at 8:42 PM, James Bennett <[EMAIL PROTECTED]> wrote: > 1. When I rolled the release last night, I did 'python manage.py > sdist' to generate the package, then uploaded it to the > djangoproject.com server. (and obviously I meant 'setup.py sdist') -- "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: mod_python setup on Apache virtual host
On Sat, 2008-11-15 at 19:16 -0800, Chuck22 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 > \ndefault=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 > \nresult = _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 > \nresult = 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\nreturn 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__\nresponse = 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\nreturn 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\nreturn 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 > \nt = 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 > \nsource, 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\nraise 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. Why are you assuming this is a problem with your VirtualHost configuration in apache? We can see from the traceback that Django code is being run, which means that Apache is correctly handing off processing of the request to Django and Django isn't able to return a valid response. So the real question is why is Django raising some kind of uncaught exception. One simple way to resolve that is to set DEBUG=True in your settings file and reload the page, which will then give you a bunch of information. 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 -~--~~~~--~~--~--~---
Re: Models Not Showing In Admin
On Sat, 2008-11-15 at 19:28 -0800, Chris wrote: > I'm trying to get my models to show in admin. I've followed > http://www.djangobook.com/en/1.0/chapter06/ and while I'm able to > login to admin and view the Auth and Sites sections, I can't see my > models even though they have the Admin class and the correct > middleware's enabled. Is there some other step the guide's not > mentioning, or some obscure gotcha that would prevent models from > showing in admin? This thread from earlier today will be of use to you: http://groups.google.com/group/django-users/browse_thread/thread/9f6c7e7de23d3388 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 -~--~~~~--~~--~--~---
Models Not Showing In Admin
I'm trying to get my models to show in admin. I've followed http://www.djangobook.com/en/1.0/chapter06/ and while I'm able to login to admin and view the Auth and Sites sections, I can't see my models even though they have the Admin class and the correct middleware's enabled. Is there some other step the guide's not mentioning, or some obscure gotcha that would prevent models from showing in admin? Thanks, Chris --~--~-~--~~~---~--~~ 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: mod_python setup on Apache virtual host
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 \ndefault=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 \nresult = _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 \nresult = 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\nreturn 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__\nresponse = 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\nreturn 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\nreturn 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 \nt = 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 \nsource, 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\nraise 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: '/' > > Location: None > > Directory: None > > Filename: 'C:/Apache/homedomain/' > > PathInfo: '' > > > Phase: 'PythonHandler' > > Handler: 'django.core.handlers.modpython' > > > Traceback (most recent call last): > > > File "C:\Python25\Lib\site-packages\mod_python\importer.py", line > > 1537, in HandlerDispatch > > default=default_handler, arg=req, silent=hlist.silent) > > > File "C:\Python25\Lib\site-packages\mod_python\importer.py", line > > 1229, in _process_target > > result = _execute_target(config, req, object, arg) > > > File "C:\Python25\Lib\site-packages\mod_python\importer.py", line > > 1128, in _execute_target > > result = object(arg) > > > File "C:\Python25\lib\site-packages\django\core\handlers > > \modpython.py", line 222, in handler > > return ModPythonHandler()(req) > > > File "C:\Python25\lib\site-packages\django\core\handlers >
Re: ManyToManyField with multiple model options
On Sat, 2008-11-15 at 19:01 -0800, Luke Seelenbinder wrote: > That was a typo. The error I'm getting is > "ForeignKey cannot define a relation with abstract class Word" > It is a ManyToMany through table, that's the reason it is ForeignKey One of the many problems with top-posting is that I can't tell what you're replying to. So I need to guess. I guess that "that was a typo" is where you used "def" instead of "class".. > > On Sat, 2008-11-15 at 06:57 -0800, Luke Seelenbinder wrote: > > > Basically, I want to allow a ManyToManyField to use any of a Model's > > > children, like this: > > > > > class Word(models.Model): > > > word = models.CharField(...) > > > > > class Meta: > > > abstract = True You can't do what you're trying to do in that fashion (using ManyToManyField to an abstract base class). Many-to-many and foreign-key relations are relations between one table to another table, not to many other tables. They model the database's idea of relations. That's why they aren't allowed to be declared for abstract models (which aren't really models at all). You could, however, model this using an intermediate table with generic relations, which allows links to multiple types of remote models through a content-type field. You won't be able to use anything like "through", but that's really just a kind of syntactic sugar anyway. You can write the same sorts of queries referring to the intermediate model explicitly. 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 -~--~~~~--~~--~--~---
Re: ManyToManyField with multiple model options
That was a typo. The error I'm getting is "ForeignKey cannot define a relation with abstract class Word" It is a ManyToMany through table, that's the reason it is ForeignKey Luke On Nov 15, 8:29 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-11-15 at 06:57 -0800, Luke Seelenbinder wrote: > > Basically, I want to allow a ManyToManyField to use any of a Model's > > children, like this: > > > class Word(models.Model): > > word = models.CharField(...) > > > class Meta: > > abstract = True > > > class Noun(Word): > > gender = models.CharField(...) > > class Verb(Word): > > irregular = models.BooleanField(...) > > > #Here is where I need the help > > def WordStats(models.Model): > > This isn't valid Python. It looks like a cross between defining a > function and defining a class. > > > word = models.ManyToManyField(Word) > > This isn't valid. Model field belong in models, not functions. I suspect > you've just made a typo and typed "def" above when you meant "class". If > you've actually mentioned what the error you were seeing was (or read it > carefully), I suspect that Python would have told you basically that. > > > stats = ... > > > Is there anyway to accomplish this? Without writing separate models > > for each word. > > A many-to-many field to the Word model is an appropriate approach. > > 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 -~--~~~~--~~--~--~---
Re: ANN: Django 1.0.1 released
On Sat, Nov 15, 2008 at 7:48 AM, leonel <[EMAIL PROTECTED]> wrote: > Ive downloaded the tar.gz from > http://www.djangoproject.com/download/1.0.1/tarball/ > > and the md5sum does not match the md5sum from: > http://media.djangoproject.com/pgp/Django-1.0.1-final.checksum.txt OK, so here's what happened: 1. When I rolled the release last night, I did 'python manage.py sdist' to generate the package, then uploaded it to the djangoproject.com server. 2. I then made my fatal error, which was that I uploaded it to the Cheese Shop via 'python setup.py sdist upload'. 3. And then I did the checksums and placed the signed file on djangoproject.com. Astute readers will notice what I did not, namely that step 2 re-generated the package, resulting in a tarball whose constituent files and directories have slightly different creation times than the package from step 1. And as a result, the checksums of the package generated in step 2 are different from the checksums of the package generated in step 1 -- even though their unpacked contents are identical -- because 'tar' stores information about creation time in the resulting compressed file. So I've replaced the package on djangoproject.com with the copy generated in step 2 above, and we've verified that its contents and its checksums match exactly. Your friendly local release manager apologizes for the inconvenience, and will now go find someplace to hang his head in shame. -- "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: No models show up in my admin interface
Karen, Many thanks, that site was just what I was looking for. On Nov 16, 9:27 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 15, 2008 at 7:13 PM, dash86no <[EMAIL PROTECTED]> wrote: > > I'm a little confused, and would appreciate it if somebody could point > > me to the current "authoritative" tutorials, so I can begin to get > > back on the right path here. > > Yes, the book is out of date, published several months before Django 1.0 > was released. The way in which admin specifications are done is entirely > different now. The live documentation that gets updated when code changes > is here: > > http://docs.djangoproject.com/en/dev/ > > Note the vast changes Django underwent from 0.96 to 1.0 will not continue > from 1.0 to 1.1, etc. One big promise of 1.0 is backwards compatibility, > see: > > http://docs.djangoproject.com/en/dev/misc/api-stability/ > > Karen --~--~-~--~~~---~--~~ 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: Query spanning two foreign keys
On Sat, 2008-11-15 at 17:09 -0800, Will McCutchen wrote: > Hi all, > > I've got the following models (simplified for this example): > > from django.db import models > from django.contrib.auth.models import User > > class Chat(models.Model): > name = models.CharField(max_length=256) > > class Post(models.Model): > user = models.ForeignKey(User, related_name='posts') > parent = models.ForeignKey(Chat, related_name='posts') > > Can anyone tell me the best way to get a unique list of the users who > have contributed to a specific chat? I can do something like the > following, but I feel like there must be a more elegant way: > > >>> chat = Chat.objects.get(pk=1) > >>> user = set([post.user for post in chat.posts.all()]) > > Any suggestions? Do I need to resort to raw SQL? This should do the job: User.objects.filter(posts__parent__pk=1).distinct() 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 -~--~~~~--~~--~--~---
Re: ANN: Django 1.0.1 released
On Sat, Nov 15, 2008 at 7:37 PM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Yep, looks like something went wrong there. James is offline at the > moment, but he'll fix it when he gets a chance. The security-aware user > will avoid using the tarballs until they're fixed. I'm looking into it. -- "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: Templates and method arguments for thumbnails
On Sat, 2008-11-15 at 12:16 -0800, [EMAIL PROTECTED] wrote: > Hi, > > From the django documentation, it looks like it is not possible to > pass arguments to methods from the template HTML code. > > For example: > > class MyModel(Model): > def foo(self): > return 'This works' > > can be accessed by: {{ mymodel.foo }} in an HTML template. > > What I am trying to do, however, is to access data based on arguments > for this method. This is my example scenario: I have several high > resolution photographs, and I want to be able to write some code that > displays thumbnails: [...] > Is there a cleaner or better way to do this? A template tag. Template tags are the way to do any complex processing. Filters just access existing data very simply and return them. The latter intentionally don't take arguments; that isn't an oversight. The syntax difference is a partial clue to the template writer that there's something more complex going on in the background. 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 -~--~~~~--~~--~--~---
Re: Forms Datefield ?
On Sat, 2008-11-15 at 22:37 +0100, [EMAIL PROTECTED] wrote: > hi, how do I change a datefield to d.m.Y in a form inherited from modelform ? You can't change that automatically. You will need to create a subclass of the model field that overrides the formfield() method to return a forms.DateField with an appropriate input_formats parameter passed in. In Django 1.1 there'll be optional support in the i18n framework so that every locale will use their native date format (d/m/Y pretty much everywhere except en-US) and that should make this a less common question. 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 -~--~~~~--~~--~--~---
Re: ANN: Django 1.0.1 released
On Sat, 2008-11-15 at 13:31 -0500, BraneSKS wrote: > I am getting the same thing for the md5 sum. Downloaded through > Firefox 3.0.4 and Safari 3.1.2 on Mac OS X.5.5. Yep, looks like something went wrong there. James is offline at the moment, but he'll fix it when he gets a chance. The security-aware user will avoid using the tarballs until they're fixed. 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 -~--~~~~--~~--~--~---
Re: ManyToManyField with multiple model options
On Sat, 2008-11-15 at 06:57 -0800, Luke Seelenbinder wrote: > Basically, I want to allow a ManyToManyField to use any of a Model's > children, like this: > > class Word(models.Model): > word = models.CharField(...) > > class Meta: > abstract = True > > class Noun(Word): >gender = models.CharField(...) > class Verb(Word): >irregular = models.BooleanField(...) > > #Here is where I need the help > def WordStats(models.Model): This isn't valid Python. It looks like a cross between defining a function and defining a class. >word = models.ManyToManyField(Word) This isn't valid. Model field belong in models, not functions. I suspect you've just made a typo and typed "def" above when you meant "class". If you've actually mentioned what the error you were seeing was (or read it carefully), I suspect that Python would have told you basically that. >stats = ... > > Is there anyway to accomplish this? Without writing separate models > for each word. A many-to-many field to the Word model is an appropriate approach. 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 -~--~~~~--~~--~--~---
Re: checkbox and BooleanField
On Sat, 2008-11-15 at 15:28 +0100, Alfredo Alessandrini wrote: > Hi, > > I've this template: > > type="radio" checked /> > /> > type="radio" /> > > > And this View: > > class MoveGameForm(forms.Form): > resign = forms.BooleanField(required=False) > draw = forms.BooleanField(required=False) > move = forms.BooleanField(required=False) > > > I'm writing the view, with: > > > > if form.is_valid(): > draw = form.cleaned_data['move'] > move = form.cleaned_data['draw'] > resign = form.cleaned_data['resign'] > if resign == 1: > > > but (if resign == 1) don't work... > > where is the error? Absolutely basic debugging practice if something isn't behaving as expected is to print out the value to see what it actually contains (in a debugger, or with print, or however takes your fancy). 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 -~--~~~~--~~--~--~---
Query spanning two foreign keys
Hi all, I've got the following models (simplified for this example): from django.db import models from django.contrib.auth.models import User class Chat(models.Model): name = models.CharField(max_length=256) class Post(models.Model): user = models.ForeignKey(User, related_name='posts') parent = models.ForeignKey(Chat, related_name='posts') Can anyone tell me the best way to get a unique list of the users who have contributed to a specific chat? I can do something like the following, but I feel like there must be a more elegant way: >>> chat = Chat.objects.get(pk=1) >>> user = set([post.user for post in chat.posts.all()]) Any suggestions? Do I need to resort to raw SQL? Thanks, Will. --~--~-~--~~~---~--~~ 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: No models show up in my admin interface
On Sat, 2008-11-15 at 16:13 -0800, dash86no wrote: > Hi everyone, > > I'm new to django, and this I have been doing my best to follow online > documentation to help me get my first site up and running. My main > source has been: > > http://www.djangobook.com/en/1.0/ > > Now this has been great but i'm starting to get the sense that django > is a fast moving project and some of the material may be a little out > of date now. Specifically: http://www.djangobook.com/en/1.0/chapter06/ > the chapter about setting up the admin interface tells me to add: > > class Admin: > pass > > to my models.py file under the relevant class definitions. However, > after having done this, and uncommenting the relevant lines in urls.py > and settings.py to set up the superuser and allow access to the admin, > I can log into the admin interface, but the only site I can see in > there is: "example.com". > > I did a bit of reading around and found this: > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/ > > Which seems very different to the method described in djangobook.com. > I would follow this documentation, but it describes an "admin.py" > file, which does not exist within my project folder or my app folder. > > I'm a little confused, and would appreciate it if somebody could point > me to the current "authoritative" tutorials, so I can begin to get > back on the right path here. > > Cheers, Hi Dash, I believe the method for bringing models up in 1.0+ has changed from previous. Instead you need to now add the following: from django.contrib import admin in your import statements and then use the following to "register" your models with the admin interface. admin.site.register([NAME_OF_MODEL_TO_REGISTER]) -- James Purser http://collaborynth.com.au Mob: 0406 576 553 Ph: +61 2 8210 6725 Skype: collaborynth signature.asc Description: This is a digitally signed message part
Re: No models show up in my admin interface
On Sat, Nov 15, 2008 at 7:13 PM, dash86no <[EMAIL PROTECTED]> wrote: > I'm a little confused, and would appreciate it if somebody could point > me to the current "authoritative" tutorials, so I can begin to get > back on the right path here. > Yes, the book is out of date, published several months before Django 1.0 was released. The way in which admin specifications are done is entirely different now. The live documentation that gets updated when code changes is here: http://docs.djangoproject.com/en/dev/ Note the vast changes Django underwent from 0.96 to 1.0 will not continue from 1.0 to 1.1, etc. One big promise of 1.0 is backwards compatibility, see: http://docs.djangoproject.com/en/dev/misc/api-stability/ Karen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
No models show up in my admin interface
Hi everyone, I'm new to django, and this I have been doing my best to follow online documentation to help me get my first site up and running. My main source has been: http://www.djangobook.com/en/1.0/ Now this has been great but i'm starting to get the sense that django is a fast moving project and some of the material may be a little out of date now. Specifically: http://www.djangobook.com/en/1.0/chapter06/ the chapter about setting up the admin interface tells me to add: class Admin: pass to my models.py file under the relevant class definitions. However, after having done this, and uncommenting the relevant lines in urls.py and settings.py to set up the superuser and allow access to the admin, I can log into the admin interface, but the only site I can see in there is: "example.com". I did a bit of reading around and found this: http://docs.djangoproject.com/en/dev/ref/contrib/admin/ Which seems very different to the method described in djangobook.com. I would follow this documentation, but it describes an "admin.py" file, which does not exist within my project folder or my app folder. I'm a little confused, and would appreciate it if somebody could point me to the current "authoritative" tutorials, so I can begin to get back on the right path here. Cheers, --~--~-~--~~~---~--~~ 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: php templates support
DULMANDAKH Sukhbaatar wrote: >> when i use my hosting provider (mediatemple) which i believe is >> running django via a fast cgi container setup. overall, the setup >> seems to work, no errors, definately calling php.py, and detects the >> php:file.php tags, but no php is converted into the template output. >> blank text, not even the original php..so, it seems to run the php, >> but never updates the templates with the output. >> > > As I understand, you want to run php script or template inside Django. > Am I right? It's impossible, because Django is, as you may know, > written in python. Python and PHP are completely separate languages > with completely different syntax and so on. > You didn't follow the link that was provided. Ticket #2440 includes a patch that does just that. A php script may not be Python, but it definitely isn't hard to run a PHP script, and that's exactly what this does. Craic is having difficulty with this particular patch. As for using this patch, it was in fact marked as 'wontfix'. Any time I need to use the same template in two places, I just make a copy and maintain it in two different spots. Things like CSS can be common, but storing the HTML in two different spots really shouldn't be too cumbersome. If set up properly, you'll only need to change two files; one for your PHP template, and one for your Django template. Anything else that needs to be changed would be CSS, which can be shared (unless your template engine generates CSS on the fly), or you'd be changing some piece of functionality that should be only in your PHP app, or only in your Django app. It'd also speed things up a bit, because you won't be using os.open or subprocess to run PHP each time your cache runs dry and need to re-generate the template. One of the reasons to move to Django from PHP is to get away from PHP's faults, but you're suggesting to re-introduce them by putting them underneath your Django app. I'm sure this isn't what you wanted to hear, but I disagree with the concept of running PHP to get an html template into Django, though I think it's kind of cool that someone has done it. :p Take care! Jeff Anderson signature.asc Description: OpenPGP digital signature
Re: Bug in Admin or in my model ?
On Sat, Nov 15, 2008 at 2:29 PM, Ivan Mincik <[EMAIL PROTECTED]> wrote: > On Saturday 15 November 2008 18:57, Karen Tracey wrote: > > > The bug in Django is that the attempt to report that your existing > > __unicode__ method generated an error generated yet another error, and I > > haven't quite figured that one out yet. But if you want to make progress > > you can just fix your __unicode__ method. > What to do with this? Do I have to fill some bug report ? > No need, I opened one myself since I wanted to lay out the sequence of what happens and I'm not entirely sure of the right fix: http://code.djangoproject.com/ticket/9608 Karen --~--~-~--~~~---~--~~ 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: mod_python setup on Apache virtual host
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: '/' > Location: None > Directory: None > Filename: 'C:/Apache/homedomain/' > PathInfo: '' > > Phase: 'PythonHandler' > Handler: 'django.core.handlers.modpython' > > Traceback (most recent call last): > > File "C:\Python25\Lib\site-packages\mod_python\importer.py", line > 1537, in HandlerDispatch > default=default_handler, arg=req, silent=hlist.silent) > > File "C:\Python25\Lib\site-packages\mod_python\importer.py", line > 1229, in _process_target > result = _execute_target(config, req, object, arg) > > File "C:\Python25\Lib\site-packages\mod_python\importer.py", line > 1128, in _execute_target > result = object(arg) > > File "C:\Python25\lib\site-packages\django\core\handlers > \modpython.py", line 222, in handler > return ModPythonHandler()(req) > > File "C:\Python25\lib\site-packages\django\core\handlers > \modpython.py", line 195, in __call__ > response = self.get_response(request) > > File "C:\Python25\lib\site-packages\django\core\handlers\base.py", > line 128, in get_response > return self.handle_uncaught_exception(request, resolver, exc_info) > > File "C:\Python25\lib\site-packages\django\core\handlers\base.py", > line 160, in handle_uncaught_exception > return callback(request, **param_dict) > > File "C:\Python25\lib\site-packages\django\views\defaults.py", line > 88, in server_error > t = loader.get_template(template_name) # You need to create a > 500.html template. > > File "C:\Python25\lib\site-packages\django\template\loader.py", line > 80, in get_template > source, origin = find_template_source(template_name) > > File "C:\Python25\lib\site-packages\django\template\loader.py", line > 73, in find_template_source > raise TemplateDoesNotExist, name > > TemplateDoesNotExist: 500.html > > > > I can not find clear answer in the > doc:http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ > > Any helps are welcome. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Forms Datefield ?
hi, how do I change a datefield to d.m.Y in a form inherited from modelform ? r/Delle --~--~-~--~~~---~--~~ 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: Syncing two django applications via cURL
Also, is there some way to make this action "transaction like" ? To be sure that every action was synchronised? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Templates and method arguments for thumbnails
Hi, >From the django documentation, it looks like it is not possible to pass arguments to methods from the template HTML code. For example: class MyModel(Model): def foo(self): return 'This works' can be accessed by: {{ mymodel.foo }} in an HTML template. What I am trying to do, however, is to access data based on arguments for this method. This is my example scenario: I have several high resolution photographs, and I want to be able to write some code that displays thumbnails: 1) Check if a thumbnail exists, if it doesn't, create it 2) Return the URL for the given image file to be displayed on screen e.g. {{ myimage.getThumbnail 200 }} I was thinking of intercepting all method calls beginning with getThumbnail, and extracting the width out of the method name, but this seems kind of clumsy. The sizes for the thumbnails will always be dynamic, and will not be fixed according the preconfigured sizes, so i can't have a getThumbnailSmal()/Med()/Large() setup. {{ myimage.getThumbnail_50/75/100/etc...}} Is there a cleaner or better way to do this? Thank you --~--~-~--~~~---~--~~ 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: Django not detecting URL - only index.php
I finally got it. The VirtualHost in the httpd.conf was pointing at the root, so I changed the DocumentRoot to something else. On Nov 15, 2:59 pm, NathanY <[EMAIL PROTECTED]> wrote: > So it ended up being the .htaccess in the root domain - > flowingdata.com, which is a wordpress domain. Here's the .htaccess: > > > RewriteEngine On > RewriteBase / > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule . /index.php [L] > > > Any ideas on how to override that .htaccess in the subdomain..? > > On Nov 15, 12:21 pm, NathanY <[EMAIL PROTECTED]> wrote: > > > I'll take any help I can get at this point :P. Here's the Apache > > config:http://dpaste.com/90963/ > > > Thank you! > > > On Nov 15, 7:18 am, Daniel Roseman <[EMAIL PROTECTED]> > > wrote: > > > > On Nov 15, 9:37 am, NathanY <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I'm trying to deploy my django project on a production server, but > > > > Django always thinks the URL is index.php no matter what I put in. For > > > > example, when I put in the URL: > > > > >http://your.flowingdata.com/some_random_string > > > > > I get the following no matter what some_random_string is: > > > > > Using the URLconf defined in urls, Django tried these URL patterns, in > > > > this order: > > > > > 1. ^(?P\w+)/weight/ > > > > > The current URL, index.php, didn't match any of these. > > > > > Is there anyone out there who might have a clue what's going on? The > > > > project is working fine on my laptop, so it's kind of been sucking not > > > > being able to get working in production :( > > > > This is clearly an Apache issue - you probably have some sort of URL > > > rewriting or redirecting going on in your Apache configuration. If you > > > want to post that, we might be able to help further. > > > > -- > > > DR. --~--~-~--~~~---~--~~ 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: Css and Images are missing
Thanks so much ;) Its working :) -- Luis On Nov 15, 8:10 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 15, 2008 at 10:49 AM, Luis Goncalves > <[EMAIL PROTECTED]>wrote: > > > > > > > Hello guys I need your help in here. > > > Sorry I am new in Django and I am having a problem, my css and jpgs > > are missing. > > > I will write everything what i have and then maybe someone could give > > me a hint :) > > > My settings.py: > > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/' > > MEDIA_URL = 'http://127.0.0.1:8000/media/' > > ADMIN_MEDIA_PREFIX = '/media/' > > > My urls.py: > > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root': > > 'settings.MEDIA_ROOT'}), > > > And an example of base.html: > > http://127.0.0.1:8000/media/ > > mm_health_nutr.css" type="text/css" /> > > http://127.0.0.1:8000/media/picture.jpg; alt="Header image" > > width="382" height="101" border="0" /> > > You've essentially got the same value for MEDIA_URL and ADMIN_MEDIA_PREFIX, > which doesn't work > (see:http://docs.djangoproject.com/en/dev/ref/settings/#admin-media-prefix). > The > development server has a built-in media server for admin which picks off > anything starting with ADMIN_MEDIA_PREFIX and serves up the admin media > files. You've set things up so your own media files have that same prefix > (thehttp://127.0.0.1:8000just serves to route it to a server, once at that > server all that matters is what follows, in your case '/media/', which is > the same as your ADMIN_MEDIA_PREFIX), so the request for your CSS, etc. are > going to the built-in admin media server (which can't find them since it's > looking among the admin media), not the static server. > > Karen --~--~-~--~~~---~--~~ 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: Django not detecting URL - only index.php
So it ended up being the .htaccess in the root domain - flowingdata.com, which is a wordpress domain. Here's the .htaccess: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Any ideas on how to override that .htaccess in the subdomain..? On Nov 15, 12:21 pm, NathanY <[EMAIL PROTECTED]> wrote: > I'll take any help I can get at this point :P. Here's the Apache > config:http://dpaste.com/90963/ > > Thank you! > > On Nov 15, 7:18 am, Daniel Roseman <[EMAIL PROTECTED]> > wrote: > > > On Nov 15, 9:37 am, NathanY <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm trying to deploy my django project on a production server, but > > > Django always thinks the URL is index.php no matter what I put in. For > > > example, when I put in the URL: > > > >http://your.flowingdata.com/some_random_string > > > > I get the following no matter what some_random_string is: > > > > Using the URLconf defined in urls, Django tried these URL patterns, in > > > this order: > > > > 1. ^(?P\w+)/weight/ > > > > The current URL, index.php, didn't match any of these. > > > > Is there anyone out there who might have a clue what's going on? The > > > project is working fine on my laptop, so it's kind of been sucking not > > > being able to get working in production :( > > > This is clearly an Apache issue - you probably have some sort of URL > > rewriting or redirecting going on in your Apache configuration. If you > > want to post that, we might be able to help further. > > > -- > > DR. --~--~-~--~~~---~--~~ 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: Bug in Admin or in my model ?
On Saturday 15 November 2008 18:57, Karen Tracey wrote: > There's a bug both in your models and in Django, I think. Your __unicode__ > method for class Metadata: > >def __unicode__(self): > >return "%s %s" % (self.vrstva,self.nazov) > > > > needs to be: > >def __unicode__(self): > > >return u"%s %s" % (self.vrstva,self.nazov) Karen, really thanks a lot for perfect guess. Problem solved. > > > The bug in Django is that the attempt to report that your existing > __unicode__ method generated an error generated yet another error, and I > haven't quite figured that one out yet. But if you want to make progress > you can just fix your __unicode__ method. What to do with this? Do I have to fill some bug report ? > > Karen > > > > Ivan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
My (painful) Experience with custom filters
My (painful) Experience with custom filters. This not a Question; but I think posting this will help community I have tried to get custom filters running and found that some of things are Un documented or not documented in *BOLDFACE* I need to do following additional steps in addition to what is documented. 1) INSTALLED_APPS needed to add "appname" (Assuming directory structure is appname/ templatetags/__init__.py) 2) Template ERRS out if you have white spaces. I have written a trivial template 'ukase' which works like ucase. I have had a construct like {% load private %} {{ name | ukase}} and it started giving syntax error; I wish a cause is described clearly. After eliminating space it worked as expected. {% load private %} {{name|ukase}} Regards. -Mahesh @Bangalore - India --~--~-~--~~~---~--~~ 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: mod_python setup on Apache virtual host
Here is what I tried. DocumentRoot "C:/Apache/homedomain" ServerName domain.com ServerAlias www.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:'/' Location: None Directory: None Filename: 'C:/Apache/homedomain/' PathInfo: '' Phase: 'PythonHandler' Handler:'django.core.handlers.modpython' Traceback (most recent call last): File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg) File "C:\Python25\Lib\site-packages\mod_python\importer.py", line 1128, in _execute_target result = object(arg) File "C:\Python25\lib\site-packages\django\core\handlers \modpython.py", line 222, in handler return ModPythonHandler()(req) File "C:\Python25\lib\site-packages\django\core\handlers \modpython.py", line 195, in __call__ response = self.get_response(request) File "C:\Python25\lib\site-packages\django\core\handlers\base.py", line 128, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "C:\Python25\lib\site-packages\django\core\handlers\base.py", line 160, in handle_uncaught_exception return callback(request, **param_dict) File "C:\Python25\lib\site-packages\django\views\defaults.py", line 88, in server_error t = loader.get_template(template_name) # You need to create a 500.html template. File "C:\Python25\lib\site-packages\django\template\loader.py", line 80, in get_template source, origin = find_template_source(template_name) File "C:\Python25\lib\site-packages\django\template\loader.py", line 73, in find_template_source raise TemplateDoesNotExist, name TemplateDoesNotExist: 500.html I can not find clear answer in the doc: http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ Any helps are welcome. --~--~-~--~~~---~--~~ 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: ANN: Django 1.0.1 released
I am getting the same thing for the md5 sum. Downloaded through Firefox 3.0.4 and Safari 3.1.2 on Mac OS X.5.5. On Nov 15, 2008, at 8:48 AM, leonel wrote: > > James Bennett wrote: >> Tonight we've released Django 1.0.1, a bugfix release in the 1.0 >> series containing improvements and fixes since the 1.0 release. This >> is a recommended upgrade for anyone currently running Django 1.0. >> >> The blog entry announcing the release is here: >> http://www.djangoproject.com/weblog/2008/nov/15/101/ >> >> And the release notes are here: >> http://docs.djangoproject.com/en/dev/releases/1.0.1/ >> >> > Ive downloaded the tar.gz from > http://www.djangoproject.com/download/1.0.1/tarball/ > > and the md5sum does not match the md5sum from: > http://media.djangoproject.com/pgp/Django-1.0.1-final.checksum.txt > > This is what I get > > md5sum Django-1.0.1-final.tar.gz > d93a2d30d06f98f5ffebcee08bca6623 Django-1.0.1-final.tar.gz > > Am I missing something ?? > > Thank you > > > > > --~--~-~--~~~---~--~~ 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: installing django on a shared server
On Sat, Nov 15, 2008 at 12:39 PM, Carl <[EMAIL PROTECTED]> wrote: > > When I run the installation script I get this error: > > error: could not create '/usr/lib/python2.3/site-packages/django': > Permission denied > > How do I get around this? > If you're on some flavor of Unix, as you appear to be based on the path, the instructions ( http://docs.djangoproject.com/en/dev/topics/install/#installing-official-release) tell you to use the command: sudo python setup.py install sudo is what allows you to run the command 'python setup.py install' with permissions that let it write to system files such as /usr/lib/python2.3/site-packages. If you don't actually have permissions to write to system files, you can "install" Django simply by un-tarring it somewhere you can write to and setting up your PYTHONPATH environment variable to point to it. Karen --~--~-~--~~~---~--~~ 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: Css and Images are missing
On Sat, Nov 15, 2008 at 10:49 AM, Luis Goncalves <[EMAIL PROTECTED]>wrote: > > Hello guys I need your help in here. > > Sorry I am new in Django and I am having a problem, my css and jpgs > are missing. > > I will write everything what i have and then maybe someone could give > me a hint :) > > > My settings.py: > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/' > MEDIA_URL = 'http://127.0.0.1:8000/media/' > ADMIN_MEDIA_PREFIX = '/media/' > > > My urls.py: > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root': > 'settings.MEDIA_ROOT'}), > > > And an example of base.html: > http://127.0.0.1:8000/media/ > mm_health_nutr.css" type="text/css" /> > http://127.0.0.1:8000/media/picture.jpg; alt="Header image" > width="382" height="101" border="0" /> > > You've essentially got the same value for MEDIA_URL and ADMIN_MEDIA_PREFIX, which doesn't work (see: http://docs.djangoproject.com/en/dev/ref/settings/#admin-media-prefix). The development server has a built-in media server for admin which picks off anything starting with ADMIN_MEDIA_PREFIX and serves up the admin media files. You've set things up so your own media files have that same prefix (the http://127.0.0.1:8000 just serves to route it to a server, once at that server all that matters is what follows, in your case '/media/', which is the same as your ADMIN_MEDIA_PREFIX), so the request for your CSS, etc. are going to the built-in admin media server (which can't find them since it's looking among the admin media), not the static server. Karen --~--~-~--~~~---~--~~ 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: installing django on a shared server
> When I run the installation script I get this error: > > error: could not create '/usr/lib/python2.3/site-packages/django': > Permission denied > > How do I get around this? From my understanding, "installing Django" consists purely of depositing the Django tree in the system $PYTHONPATH (there might be some extra mojo, but for all intents and purposes, that's the main goal). You can get the same results by checking out a copy from SVN or untarballing a snapshot of the Django tree in your home directory (where you *should* have permission to access/write). Once you've got the Django tree somewhere in your home tree, you should be able to append that location to your $PYTHONPATH (there are instructions in the configuration docs on how to do this in various server setups). -tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Bug in Admin or in my model ?
There's a bug both in your models and in Django, I think. Your __unicode__ method for class Metadata: def __unicode__(self): >return "%s %s" % (self.vrstva,self.nazov) > needs to be: def __unicode__(self): > return u"%s %s" % (self.vrstva,self.nazov) The bug in Django is that the attempt to report that your existing __unicode__ method generated an error generated yet another error, and I haven't quite figured that one out yet. But if you want to make progress you can just fix your __unicode__ method. Karen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
installing django on a shared server
When I run the installation script I get this error: error: could not create '/usr/lib/python2.3/site-packages/django': Permission denied How do I get around this? --~--~-~--~~~---~--~~ 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: Django not detecting URL - only index.php
I'll take any help I can get at this point :P. Here's the Apache config: http://dpaste.com/90963/ Thank you! On Nov 15, 7:18 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 15, 9:37 am, NathanY <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I'm trying to deploy my django project on a production server, but > > Django always thinks the URL is index.php no matter what I put in. For > > example, when I put in the URL: > > >http://your.flowingdata.com/some_random_string > > > I get the following no matter what some_random_string is: > > > Using the URLconf defined in urls, Django tried these URL patterns, in > > this order: > > > 1. ^(?P\w+)/weight/ > > > The current URL, index.php, didn't match any of these. > > > Is there anyone out there who might have a clue what's going on? The > > project is working fine on my laptop, so it's kind of been sucking not > > being able to get working in production :( > > This is clearly an Apache issue - you probably have some sort of URL > rewriting or redirecting going on in your Apache configuration. If you > want to post that, we might be able to help further. > > -- > DR. --~--~-~--~~~---~--~~ 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: Custom joins on multiple columns with Q objects
Malcolm Tredinnick wrote: > At some point in the future, multi-valued ON constraints might make an > appearance (for example, multi-column primary key queries are possibly > easier to write), but they might not, too. The slight preference for > doing so at some point is that there are a couple of cases on some > databases where join constraints are handled more efficiently than where > constraints. Well, that's what i am trying to do, only construct ON contraints for composite primary keys, nothing else. Anyway, thanks for your insightful reply. --~--~-~--~~~---~--~~ 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: Css and Images are missing
Well i saw this: "With that said, Django does support static files during development. You can use the django.views.static.serve() view to serve media files. The big, fat disclaimer¶ Using this method is inefficient and insecure. Do not use this in a production setting. Use this only for development. For information on serving static files in an Apache production environment, see the Django mod_python documentation. How to do it Here’s the formal definition of the serve() view: def serve(request, path, document_root, show_indexes=False): To use it, just put this in your URLconf: (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}), " So there is support on development... And i have that on my urls.py... So i still dont understand why doesnt work, Thanks, On Nov 15, 6:36 pm, Luke Seelenbinder <[EMAIL PROTECTED]> wrote: > Django doesn't serve the media files, look > athttp://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs > > Luke > > On Nov 15, 10:49 am, Luis Goncalves <[EMAIL PROTECTED]> wrote: > > > Hello guys I need your help in here. > > > Sorry I am new in Django and I am having a problem, my css and jpgs > > are missing. > > > I will write everything what i have and then maybe someone could give > > me a hint :) > > > My settings.py: > > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/' > > MEDIA_URL = 'http://127.0.0.1:8000/media/' > > ADMIN_MEDIA_PREFIX = '/media/' > > > My urls.py: > > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root': > > 'settings.MEDIA_ROOT'}), > > > And an example of base.html: > > http://127.0.0.1:8000/media/ > > mm_health_nutr.css" type="text/css" /> > > http://127.0.0.1:8000/media/picture.jpg; alt="Header image" > > width="382" height="101" border="0" /> > > > Thanks so much for your help. > > > Best Regards, > > > Luis --~--~-~--~~~---~--~~ 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: Bug in Admin or in my model ?
On Saturday 15 November 2008 17:34, Luke Seelenbinder wrote: > > You need to specify your encoding in your models file. > Like: # -*- coding: iso-8859-15 -*- > Look at http:// > evanjones.ca/python-utf8.html The sixth section of the page > explains. thanks for answer, but the first line in my models.py is # -*- coding: utf-8 -*-. Please see : http://gista.sk/dl/bugs/django/models.py > > Regards > Luke > > On Nov 15, 11:09 am, Ivan Mincik <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a problem when adding record by Django Admin and I am not sure where > > I have to look for it. Is this some problem in Django Admin or it can be > > solved by some > > configuration in model ? > > I use Foreign Key in table where I want to add record. Foreign Key is the > > field containing some non ASCII characters. > > See:http://gista.sk/dl/bugs/django/add_record_in_admin.png > > I want to add record to "Metadata" which uses ForeignKey from "Vrstva". > > > > *** When I submit, I get this error (nothing else printed): > > Screenshot is > > here:http://gista.sk/dl/bugs/django/add_record_in_admin_submit.png > > > > 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 299, > > in HandlerDispatch > > result = object(req) > > > > File > > "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line > > 222, in handler > > return ModPythonHandler()(req) > > > > File > > "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line > > 195, in __call__ > > response = self.get_response(request) > > > > File "/var/lib/python-support/python2.4/django/core/handlers/base.py", > > line 128, in get_response > > return self.handle_uncaught_exception(request, resolver, exc_info) > > > > File "/var/lib/python-support/python2.4/django/core/handlers/base.py", > > line 148, in handle_uncaught_exception > > return debug.technical_500_response(request, *exc_info) > > > > File "/var/lib/python-support/python2.4/django/views/debug.py", line 39, > > in technical_500_response > > html = reporter.get_traceback_html() > > > > File "/var/lib/python-support/python2.4/django/views/debug.py", line 95, > > in get_traceback_html > > c = Context({ > > > > File "/var/lib/python-support/python2.4/django/utils/encoding.py", line > > 35, in smart_unicode > > return force_unicode(s, encoding, strings_only, errors) > > > > File "/var/lib/python-support/python2.4/django/utils/encoding.py", line > > 70, in force_unicode > > raise DjangoUnicodeDecodeError(s, *e.args) > > > > DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position > > 1: ordinal not in range(128). You passed in > > > > *** Snippets from my model: > > Full models.py is here:http://gista.sk/dl/bugs/django/models.py > > > > class Metadata(models.Model): > > vrstva = models.ForeignKey(Vrstva) > > nazov = models.CharField(u"Názov stĺpca", max_length=100) > > dlhy_nazov = models.CharField(u"Dlhý názov stĺpca", max_length=200) > > hodnota = models.CharField(u"Formátovanie hodnoty", max_length=512, > > default="%s") > > externa_databaza = models.ForeignKey(Externa_databaza, blank=True, > > null=True) > > sql = models.TextField(u"SQL dopyt", blank=True) > > > > def __unicode__(self): > > return "%s %s" % (self.vrstva,self.nazov) > > > > class Meta: > > ordering = ["vrstva", "nazov"] > > verbose_name_plural = u"metadata" > > > > class Vrstva(Vrstvy_zaklad): > > kategoria = models.ForeignKey(Kategoria, verbose_name=u"Kategória") > > sql_atrib = models.TextField(u"Atributový SQL", blank=True) > > tabulka = models.CharField(u"Tabuľka", max_length=200, blank=True, > > help_text=u"Tabuľka v ktorej sú gid a geom pre danú vrstvu") > > transparent = models.BooleanField(u"Transparent") > > zoom_level = models.IntegerField(u"Zoom level", default=1, > > help_text=u"Zoom level ktory sa použije pri zoomovaní na objekt pri > > vyhľadávaní") > > sql_hladanie = models.TextField(u"Vyhľadávací SQL", blank=True) > > > > class Meta: > > ordering = ['kategoria','poradie'] > > verbose_name_plural = u"vrstvy" > > > > *** My environment details: > > OS: Debian Etch with python 2.4 > > Django version: 1.0, also tested on new 1.0.1 with same results > > Database: PostgreSQL 8.1 > > > > *** It looks like the bug #3924 which should be allready closed. > > > > Can anybody give me some hint where to look for the solution ? > > > > Thanks a lot > > -- > > Ivan > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To
Re: Css and Images are missing
Django doesn't serve the media files, look at http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs Luke On Nov 15, 10:49 am, Luis Goncalves <[EMAIL PROTECTED]> wrote: > Hello guys I need your help in here. > > Sorry I am new in Django and I am having a problem, my css and jpgs > are missing. > > I will write everything what i have and then maybe someone could give > me a hint :) > > My settings.py: > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/' > MEDIA_URL = 'http://127.0.0.1:8000/media/' > ADMIN_MEDIA_PREFIX = '/media/' > > My urls.py: > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root': > 'settings.MEDIA_ROOT'}), > > And an example of base.html: > http://127.0.0.1:8000/media/ > mm_health_nutr.css" type="text/css" /> > http://127.0.0.1:8000/media/picture.jpg; alt="Header image" > width="382" height="101" border="0" /> > > Thanks so much for your help. > > Best Regards, > > Luis --~--~-~--~~~---~--~~ 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: Bug in Admin or in my model ?
You need to specify your encoding in your models file. Like: # -*- coding: iso-8859-15 -*- Look at http:// evanjones.ca/python-utf8.html The sixth section of the page explains. Regards Luke On Nov 15, 11:09 am, Ivan Mincik <[EMAIL PROTECTED]> wrote: > Hi, > I have a problem when adding record by Django Admin and I am not sure where I > have to look for it. Is this some problem in Django Admin or it can be solved > by some > configuration in model ? > I use Foreign Key in table where I want to add record. Foreign Key is the > field containing some non ASCII characters. > See:http://gista.sk/dl/bugs/django/add_record_in_admin.png > I want to add record to "Metadata" which uses ForeignKey from "Vrstva". > > *** When I submit, I get this error (nothing else printed): > Screenshot is > here:http://gista.sk/dl/bugs/django/add_record_in_admin_submit.png > > 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 299, in > HandlerDispatch > result = object(req) > > File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", > line 222, in handler > return ModPythonHandler()(req) > > File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", > line 195, in __call__ > response = self.get_response(request) > > File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line > 128, in get_response > return self.handle_uncaught_exception(request, resolver, exc_info) > > File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line > 148, in handle_uncaught_exception > return debug.technical_500_response(request, *exc_info) > > File "/var/lib/python-support/python2.4/django/views/debug.py", line 39, in > technical_500_response > html = reporter.get_traceback_html() > > File "/var/lib/python-support/python2.4/django/views/debug.py", line 95, in > get_traceback_html > c = Context({ > > File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 35, > in smart_unicode > return force_unicode(s, encoding, strings_only, errors) > > File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 70, > in force_unicode > raise DjangoUnicodeDecodeError(s, *e.args) > > DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: > ordinal not in range(128). You passed in > > *** Snippets from my model: > Full models.py is here:http://gista.sk/dl/bugs/django/models.py > > class Metadata(models.Model): > vrstva = models.ForeignKey(Vrstva) > nazov = models.CharField(u"Názov stĺpca", max_length=100) > dlhy_nazov = models.CharField(u"Dlhý názov stĺpca", max_length=200) > hodnota = models.CharField(u"Formátovanie hodnoty", max_length=512, > default="%s") > externa_databaza = models.ForeignKey(Externa_databaza, blank=True, > null=True) > sql = models.TextField(u"SQL dopyt", blank=True) > > def __unicode__(self): > return "%s %s" % (self.vrstva,self.nazov) > > class Meta: > ordering = ["vrstva", "nazov"] > verbose_name_plural = u"metadata" > > class Vrstva(Vrstvy_zaklad): > kategoria = models.ForeignKey(Kategoria, verbose_name=u"Kategória") > sql_atrib = models.TextField(u"Atributový SQL", blank=True) > tabulka = models.CharField(u"Tabuľka", max_length=200, blank=True, > help_text=u"Tabuľka v ktorej sú gid a geom pre danú vrstvu") > transparent = models.BooleanField(u"Transparent") > zoom_level = models.IntegerField(u"Zoom level", default=1, > help_text=u"Zoom level ktory sa použije pri zoomovaní na objekt pri > vyhľadávaní") > sql_hladanie = models.TextField(u"Vyhľadávací SQL", blank=True) > > class Meta: > ordering = ['kategoria','poradie'] > verbose_name_plural = u"vrstvy" > > *** My environment details: > OS: Debian Etch with python 2.4 > Django version: 1.0, also tested on new 1.0.1 with same results > Database: PostgreSQL 8.1 > > *** It looks like the bug #3924 which should be allready closed. > > Can anybody give me some hint where to look for the solution ? > > Thanks a lot > -- > Ivan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Bug in Admin or in my model ?
Hi, I have a problem when adding record by Django Admin and I am not sure where I have to look for it. Is this some problem in Django Admin or it can be solved by some configuration in model ? I use Foreign Key in table where I want to add record. Foreign Key is the field containing some non ASCII characters. See: http://gista.sk/dl/bugs/django/add_record_in_admin.png I want to add record to "Metadata" which uses ForeignKey from "Vrstva". *** When I submit, I get this error (nothing else printed): Screenshot is here: http://gista.sk/dl/bugs/django/add_record_in_admin_submit.png 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 299, in HandlerDispatch result = object(req) File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line 222, in handler return ModPythonHandler()(req) File "/var/lib/python-support/python2.4/django/core/handlers/modpython.py", line 195, in __call__ response = self.get_response(request) File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line 128, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/var/lib/python-support/python2.4/django/core/handlers/base.py", line 148, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/var/lib/python-support/python2.4/django/views/debug.py", line 39, in technical_500_response html = reporter.get_traceback_html() File "/var/lib/python-support/python2.4/django/views/debug.py", line 95, in get_traceback_html c = Context({ File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 35, in smart_unicode return force_unicode(s, encoding, strings_only, errors) File "/var/lib/python-support/python2.4/django/utils/encoding.py", line 70, in force_unicode raise DjangoUnicodeDecodeError(s, *e.args) DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128). You passed in *** Snippets from my model: Full models.py is here: http://gista.sk/dl/bugs/django/models.py class Metadata(models.Model): vrstva = models.ForeignKey(Vrstva) nazov = models.CharField(u"Názov stĺpca", max_length=100) dlhy_nazov = models.CharField(u"Dlhý názov stĺpca", max_length=200) hodnota = models.CharField(u"Formátovanie hodnoty", max_length=512, default="%s") externa_databaza = models.ForeignKey(Externa_databaza, blank=True, null=True) sql = models.TextField(u"SQL dopyt", blank=True) def __unicode__(self): return "%s %s" % (self.vrstva,self.nazov) class Meta: ordering = ["vrstva", "nazov"] verbose_name_plural = u"metadata" class Vrstva(Vrstvy_zaklad): kategoria = models.ForeignKey(Kategoria, verbose_name=u"Kategória") sql_atrib = models.TextField(u"Atributový SQL", blank=True) tabulka = models.CharField(u"Tabuľka", max_length=200, blank=True, help_text=u"Tabuľka v ktorej sú gid a geom pre danú vrstvu") transparent = models.BooleanField(u"Transparent") zoom_level = models.IntegerField(u"Zoom level", default=1, help_text=u"Zoom level ktory sa použije pri zoomovaní na objekt pri vyhľadávaní") sql_hladanie = models.TextField(u"Vyhľadávací SQL", blank=True) class Meta: ordering = ['kategoria','poradie'] verbose_name_plural = u"vrstvy" *** My environment details: OS: Debian Etch with python 2.4 Django version: 1.0, also tested on new 1.0.1 with same results Database: PostgreSQL 8.1 *** It looks like the bug #3924 which should be allready closed. Can anybody give me some hint where to look for the solution ? Thanks a lot -- Ivan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Css and Images are missing
Hello guys I need your help in here. Sorry I am new in Django and I am having a problem, my css and jpgs are missing. I will write everything what i have and then maybe someone could give me a hint :) My settings.py: MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/' MEDIA_URL = 'http://127.0.0.1:8000/media/' ADMIN_MEDIA_PREFIX = '/media/' My urls.py: (r'^media/(?P.*)', 'django.views.static.serve',{'document_root': 'settings.MEDIA_ROOT'}), And an example of base.html: http://127.0.0.1:8000/media/ mm_health_nutr.css" type="text/css" /> http://127.0.0.1:8000/media/picture.jpg; alt="Header image" width="382" height="101" border="0" /> Thanks so much for your help. Best Regards, Luis --~--~-~--~~~---~--~~ 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: Serialization of custom model fields
On Sat, Nov 15, 2008 at 9:56 AM, AndyH <[EMAIL PROTECTED]> wrote: > > So I'm not missing anything. It's a bug. Ouch... > > Thanks for the info, before I trawled my way through the serializers. > May well have to apply the patch locally to move forward. There > doesn't seem to be much movement on the ticket. > The ticket is only 2 weeks old! That's not so old for a project with all-volunteer developers, really. Also, the ticket got some attention shortly after it was opened. Russell noted it needed a test minimally to demonstrate the problem, ideally that integrated into the test suite. That might have been provided by the updated patch but that is not clear since the flags for "patch needs improvement" and "needs tests" were not turned off. If you've got a patch that you think addresses the reason for "patch needs improvement" and "needs tests" it's best to reset the flags when you attach it, otherwise the ticket continues to look like it's not a candidate for an easily-evaluated-and-committed fix. Karen > > On Nov 15, 1:40 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > > There is ticket and patch for this issuehttp:// > code.djangoproject.com/ticket/9522 > > > > On Sat, Nov 15, 2008 at 16:38, AndyH <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I have a custom model field class that stores event recurrence > > > information. In python this is an instance of dateutil.rrule.rule, and > > > in the database I am storing it as an iCal recurrence string. To > > > convert between these two formats I have to_python and > > > get_db_prep_value methods on the custom field class (subclassing > > > models.Field). > > > > > Things works more-or-less OK, but when I run dumpdata to serialize the > > > database into json, at some point to_json gets executed and the > > > returned value for rrule is ' > > 0x1121828>' and not the value that should be returned by > > > get_db_prep_value. I also have a 'value_to_string' method on the > > > fiels, but this does not get executed either. > > > > > What am I missing about the way dumpdata handles these custom model > > > fields? > > > > > Thanks > > > Andy. > > > --~--~-~--~~~---~--~~ 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: Serialization of custom model fields
So I'm not missing anything. It's a bug. Ouch... Thanks for the info, before I trawled my way through the serializers. May well have to apply the patch locally to move forward. There doesn't seem to be much movement on the ticket. On Nov 15, 1:40 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > There is ticket and patch for this > issuehttp://code.djangoproject.com/ticket/9522 > > On Sat, Nov 15, 2008 at 16:38, AndyH <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I have a custom model field class that stores event recurrence > > information. In python this is an instance of dateutil.rrule.rule, and > > in the database I am storing it as an iCal recurrence string. To > > convert between these two formats I have to_python and > > get_db_prep_value methods on the custom field class (subclassing > > models.Field). > > > Things works more-or-less OK, but when I run dumpdata to serialize the > > database into json, at some point to_json gets executed and the > > returned value for rrule is ' > 0x1121828>' and not the value that should be returned by > > get_db_prep_value. I also have a 'value_to_string' method on the > > fiels, but this does not get executed either. > > > What am I missing about the way dumpdata handles these custom model > > fields? > > > Thanks > > Andy. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ManyToManyField with multiple model options
Basically, I want to allow a ManyToManyField to use any of a Model's children, like this: class Word(models.Model): word = models.CharField(...) class Meta: abstract = True class Noun(Word): gender = models.CharField(...) class Verb(Word): irregular = models.BooleanField(...) #Here is where I need the help def WordStats(models.Model): # I get an error saying word = models.ManyToManyField(Word) stats = ... Is there anyway to accomplish this? Without writing separate models for each word. Thanks, Luke S. --~--~-~--~~~---~--~~ 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: Beginner desperately seeking Django experts.
On Nov 15, 3:39 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-11-14 at 22:54 -0800, Innergy wrote: > > Thanks for reading my question. I may not be asking all the right > > questions. > > > I am looking for a fast way to build a ecommerce site with many of the > > qualities of threadless.com. I was told Django is an excellent > > language and allows for rapid fast implementation. > > > My back ground is not in development. So I am agnostic. I am currently > > leaning towards Ruby for my project. How does Django compare to > > Ruby? Is Django faster to develop in? Is it as stable as Ruby? > > For somebody familiar with and expert in Python, Django will be faster. > For somebody with Ruby skills, Ruby on Rails will be faster. Neither > language (Python, Ruby) or web framework (Django, Rails) has any > significant known stability problems and both programming languages have > been around since the early- to mid-1990's. Django and Rails are roughly > equivalent as frameworks; the differences are in the fine-details and I > don't think any of those are show-stoppers. There are clearly > trade-offs, since neither framework has everything that everybody wants, > out of the box, but since they're both built on top of professional > quality programming languages, it's possible to build any missing pieces > if the motivation is strong enough. > > If you're asking for yourself, just setting our to learn a programming > language and start development, then that's an entirely different > question. Learning one of other language will probably take about the > same amount of time. But I wouldn't be choosing threadless.com as the > first project in that case and "fast" will not the appropriate word to > describe the speed it will take to build if you also have to learn the > programming language and the framework. In that case, you've essentially > asked the equivalent of "I'm thinking about building a house and I don't > have a background in construction. Should I use bricks or wood?" It's > nice to have an end goal to keep you motivated, but there's a learning > curve involved. > > Regards, > Malcolm I suggest you take a look at Satchmo, http://www.satchmoproject.com/, which is an ecommerce application written in Django. I myself have never used it, but I heard great things about it. John --~--~-~--~~~---~--~~ 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: django.pl has been officially launched
On Tue, 28 Oct 2008 04:15:20 -0700, Dominik Szopa wrote: > We also have there English sites, the one is curce.com, but recently > heared that they are not powered by Django any more, anybody knows if > thats true ? Considering that the Curse guys hang around in #pocoo, that's well possible. regards, Marek --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
checkbox and BooleanField
Hi, I've this template: And this View: class MoveGameForm(forms.Form): resign = forms.BooleanField(required=False) draw = forms.BooleanField(required=False) move = forms.BooleanField(required=False) I'm writing the view, with: if form.is_valid(): draw = form.cleaned_data['move'] move = form.cleaned_data['draw'] resign = form.cleaned_data['resign'] if resign == 1: but (if resign == 1) don't work... where is the error? thanks, Alfredo --~--~-~--~~~---~--~~ 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: ANN: Django 1.0.1 released
James Bennett wrote: > Tonight we've released Django 1.0.1, a bugfix release in the 1.0 > series containing improvements and fixes since the 1.0 release. This > is a recommended upgrade for anyone currently running Django 1.0. > > The blog entry announcing the release is here: > http://www.djangoproject.com/weblog/2008/nov/15/101/ > > And the release notes are here: > http://docs.djangoproject.com/en/dev/releases/1.0.1/ > > Ive downloaded the tar.gz from http://www.djangoproject.com/download/1.0.1/tarball/ and the md5sum does not match the md5sum from: http://media.djangoproject.com/pgp/Django-1.0.1-final.checksum.txt This is what I get md5sum Django-1.0.1-final.tar.gz d93a2d30d06f98f5ffebcee08bca6623 Django-1.0.1-final.tar.gz Am I missing something ?? Thank you --~--~-~--~~~---~--~~ 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: Serialization of custom model fields
There is ticket and patch for this issue http://code.djangoproject.com/ticket/9522 On Sat, Nov 15, 2008 at 16:38, AndyH <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a custom model field class that stores event recurrence > information. In python this is an instance of dateutil.rrule.rule, and > in the database I am storing it as an iCal recurrence string. To > convert between these two formats I have to_python and > get_db_prep_value methods on the custom field class (subclassing > models.Field). > > Things works more-or-less OK, but when I run dumpdata to serialize the > database into json, at some point to_json gets executed and the > returned value for rrule is ' 0x1121828>' and not the value that should be returned by > get_db_prep_value. I also have a 'value_to_string' method on the > fiels, but this does not get executed either. > > What am I missing about the way dumpdata handles these custom model > fields? > > Thanks > Andy. > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Serialization of custom model fields
Hi, I have a custom model field class that stores event recurrence information. In python this is an instance of dateutil.rrule.rule, and in the database I am storing it as an iCal recurrence string. To convert between these two formats I have to_python and get_db_prep_value methods on the custom field class (subclassing models.Field). Things works more-or-less OK, but when I run dumpdata to serialize the database into json, at some point to_json gets executed and the returned value for rrule is '' and not the value that should be returned by get_db_prep_value. I also have a 'value_to_string' method on the fiels, but this does not get executed either. What am I missing about the way dumpdata handles these custom model fields? Thanks Andy. --~--~-~--~~~---~--~~ 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: Django not detecting URL - only index.php
On Nov 15, 9:37 am, NathanY <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to deploy my django project on a production server, but > Django always thinks the URL is index.php no matter what I put in. For > example, when I put in the URL: > > http://your.flowingdata.com/some_random_string > > I get the following no matter what some_random_string is: > > Using the URLconf defined in urls, Django tried these URL patterns, in > this order: > > 1. ^(?P\w+)/weight/ > > The current URL, index.php, didn't match any of these. > > Is there anyone out there who might have a clue what's going on? The > project is working fine on my laptop, so it's kind of been sucking not > being able to get working in production :( This is clearly an Apache issue - you probably have some sort of URL rewriting or redirecting going on in your Apache configuration. If you want to post that, we might be able to help further. -- DR. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Django not detecting URL - only index.php
Hi, I'm trying to deploy my django project on a production server, but Django always thinks the URL is index.php no matter what I put in. For example, when I put in the URL: http://your.flowingdata.com/some_random_string I get the following no matter what some_random_string is: Using the URLconf defined in urls, Django tried these URL patterns, in this order: 1. ^(?P\w+)/weight/ The current URL, index.php, didn't match any of these. Is there anyone out there who might have a clue what's going on? The project is working fine on my laptop, so it's kind of been sucking not being able to get working in production :( --~--~-~--~~~---~--~~ 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: Query for all objects in table1 that DO NOT have corresponding objects in table2
You may want to think about the design of your models as well. Do you really need a separate model for viewed_jobs? Could it just be a boolean field on the Jobs model itself. Otherwise there's a danger of a lot of repetition between the two models. Of course, I don't know your exact use case, so I may be making a bad assumption. On Nov 13, 11:47 am, Ropley <[EMAIL PROTECTED]> wrote: > Noob question, but I've been running around in circles. I'm building > an in-house jobs board, and have 2 models: > > class jobs(models.Model): > ... > > class viewed_jobs(models.Model): > job=models.ForeignKey(job) > ... > > I would like to create a query that returns all jobs that have not > been viewed - that is, those jobs for which there are no corresponding > entries in viewed_jobs. I'm rather stuck with the model definitions as > they are, for many reasons, and would like the database to do as much > work as possible. Web research has shown some potential in the 'extra' > QuerySet qualifier, but my noobness has defeated me. Grateful for any > pointers. > > Ropz --~--~-~--~~~---~--~~ 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: mod_python setup on Apache virtual host
On Nov 15, 4:14 pm, "Chris Bai" <[EMAIL PROTECTED]> wrote: > Can anyone point to me a reference to setup mod_python on Apache virtual > host for Django? Or write something about it? > > I am able to run my app in Django development server. I am also able to set > up virtual host to display index.html for my website. Now I am ready to move > my Django app to production but don't know how to setup virtual host for it. > My environment is Apache 2.2.10, mod_python 3.3.1, and Python 2.5.2. Which part of the online documentation don't you understand? http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ Graham --~--~-~--~~~---~--~~ 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: Beginner desperately seeking Django experts.
On Fri, 2008-11-14 at 22:54 -0800, Innergy wrote: > Thanks for reading my question. I may not be asking all the right > questions. > > I am looking for a fast way to build a ecommerce site with many of the > qualities of threadless.com. I was told Django is an excellent > language and allows for rapid fast implementation. > > My back ground is not in development. So I am agnostic. I am currently > leaning towards Ruby for my project. How does Django compare to > Ruby? Is Django faster to develop in? Is it as stable as Ruby? For somebody familiar with and expert in Python, Django will be faster. For somebody with Ruby skills, Ruby on Rails will be faster. Neither language (Python, Ruby) or web framework (Django, Rails) has any significant known stability problems and both programming languages have been around since the early- to mid-1990's. Django and Rails are roughly equivalent as frameworks; the differences are in the fine-details and I don't think any of those are show-stoppers. There are clearly trade-offs, since neither framework has everything that everybody wants, out of the box, but since they're both built on top of professional quality programming languages, it's possible to build any missing pieces if the motivation is strong enough. If you're asking for yourself, just setting our to learn a programming language and start development, then that's an entirely different question. Learning one of other language will probably take about the same amount of time. But I wouldn't be choosing threadless.com as the first project in that case and "fast" will not the appropriate word to describe the speed it will take to build if you also have to learn the programming language and the framework. In that case, you've essentially asked the equivalent of "I'm thinking about building a house and I don't have a background in construction. Should I use bricks or wood?" It's nice to have an end goal to keep you motivated, but there's a learning curve involved. 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 -~--~~~~--~~--~--~---
Beginner desperately seeking Django experts.
Thanks for reading my question. I may not be asking all the right questions. I am looking for a fast way to build a ecommerce site with many of the qualities of threadless.com. I was told Django is an excellent language and allows for rapid fast implementation. My back ground is not in development. So I am agnostic. I am currently leaning towards Ruby for my project. How does Django compare to Ruby? Is Django faster to develop in? Is it as stable as Ruby? Thanks to anyone who takes time to reply. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---