Re: creating a super user
Hi Yun, Make sure that 'django.contrib.admin' is in INSTALLED_APPS in your project's settings.py file. Hope this helps. Bryan On 8/14/06, yun <[EMAIL PROTECTED]> wrote: > I'm currently working through the tutorial using the lastest > development verison of django, downloaded from subversion. I've > installed django on an Ubuntu 6.06 linux box, and was wondering why I > wasn't prompted to create a super user account when I first tryed > '>manage.py syncdb'. I ask, because I can't seem to get into the admin > side of the tutorial project at all. > > Thanks for any help in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: creating a super user
On 8/15/06, yun <[EMAIL PROTECTED]> wrote: > > I'm currently working through the tutorial using the lastest > development verison of django, downloaded from subversion. I've > installed django on an Ubuntu 6.06 linux box, and was wondering why I > wasn't prompted to create a super user account when I first tryed > '>manage.py syncdb'. I ask, because I can't seem to get into the admin > side of the tutorial project at all. > > Thanks for any help in advance. > You can create a superuser like this: manage.py shell >>> from django.contrib.auth.create_superuser import createsuperuser >>> createsuperuser() -- I like python! My Blog: http://www.donews.net/limodou My Django Site: http://www.djangocn.org NewEdit Maillist: http://groups.google.com/group/NewEdit --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
creating a super user
I'm currently working through the tutorial using the lastest development verison of django, downloaded from subversion. I've installed django on an Ubuntu 6.06 linux box, and was wondering why I wasn't prompted to create a super user account when I first tryed '>manage.py syncdb'. I ask, because I can't seem to get into the admin side of the tutorial project at all. Thanks for any help in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
On 8/15/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On 8/14/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > > > Hi Gloria. > > > > welcome to django. > > Heheh. Welcome indeed. 10 helpful answers in under 20 minutes. ;-) > My GOD! -- I like python! My Blog: http://www.donews.net/limodou My Django Site: http://www.djangocn.org NewEdit Maillist: http://groups.google.com/group/NewEdit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
Gloria, Try: python manage.py runserver dev.blah.server.com: or python manage.py runserver 11.22.33.44: where 11.22.33.44 is the external numeric IP address of dev.blah.server.com. Regards, -scott On Mon, 2006-08-14 at 20:11 -0700, Gloria wrote: > Hi. I am a Python geek who has been in the CherryPy/PythonPaste world > for the past year. I have decided to give Django a serious look, and I > have a simple question. > > After running this command: > > [EMAIL PROTECTED] wi_2> python manage.py runserver > Validating models... > 0 errors found. > > Django version 0.95, using settings 'wi_2.settings' > Development server is running at http://127.0.0.1:/ > Quit the server with CONTROL-C. > > I expect to get to this URL from a remote machine, like this: > > http://dev.blah_server.com: > > This works in cherryPy and PythonPaste from behind the firewall, so I > know it's not a port issue. > > I'm sure I'm missing something simple. Please let me know what url > parameter to set to access my page from a remote machine. > > Thank you, > Gloria > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
When I run the dev server from my remote server, I do it like this: python manage.py runserver my.domainname.com:8000 Then I can access it through http://my.domainname.com:8000 my.domainname.com isn't setup anywhere else either (like in Apache or anything), but www.domainname.com is. Jay Gloria wrote: > Hi. I am a Python geek who has been in the CherryPy/PythonPaste world > for the past year. I have decided to give Django a serious look, and I > have a simple question. > > After running this command: > > [EMAIL PROTECTED] wi_2> python manage.py runserver > Validating models... > 0 errors found. > > Django version 0.95, using settings 'wi_2.settings' > Development server is running at http://127.0.0.1:/ > Quit the server with CONTROL-C. > > I expect to get to this URL from a remote machine, like this: > > http://dev.blah_server.com: > > This works in cherryPy and PythonPaste from behind the firewall, so I > know it's not a port issue. > > I'm sure I'm missing something simple. Please let me know what url > parameter to set to access my page from a remote machine. > > Thank you, > Gloria > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
Hi Gloria.welcome to django.you need to specify the ip# when you run the development server, otherwise it will run on 127.0.0.1 (localhost)which can not be accessed from outside the machine.try> django-admin.py runserver 192.168.1.2:or > django-admin.py runserver dev.blah_server.com:and it should work.regardsIan.On 15/08/2006, at 1:11 PM, Gloria wrote:Hi. I am a Python geek who has been in the CherryPy/PythonPaste worldfor the past year. I have decided to give Django a serious look, and Ihave a simple question.After running this command:[EMAIL PROTECTED] wi_2> python manage.py runserver Validating models...0 errors found.Django version 0.95, using settings 'wi_2.settings'Development server is running at http://127.0.0.1:/Quit the server with CONTROL-C.I expect to get to this URL from a remote machine, like this:http://dev.blah_server.com:This works in cherryPy and PythonPaste from behind the firewall, so Iknow it's not a port issue.I'm sure I'm missing something simple. Please let me know what urlparameter to set to access my page from a remote machine.Thank you,Gloria --Ian Holsman[EMAIL PROTECTED]join http://gypsyjobs.com the marketplace for django developers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
Hi Gloria, For the Django development server to be accessible externally, you must specify the IP address or 0.0.0.0, e.g. manage.py runserver 0.0.0.0: Hope this helps. Bryan On 8/14/06, Gloria <[EMAIL PROTECTED]> wrote: > Hi. I am a Python geek who has been in the CherryPy/PythonPaste world > for the past year. I have decided to give Django a serious look, and I > have a simple question. > > After running this command: > > [EMAIL PROTECTED] wi_2> python manage.py runserver > Validating models... > 0 errors found. > > Django version 0.95, using settings 'wi_2.settings' > Development server is running at http://127.0.0.1:/ > Quit the server with CONTROL-C. > > I expect to get to this URL from a remote machine, like this: > > http://dev.blah_server.com: > > This works in cherryPy and PythonPaste from behind the firewall, so I > know it's not a port issue. > > I'm sure I'm missing something simple. Please let me know what url > parameter to set to access my page from a remote machine. > > Thank you, > Gloria --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
On 8/14/06, Gloria <[EMAIL PROTECTED]> wrote: > > Hi. I am a Python geek who has been in the CherryPy/PythonPaste world > for the past year. I have decided to give Django a serious look, and I > have a simple question. > > After running this command: > > [EMAIL PROTECTED] wi_2> python manage.py runserver ... > I expect to get to this URL from a remote machine, like this: > > http://dev.blah_server.com: 127.0.0.1 is a local loopback. Get the IP address for dev.blah_server.com, then runserver with it. So, if dev.blah_server.com has an IP of 10.1.1.2, you'd run this: python manage.py runserver 10.1.1.2: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django neophyte question.
On 8/15/06, Gloria <[EMAIL PROTECTED]> wrote: > > Hi. I am a Python geek who has been in the CherryPy/PythonPaste world > for the past year. I have decided to give Django a serious look, and I > have a simple question. > > After running this command: > > [EMAIL PROTECTED] wi_2> python manage.py runserver > Validating models... > 0 errors found. > > Django version 0.95, using settings 'wi_2.settings' > Development server is running at http://127.0.0.1:/ > Quit the server with CONTROL-C. > > I expect to get to this URL from a remote machine, like this: > > http://dev.blah_server.com: > > This works in cherryPy and PythonPaste from behind the firewall, so I > know it's not a port issue. > > I'm sure I'm missing something simple. Please let me know what url > parameter to set to access my page from a remote machine. > > Thank you, > Gloria > > You should use: manage.py runserver host:port -- I like python! My Blog: http://www.donews.net/limodou My Django Site: http://www.djangocn.org NewEdit Maillist: http://groups.google.com/group/NewEdit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django neophyte question.
Hi. I am a Python geek who has been in the CherryPy/PythonPaste world for the past year. I have decided to give Django a serious look, and I have a simple question. After running this command: [EMAIL PROTECTED] wi_2> python manage.py runserver Validating models... 0 errors found. Django version 0.95, using settings 'wi_2.settings' Development server is running at http://127.0.0.1:/ Quit the server with CONTROL-C. I expect to get to this URL from a remote machine, like this: http://dev.blah_server.com: This works in cherryPy and PythonPaste from behind the firewall, so I know it's not a port issue. I'm sure I'm missing something simple. Please let me know what url parameter to set to access my page from a remote machine. Thank you, Gloria --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django 0.95 on Dreamhost
> i know this sounds stupid, but could you start from the beginning again, > and try it exactly like Jeff's tutorial says? I tried this approach. I followed every step from Jeff's tutorial (even with same subdomain and directories for django projects & src etc). At the end I still get the same error. This is getting kind of strange... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: A google search engine front end in django - Tutorial
I've been using the SOAP way in PHP. This web_search module is so simple so I've used it to make some tutorials. It can search in few engines and dmoz so it could be usefull sometimes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: VMWare image for running/developing Django
Hi all,It is posssible to setup Qemu ( platform independent ) http://fabrice.bellard.free.fr/qemu/and run djanog on it.I've test in with debian etch ,python2.3.5 ,django-trunk+sqlite3, no apache -run as django dev server.The whole image around 200mb with qcow compressed formatwithout compr = 449mbcompress winth bzip2 = 158MBThe full size inside = 316MBSo far it is runnig well. As well I've converted this image t ovmware format to run inside vmware - size of image before compress = 415mbafter compressing it with bzip2 size only 158mbIf anyone interested I can put the image qemu or vmware to somewhere. -- --Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Perplexing many-to-many template error (bug?)
I forgot to mention, from a shell I can access the M2M property fine, so it seems like a template problem: >>> p = Person.objects.get(pk=1) >>> p >>> p.projects >>> p.projects.all() [] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: subdomains in django
I'm not sure what you are asking.what do you want django to do with the subdomain?if it is a different site, you can do this via virtual hosts in apache.if you bob.example.com to be 'bobs' blog and 'sue.example.com' to be sue's blogyou can acomplish this via mod-rewrite without having to resort to trickery in django.otherwise you could write some middleware to do the same thing as well I think.On 15/08/2006, at 10:47 AM, a wrote:can you point out how to do this in django and in pythonthanks a bunch --Ian Holsman[EMAIL PROTECTED]http://car-chatter.com/ where car fanatics meet --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
subdomains in django
can you point out how to do this in django and in python thanks a bunch --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
javascript options
guys i m trying to figure out which javascript toolkit to use i m now trying to figure out which to use between The major contenders are: Dojo Mochikit and prototype [rails fame] i would love to find out which is very pythonic and clean if you can also tell about your experience of using one of these thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Perplexing many-to-many template error (bug?)
Perplexing many-to-many problem === When attempting to iterate a many-to-many relationship of a context variable, I am receiving a weird template error. Any help would be greatly appreciated! My Models - Person() projects = models.ManyToManyField(Task, blank=True) Task() Middleware -- - custom middleware which is inserting person into request (very similar to contrib.auth) - request context processor which puts request into my template What Works as Expected -- {{ request.person.name }} works fine {{ request.person.company.name }} (where company is a FK) works fine {{ request.person.projects }} returns {% for project in request.person.notaproperty %} skips the for loop as expected {% for project in request.person.projects %} returns an "iteration over non-sequence" as expected (a ManyRelatedManager isn't iterable, the .all() queryset is) What Doesn't (aka, The Problem) --- {% for project in request.person.projects.all %} It returns a template error. Here are the final lines of the traceback: File "D:\Web\Python24\lib\site-packages\django\db\models\query.py" in parse_lookup 734. joins2, where2, params2 = lookup_inner(path, lookup_type, value, opts, opts.db_table, None) File "D:\Web\Python24\lib\site-packages\django\db\models\query.py" in lookup_inner 835. raise TypeError, "Cannot resolve keyword '%s' into field" % name TypeError at /projects/ Cannot resolve keyword 'person' into field --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: A google search engine front end in django - Tutorial
On 8/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I've just finished a tutorial about a simple google front end in > Django. > read it on the wiki: http://code.djangoproject.com/wiki/searchengine Hi. Interesting stuff. I've done a bit of Google hacking myself and I'd caution against screen scraping for Google results. Google can (and does -- Eric Moritz, I'm looking at you. :-) blacklist IP addresses for screen scraping. There is a JavaScript API for Google search and a Google SOAP api, which could all work for you, available from code.google.com. I've got a Python library wrapper around the SOAP api, written in Python and released GPL. It's at http://www.devurandom.org/googledevel/gcli/. There are others as well. Mark Pilgrim has one, too, I believe. Google for "google search api python" for more options, but the JavaScript API is very nice, too, if you don't mind a client-side implementation. Cheers, deryck -- Deryck Hodge http://www.devurandom.org/ Web Developer, Naples News http://www.naplesnews.com/ Samba Team http://www.samba.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Strange 'caching' issue
On Mon, 2006-08-14 at 10:40 -0700, hernan43 wrote: > First let me say that I loathe using the term 'caching' to describe > this problem as it probably has nothing to do with caching. But my > primitive vocabulary is at a loss for a better word. > > I have a very simple Django blog app that I'm using to learn more about > the Django framework. I notice that when I add a blog entry, it doesn't > show up right away. Sometimes it takes more than a day before it will > show up. Other times it will post right away. > > If I add a post and it doesn't show up right away, all I need to do is > to bounce Apache and boom there it is. I'm not sure what exactly I am > doing wrong. I don't have any caching enabled. I'm not loading the > caching middleware or anything like that. > > I wonder if my Apache config might not be as correct as it should be. I > have tried tweaking the maxrequestsperchild, but I still see the same > behavior. > > Would anyone know what I should be looking at? I am certain that this > is my fault. i have been googling the mailing list and I don't really > see anything that looks the same as my problem. Thanks in advance for > any help. Very odd (my first guess would have been timezones as well, but you've ruled that out). One thing to check would be the headers returned from the request to the server. Is the server giving you a new version or a cached version. If you are using something like Linux or Mac-OS, a command like "curl -i ..." (or "curl -I ..." to *just* see the headers) will be useful. Or your browser might be able to show you the headers. On the server side, try putting some logging statements into the code where you query for your list of blog entries. Print the length of that list and the dates or something. Just to check that it's retrieving the right data. If you print to sys.stderr, the results will appear in Apache's error_log (although mod_python buffers sys.stderr (grr!), so you have to call sys.stderr.flush() as well if you want to see the results immediately). One mistake people sometimes make is passing a query set in the extra_context to a generic view and expecting it to be updated on each call -- it isn't (see the docs for the generic views for an exaplanation), although the main queryset you pass in is requeried on each call to the view. This one is a long shot, since I can't imagine you would be doing this to present blog posts, but we've seen it half a dozen times in the past few months, so it's not out of the bounds of possibility. Really, beyond starting to put fencepost prints in your code to see what is being called when, it's a little hard to suggest other things. It does sound like something isn't being evaluated afresh each time, though. Shouldn't be too hard to narrow down. 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 -~--~~~~--~~--~--~---
Question and a problem about FileField
Question: === After saving a record that includes a file attachment (in a FileField), how can I open the the attached file directly from my django application? Problem: == Please, check next model.py: from django.db import models from django.db import models class MaeDocs(models.Model): cod_doc = models.CharField('Document code', maxlength=15) nom_doc = models.TextField('Document name') doc_adj = models.FileField(upload_to='C:/os/Django/docum/doc_uploads') def __str__(self): return (self.cod_doc + "-" + self.nom_doc[:50]) class Admin: pass class OthAttachs(models.Model): cod_doc = models.ForeignKey(MaeDocs, edit_inline=models.STACKED, num_in_admin=3) fil_att = models.FileField(upload_to='oattach', core=True) def __str__(self): return self.fil_att class Admin: pass First table is for saving data about a document including its main attachment. Second table is for attaching one or more additional documents related to the first one. When I save a first record including main and additional attachments and then I verify the results of the saving, all goes well; if I change the content of some data in the MaeDocs table (nom-doc for example) and save the changes, when verifying the record again I can see that the secondary attachment files disappeared. Checking the History of the record, it indicates that the secondary attachments were effectively replaced by ' '. How can I avoid this situation? Thanks!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
1062, "Duplicate entry '1' for key 2"
Somehow creating 2 instances of a model constantly gives me the following error: -- 1062, "Duplicate entry '1' for key 2" -- The code in the view method is: -- def new(request): t = T(userID=request.user.id) t.save() -- It seems that userID should be unique, but I don't specify that in my model -- class T(models.Model): userID = models.PositiveIntegerField() -- What am I doing wrong here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django 0.95 on Dreamhost
Apple wrote: > >>> python hello.fcgi > output: > WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! > WSGIServer: missing FastCGI param SERVER_NAME required by WSGI! > WSGIServer: missing FastCGI param SERVER_PORT required by WSGI! > WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI! > Status: 200 OK > Content-Type: text/plain > that's ok when you start it from the command-line. i know this sounds stupid, but could you start from the beginning again, and try it exactly like Jeff's tutorial says? gabor --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
A google search engine front end in django - Tutorial
I've just finished a tutorial about a simple google front end in Django. read it on the wiki: http://code.djangoproject.com/wiki/searchengine --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Re: Odd error with ./manage.py runserver
Jeremy, Thanks for the solution, I had a module in middleware_classes rather than installed_apps. --Jon On 14/08/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On 8/14/06, Jon Atkinson <[EMAIL PROTECTED]> wrote: > > TypeError: 'module' object is not callable > > > > If I hit reload, everything starts to work fine again, but it's > > annoying to have to reload my browser twice after each change I make. > > Any ideas? > > It looks like you've specified a module instead of a class in > MIDDLEWARE_CLASSES. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Shell not picking up db changes
Wow, that does the trick! Thank you very much. I'm not exactly sure what this command does, though --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Strange 'caching' issue
I don't think this is it. If I restart Apache then the post will appear. I would think that it had to do with my browser's cache, but clearing the cache doesn't help, plus if I use a browser that has never been to my site, I have the same problem. It almost seems as if the response is cached somehow, and whatever is caching that response takes a really long time to expire. The weird thing is, I don't have the caching middleware enabled or in use in any way. --Ray --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Strange 'caching' issue
I forget the details, but this has something to do with your time and/or timezone setup. The default blog app doesn't post items that are set "in the future". The time you set by seleting "now" in the admin may or may not be the time that you think it should be because of the server clock and timezone settings. Something like that anyway. Probably not caching (unless you have enabled site-wide caching, then perhaps that is the problem.) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How would I do this with Djangol?
HBTaylor wrote: > I'm not sure about your models, but I assume it is something like the > following: > > from django.db import models > > class Holding(models.Model): > symbol = models.CharField(maxlength=10) > > def __str__(self): > return self.symbol > > def _get_latest_price(self): > return self.price_set.all()[0] > > get_latest_price = property(_get_latest_price) > > class Admin: > pass > > class Price(models.Model): > holding = models.ForeignKey(Holding) > price = models.FloatField(max_digits=6,decimal_places=2) > pdate = models.DateField() > > def __str__(self): > return "%s - %s - %s" % > (self.holding.symbol,self.pdate,self.price) > > class Admin: > pass > > class Meta: > ordering = ("-pdate",) > > For it, I've added ordering to the Meta for Price, so it always returns > the prices in descending order of date. At that point, the > event_set.all()[0] for a given Holding will give its latest price. I > added a _get_latest_price() convenience method (and made it a property) > just for giggles, but that should allow you to do use something like > myholding.get_latest_price.price (as well as accessing the date) for a > holding of your choice. > > Will that do the trick? > > By the way, it seems like having the symbol in your Price model would > be redundant, since you can use myprice.holding.symbol to get the > symbol if you are listing (for example) all of the prices for a given > day. > > H.B. WOW! Awesome, that looks great, and was just leading into my other question! I am stil new to Python and Django, so putting the OO stuff to it all is a little overwhelming. Thanks so much HB 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 -~--~~~~--~~--~--~---
Re: SuspiciousOperation: User tampered with session cookie
Although old, I'd like to point out that at least in my case this wasn't a Dapper + PHP5 issue, it was a Deb + PHP5 issue, so the problem seems to lie with the PHP5/Django pairing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: EnvironmentError?
On 08/14/06 18:55, Tom Davis wrote: > I am having a problem getting Django to work properly on my server. I > have Apache setup with mod_python using Python 2.4. I put in the > Location stuff in my Apache config, and when I go to the directory I > get this: > --- > 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 > "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", > line 163, in handler > return ModPythonHandler()(req) > > File > "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", > line 125, in __call__ > if settings.ENABLE_PSYCO: > > File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line > 27, in __getattr__ > self._import_settings() > > File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line > 54, in _import_settings > self._target = Settings(settings_module) > > File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line > 82, in __init__ > raise EnvironmentError, "Could not import settings '%s' (Is it on > sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e) > > EnvironmentError: Could not import settings '.settings' (Is it > on sys.path? Does it have syntax errors?): No module named > .settings > --- > > I tried adding the PythonPath line because I figured it was a problem > with my sys.path (well duh the error suggests it), but that didn't > change anything. I also made sure to give chown to the same user/group > that all the web files are, just in case Apache couldn't read the > django directories or something. Thoughts? > Hi Tom Post us your apache config so we have something to work with :) cheers Steven --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Strange 'caching' issue
First let me say that I loathe using the term 'caching' to describe this problem as it probably has nothing to do with caching. But my primitive vocabulary is at a loss for a better word. I have a very simple Django blog app that I'm using to learn more about the Django framework. I notice that when I add a blog entry, it doesn't show up right away. Sometimes it takes more than a day before it will show up. Other times it will post right away. If I add a post and it doesn't show up right away, all I need to do is to bounce Apache and boom there it is. I'm not sure what exactly I am doing wrong. I don't have any caching enabled. I'm not loading the caching middleware or anything like that. I wonder if my Apache config might not be as correct as it should be. I have tried tweaking the maxrequestsperchild, but I still see the same behavior. Would anyone know what I should be looking at? I am certain that this is my fault. i have been googling the mailing list and I don't really see anything that looks the same as my problem. Thanks in advance for any help. --Ray --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
EnvironmentError?
I am having a problem getting Django to work properly on my server. I have Apache setup with mod_python using Python 2.4. I put in the Location stuff in my Apache config, and when I go to the directory I get this: --- 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 "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 163, in handler return ModPythonHandler()(req) File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 125, in __call__ if settings.ENABLE_PSYCO: File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 27, in __getattr__ self._import_settings() File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 54, in _import_settings self._target = Settings(settings_module) File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 82, in __init__ raise EnvironmentError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e) EnvironmentError: Could not import settings '.settings' (Is it on sys.path? Does it have syntax errors?): No module named .settings --- I tried adding the PythonPath line because I figured it was a problem with my sys.path (well duh the error suggests it), but that didn't change anything. I also made sure to give chown to the same user/group that all the web files are, just in case Apache couldn't read the django directories or something. Thoughts? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Anyone at LinuxWorld next week?
On 8/12/06, Deryck Hodge <[EMAIL PROTECTED]> wrote: > I put in for space for a BOF yesterday, but I haven't heard anything > yet. I don't know if it being such short notice will be a problem or > not. When I hear something, I'll let you know. BOFs don't start > until Tuesday night, so even if I hear something Monday, that might be > enough time to post something to the web site. Looks like I waited too late to get this going for LinuxWorld San Francisco. As I mentioned before, if anyone happens to be here, just email me and we can hang out. Cheers, deryck -- Deryck Hodge http://www.devurandom.org/ Web Developer, Naples News http://www.naplesnews.com/ Samba Team http://www.samba.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Odd error with ./manage.py runserver
On 8/14/06, Jon Atkinson <[EMAIL PROTECTED]> wrote: > TypeError: 'module' object is not callable > > If I hit reload, everything starts to work fine again, but it's > annoying to have to reload my browser twice after each change I make. > Any ideas? It looks like you've specified a module instead of a class in MIDDLEWARE_CLASSES. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
list_display containing ForeignKey create a dead loop.
Hi all, I met a problem. When I added a Foreign Key field to list_display, django falls into a dead loop and used up memories. When I removed the field, it's all OK. I don't think it's my code's problem because I've tested the __str__ function of both models related by the Foreign Key. Could anybody tell me how to debug django? I used winpdb to run command: manage.py runserver The server is started but the breakpoints I set at django\contrib\admin\views.py do not work. Hehe, maybe I can figure out what happened and fix a bug of django. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django 0.95 on Dreamhost
> generally this means that you should put in some url-rewriting... hm.. maybe this has something to do with it. I got the following warnings prior to the index exception WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! WSGIServer: missing FastCGI param SERVER_NAME required by WSGI! WSGIServer: missing FastCGI param SERVER_PORT required by WSGI! WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI! here is my .htacess config (this is from the Django Project) AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ /flickr.fcgi/$1 [QSA,L] I've also used a config that's similar to the jeffcroft.com tutorial. I still got the same error on common.py. I've also tried a simple hello.fcgi test from fcgi import WSGIServer def test_app(env, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) yield 'Hello world!' WSGIServer(test_app).run() >> python hello.fcgi output: >> WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! WSGIServer: missing FastCGI param SERVER_NAME required by WSGI! WSGIServer: missing FastCGI param SERVER_PORT required by WSGI! WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI! Status: 200 OK Content-Type: text/plain What am I missing? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Shell not picking up db changes
Hi cyberco,On 8/13/06, cyberco <[EMAIL PROTECTED]> wrote:> Is there a way to pick up the changes without restarting the shell? Try to commit the current transaction:import django.dbdjango.db.connection._commit()-- Obstáculos es lo que ves cuando apartas la vista del objetivo. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: cache anonymous error with request.user ?
[EMAIL PROTECTED] wrote: > MIDDLEWARE_CLASSES = ( > 'django.middleware.cache.CacheMiddleware', > 'django.middleware.common.CommonMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware', > 'django.middleware.doc.XViewMiddleware', > ) Try moving CacheMiddleware *after* Session and Auth middlewares. -- Nebojša Đorđević - nesh Studio Quattro - Niš - SCG http://studioquattro.biz/ http://djnesh.blogspot.com/ | http://djnesh-django.blogspot.com/ | http://trac.studioquattro.biz/djangoutils/ Registered Linux User 282159 [http://counter.li.org] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Shell not picking up db changes
Yes, but the disadvantage of using 'import x.y.z as mymodel' instead of 'import x.y.z'b is that instead of using a = A() I have to say a = mymodel.A(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: custom manipulator - TextField or SelectField in RadioSelectField?
Hi John,thanks for the response. I was thinking about this overnight and I'd have to agree, it'd probably be best to use a "hybrid" approach as you were mentioning (I'm already breaking out the radiobuttons into an on-template loop: it wouldn't be much more than that, I'd assume). thanks again,-ChrisOn 8/14/06, John Sutherland <[EMAIL PROTECTED]> wrote: Hi Chris,I'd say there were two ways to handle this. The data that you really want is the number of rows, you radios are really just to help theuser choose a value.Option #1 -- Use a custom field.You can create your own custom field type, but this is probablyoverkill for this application. Option #2 -- Use the raw post data.You don't have to use Manipulators and in more complicated forms itmay be easier not to (or you could have a hybrid aproach, where youuse a manipulator, but don't put the {{ form.field_name }} in yourtemplates).Good luck,John.On 8/14/06, Chris Kelly <[EMAIL PROTECTED]> wrote:>> Hey all,>> I am trying to create a series of radio buttons where you can select > one radio button, and next to the selection will be a Text Field, drop> box, or maybe both, for additional information related/ needed for the> current radio selection.>> like so:> > Radio | Label> (o) show all rows> () Limit to [text field] rows> () Limit to [text field] percent of rows>> or, either line might have a select field instead of a text field, > e.g.:> () Limit to [select field] percent of rows>> is it possible to put a text field/ select field into a choices section> of a radio list? Or would this be better served by manually retrieving > form values in a post call and parsing them individually (rather than> via a manipulator)?>> thanks!>> -C>>> >>-- [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 -~--~~~~--~~--~--~---
Re: Authentication, error "DoesNotExist at /accounts/login/", part 2
On 8/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > 1. Created a new site > 2. Removed example.com from the list of sites > 3. Tried to use authentication and got the error "DoesNotExist at > /accounts/login/" > 4. Deleted and rebuilt the database, authentication works. Did you actually delete the 'example.com' entry in sites? That will probably break things, because by default your settings file will have 'SITE_ID = 1', and deleting that entry removes the object in the database with an id of 1. The 'DoesNotExist' exception is a result of that; Django's trying to look up a Site object with an id of 1, and there isn't one anymore. If instead you just edit the 'example.com' site to have your actual domain and the name of your site, this problem shouldn't happen. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Shell not picking up db changes
However, keep in mind Pedro's example, where he uses "import x.y.z as a" and then later calls "reload(a)". In other words, using the "as" functionality of import lets you have the best of both worlds--reload() will work, and you can still get a single-word binding in your namespace for your Model module :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Authentication, error "DoesNotExist at /accounts/login/", part 2
Hi, the following happened to me also: 1. Created a new site 2. Removed example.com from the list of sites 3. Tried to use authentication and got the error "DoesNotExist at /accounts/login/" 4. Deleted and rebuilt the database, authentication works. Regards, Andres blue_beastie wrote on 29 Jun 2006: "I was experiencing this problem as well, so what I ended up doing is rebuilding dropping the entire database for my project and re-running "./manage.py syncdb". Doing this fixed the problem. I think this problem was caused when I removed example.com from the list of Sites in the admin interface." --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Can i have a field to be set as current user id automatically in admin ?
Something like auto_now option of DateField , Can i have a 'auto_current_user' field ?thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Chain filters on ManyToManyField
I'm working from the top of my head here (I'm at work), but wouldn't ANDing two Q's be a solution? I remember having constructed a QuerySet of two Q's &'ed together, as in qs = (Q() & Q()), and then evaluating qs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django 0.95 on Dreamhost
Apple wrote: > Hi has anyone tried running Django 0.95 on Dreamhost? I only tried to > setup a simple project following the dreamhost's wiki. I am getting a > string index out of range exception on common.py: hi, generally this means that you should put in some url-rewriting... just for the reference, i have a very simple django app (0.95) running on dreamhost without problems... try to follow this howto: http://www2.jeffcroft.com/2006/may/11/django-dreamhost/ gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Getting properties of parent objects into a template
And I am a 'tard. I had pluralized the name of my author foreign key so that the actualy name of the foreign key was "authors" and not "author". Once I used {{ entry.authors.name }}, everything was fine. Still learning here, Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Getting properties of parent objects into a template
On 8/14/06, mediumgrade <[EMAIL PROTECTED]> wrote: > > Yes, that would be the relationship and that was actually the first > thing I tried. The template gets passed an "array" of "entry" objects. > Within the template, I loop through them printing the headline, portion > of the body, and the created date. With Author's as a foreign key, I > assumed you could do something like {{ entry.author.name }} but I get > nothing in my output when I do this. I assume that objects passed in a > template can't follow their foreign key relationships. > > Sorry, I am still very new to both Django as well as Python. Forgive me > if I am not stating my problem clearly. > I suggest that you try the code in manage.py shell, and see what you get. And i don't know the model definition of your app, and if the Auther is comes from User Model, the 'name' should be 'username'. -- I like python! My Blog: http://www.donews.net/limodou My Django Site: http://www.djangocn.org NewEdit Maillist: http://groups.google.com/group/NewEdit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Getting properties of parent objects into a template
Yes, that would be the relationship and that was actually the first thing I tried. The template gets passed an "array" of "entry" objects. Within the template, I loop through them printing the headline, portion of the body, and the created date. With Author's as a foreign key, I assumed you could do something like {{ entry.author.name }} but I get nothing in my output when I do this. I assume that objects passed in a template can't follow their foreign key relationships. Sorry, I am still very new to both Django as well as Python. Forgive me if I am not stating my problem clearly. Ivan Sagalaev wrote: > mediumgrade ÐÉÛÅÔ: > > I have a simple blog app that I am working on. In this app, I have > > ojects for each entry as well as the author who wrote it. I wrote a > > simple view which displays a list of all entrys made, but I want that > > list to include the name of the author. Since the author's name is not > > part of the entry, how do I access attributes from related objects > > within a template? > > If I'm guessing correctly that relation is like this: > > class Article(models.Model): >author = models.ForeignKey(Author) > > ... then {{ article.author.name }} should work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: DateField(blank=True), null?
On 8/14/06, Rares Vernica <[EMAIL PROTECTED]> wrote: > I have a DateField with blank=True and after I complete and submit the > form I get a Django error saying that DateField cannot be null? As the model documentation points out, you must also set 'null=True' on the field to have the database accept NULL values; 'blank' is for admin validation only, and has no effect on whether the database will accept NULL. The distinction is necessary to allow situations where a field can be left blank via initial user input, but still requires that something else fill it in before saving (for example, you might want to have a field the user can fill in, but which will be filled with a default or automatically-calculated value when left blank). > I don't like the idea of manually going and changing the DB schema. The column in the database will have been created with a NOT NULL constraint; that constraint can only be removed by executing the appropriate SQL statement for the database you're using. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
DateField(blank=True), null?
Hi, I have a DateField with blank=True and after I complete and submit the form I get a Django error saying that DateField cannot be null? How can I set the DateField so that it can be empty, and eventually null in the DB? I don't like the idea of manually going and changing the DB schema. Thanks, Ray --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---