Re: Django TypeError
On Tue, Jul 17, 2012 at 11:59 AM, @@ wrote: > u = User.objects.all() > u is not a user. > Oh yes, thank you for pointing. Please help me with this : How can I get the user id or 'u' of the user who has login using Django inbuilt authentication, so that I can give different views to the users based on there permissions ? Thanks in advance. -- Sandeep Kaur E-Mail: mkaurkha...@gmail.com Blog: sandymadaan.wordpress.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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django TypeError
On Wed, 2012-07-18 at 14:10 +0530, Sandeep kaur wrote: > On Tue, Jul 17, 2012 at 11:59 AM, @@ wrote: > > u = User.objects.all() > > u is not a user. > > > Oh yes, thank you for pointing. > Please help me with this : > How can I get the user id or 'u' of the user who has login using > Django inbuilt authentication, so that I can give different views to > the users based on there permissions ? > Thanks in advance. request.user -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
one field of modelForm doesn't being displayed
I confront a strange situation since one field of my modelForm doesn't being displayed (only its label is) so I can't put a value there when the form is rendered and I get the error: ORA-01400: cannot insert NULL into ("VPMS_BETA"."WEBREQUESTS"."DIRECTIONDB"). Of course, i don't wanna change the thing that it is not nullable. What should I do? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/f89DfOAf0ewJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Template problem
add grappelli in installed_apps settings.py On 18 July 2012 04:38, Eli_West wrote: > why I posted this question, i dont know plz help lol > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/m68NaOa1yXoJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- С уважением, Иван -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: django+apache
Using gunicorn in virtual environment. On 18 July 2012 04:03, Kurtis Mullins wrote: > Hello Carlos, > > I apologize but I am unable to understand your problem. It looks like you > are trying to use Apache to forward requests on to Django using > "mod_python". > > According to Django's web site, "mod_python" is deprecated and therefore > shouldn't be used. (Source: > https://docs.djangoproject.com/en/1.4/howto/deployment/modpython/) > > Instead, I recommend following this guide and use WSGI: > https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/ > > Once you give that a try and run into a specific problem, feel free to > post back with your specific problem and I'm sure someone will do their > best to help you out. > > Good luck! > - Kurtis Mullins > > > On Tue, Jul 17, 2012 at 6:39 PM, Carlos Andre wrote: > >> hi programers, i'm with troble in apache with django connect! >> what i can make to connect! >> i start with mod_python, but have very troble! >> can Somebory help me? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- С уважением, Иван -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: SuspiciousOperation exception on ImageField upload
But i want to upload to following path.. /usr/local/apache2/htdocs/goibibo/travelibibo/static/refundsReports/%Y%m%d And the first back slash is must. I can't remove that. So please let me know how can i handle this case. Thanks, Binny On Tuesday, August 19, 2008 6:17:16 PM UTC+5:30, Jon Atkinson wrote: > > Hello, > > I'm trying to work with a model which accepts a logo image upload via > an ImageField. My a cut down version of my model is below: > > class Promoter(models.Model): > name = models.CharField(max_length=100) > logo = models.ImageField(upload_to="/images/promoters/%Y/%m/%d/") > > When I try to upload the logo via the built-in admin interface, I get > the following error: > > SuspiciousOperation at /admin/promoters/promoter/add/ > Attempted access to '/images/promoters/2008/08/19/kitten.jpg' denied. > > In settings.py, my MEDIA_ROOT is set to an accessible directory in my > home folder: '/home/username/projectname/media/', and this folder has > it's permissions set to 777. > > I'm currently using the ./manage.py webserver, which (I assume) runs > as the same user which starts the process; this is the same user as > owns the folder specified above. > > Any ideas what I'm doing wrong here? > > --Jon > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/5DiLmGCf_E0J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Getting the 500html page instead the 404html
Hello folks. Just for the record, this is my first project in Django. The problem is this: When i have the debug on true and i search for a page that i know that don't exist i get the expected Django 404 error. But when i turn off the Debug, instead of getting my 404html page, i get the 500html page. I don't even know which mistake in my code could be originating this. Any thoughts? Regards, nffdiogosilva. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/E9yNKPrGjgoJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Xeround DB engine compatability
Hi all I'm looking at using Xeround as a DB backend. I've already come up against that as it detects a version > 5.0.3 it tries to use savepoints which are not supported. http://stackoverflow.com/questions/10193449/how-to-use-django-1-4-with-xeround Happy to carry on and try all the features but just wondering if anyone can immediately spot other features that Django requires that Xeround doesn't. Xeround compatability here: http://xeround.com/developers/release-notes/ Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/Vmf4W0cFuDcJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Getting the 500html page instead the 404html
there may be problem in your code but regarding the Debug=True, it loads 404.html and display errors, but we can't put Debug=True live so if Debug=False then djago automatically load your 500.html and where you can write your own message for the user, and can redirect them from that url. to check the actual error you need to make Debug=True, so that it can display errors in your local machine. On Wednesday, 18 July 2012 15:34:49 UTC+5:30, nffdiogosilva wrote: > > Hello folks. > > Just for the record, this is my first project in Django. > > The problem is this: > > When i have the debug on true and i search for a page that i know that > don't exist i get the expected Django 404 error. > But when i turn off the Debug, instead of getting my 404html page, i get > the 500html page. I don't even know which mistake in my code could be > originating this. > > Any thoughts? > > Regards, > nffdiogosilva. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/_sKmwed6Ej0J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
I can not install Django on Windows7
when I run the installation of Django python setup.py install - comes at the end of an error that can not be put Django in C: \ Python27 \ Lib \ site-packages -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/YwCQJXpOeV8J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: I can not install Django on Windows7
try using pip: pip install django On Wed, Jul 18, 2012 at 3:50 PM, Владислав Иванов wrote: > when I run the installation of Django python setup.py install - comes at > the end of an error that can not be put Django in C: \ Python27 \ Lib \ > site-packages > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/YwCQJXpOeV8J. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: one field of modelForm doesn't being displayed
On Wed, Jul 18, 2012 at 5:48 AM, mapapage wrote: > Of course, i don't wanna change the thing that it is not nullable. then what do you want to insert there? you can either define a default value, add a hidden field to the form, or in the view add some value to the user input before feeding to the form object -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: I can not install Django on Windows7
I've used these instructions for running on IIS with Helicon Zoo. Might be worth looking at: http://www.helicontech.com/articles/running-django-on-windows-with-performance-tests/ On Wednesday, July 18, 2012 7:50:48 AM UTC-5, Владислав Иванов wrote: > > when I run the installation of Django python setup.py install - comes at > the end of an error that can not be put Django in C: \ Python27 \ Lib \ > site-packages > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/DloEfLwcWTYJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Prepopulating a contact form
Hi everyone, I have a contact form in my app and would like to prepopulate it with user details where a user is logged in. Basically, I do the following: reg_user = get_registered_user(request) # get my form object I would like to do something like: if reg_user: my_form.name = reg_user.name my_form.email_address = reg_user.email_address # and so on ... Any ideas? Thanks ... -- Regards, Sithembewena Lloyd Dube -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Prepopulating a contact form
user = request.user initial = {} if user.is_authenticated: initial.update({ 'name': user.name, 'email_address': user.email_address }) form = MyContactForm(initial=initial) On Wed, Jul 18, 2012 at 11:23 AM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a contact form in my app and would like to prepopulate it with user > details where a user is logged in. Basically, I do the following: > > reg_user = get_registered_user(request) > # get my form object > > > I would like to do something like: > if reg_user: > my_form.name = reg_user.name > my_form.email_address = reg_user.email_address > # and so on ... > > Any ideas? Thanks ... > > -- > Regards, > Sithembewena Lloyd Dube > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste bunny (")_(") to help him gain world domination. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Prepopulating a contact form
Thanks Tomas, just what i needed :) On Wed, Jul 18, 2012 at 4:44 PM, Tomas Neme wrote: > user = request.user > initial = {} > if user.is_authenticated: > initial.update({ 'name': user.name, 'email_address': > user.email_address }) > form = MyContactForm(initial=initial) > > > On Wed, Jul 18, 2012 at 11:23 AM, Sithembewena Lloyd Dube < > zebr...@gmail.com> wrote: > > Hi everyone, > > > > I have a contact form in my app and would like to prepopulate it with > user > > details where a user is logged in. Basically, I do the following: > > > > reg_user = get_registered_user(request) > > # get my form object > > > > > > I would like to do something like: > > if reg_user: > > my_form.name = reg_user.name > > my_form.email_address = reg_user.email_address > > # and so on ... > > > > Any ideas? Thanks ... > > > > -- > > Regards, > > Sithembewena Lloyd Dube > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-users@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/django-users?hl=en. > > > > -- > "The whole of Japan is pure invention. There is no such country, there are > no such people" --Oscar Wilde > > |_|0|_| > |_|_|0| > |0|0|0| > > (\__/) > (='.'=)This is Bunny. Copy and paste bunny > (")_(") to help him gain world domination. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Regards, Sithembewena Lloyd Dube -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: SuspiciousOperation exception on ImageField upload
Hi Binny, Your problem sounds like one I had months ago. I got this response at the time: You need to make sure that the same process running your python interpreter has write permissions to your media directory. >From StackOverflow: "The process that is running your Python interpreter doesn't have permission to write into the media directory. You'll need to either chgrp or chrown the media directory to the same group as your Python process, and ensure you have at least g+rwx on directories and g+rw on files." http://stackoverflow.com/questions/5543641/django-media-upload-errno-13-permission-denied On Wed, Jul 18, 2012 at 9:12 AM, binny wrote: > But i want to upload to following path.. > > /usr/local/apache2/htdocs/goibibo/travelibibo/static/refundsReports/%Y%m%d > > And the first back slash is must. I can't remove that. So please let me > know how can i handle this case. > > Thanks, > Binny > > > On Tuesday, August 19, 2008 6:17:16 PM UTC+5:30, Jon Atkinson wrote: >> >> Hello, >> >> I'm trying to work with a model which accepts a logo image upload via >> an ImageField. My a cut down version of my model is below: >> >> class Promoter(models.Model): >> name = models.CharField(max_length=**100) >> logo = models.ImageField(upload_to="/** >> images/promoters/%Y/%m/%d/") >> >> When I try to upload the logo via the built-in admin interface, I get >> the following error: >> >> SuspiciousOperation at /admin/promoters/promoter/add/ >> Attempted access to '/images/promoters/2008/08/19/**kitten.jpg' denied. >> >> In settings.py, my MEDIA_ROOT is set to an accessible directory in my >> home folder: '/home/username/projectname/**media/', and this folder has >> it's permissions set to 777. >> >> I'm currently using the ./manage.py webserver, which (I assume) runs >> as the same user which starts the process; this is the same user as >> owns the folder specified above. >> >> Any ideas what I'm doing wrong here? >> >> --Jon >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/5DiLmGCf_E0J. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Regards, Sithembewena Lloyd Dube -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: django comments with tinymce
I solved it. Problem was with AJAX :) On Tue, Jul 17, 2012 at 2:30 PM, Aljoša Mohorović < aljosa.mohoro...@gmail.com> wrote: > On Tue, Jul 17, 2012 at 10:47 AM, Benasg wrote: > > Hello, when I using django comments without tinymce it`s works perfect, > but > > when I add tiny I get error "This field is required". > > Any suggestion? > > can you post models.py code before and after you added tinymce? > > Aljosa > -- > https://twitter.com/maljosa > https://github.com/aljosa > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: I can not install Django on Windows7
try safe mode On Wed, Jul 18, 2012 at 9:38 AM, Wes wrote: > I've used these instructions for running on IIS with Helicon Zoo. Might be > worth looking at: > > > http://www.helicontech.com/articles/running-django-on-windows-with-performance-tests/ > > > > On Wednesday, July 18, 2012 7:50:48 AM UTC-5, Владислав Иванов wrote: >> >> when I run the installation of Django python setup.py install - comes at >> the end of an error that can not be put Django in C: \ Python27 \ Lib \ >> site-packages >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/DloEfLwcWTYJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: I can not install Django on Windows7
Do you have the proper level of security on the machine to install software? On Wednesday, July 18, 2012 8:50:48 AM UTC-4, Владислав Иванов wrote: > > when I run the installation of Django python setup.py install - comes at > the end of an error that can not be put Django in C: \ Python27 \ Lib \ > site-packages > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/vAB2AZlnAvQJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django TypeError
On Wed, Jul 18, 2012 at 3:13 PM, kenneth gonsalves wrote: > On Wed, 2012-07-18 at 14:10 +0530, Sandeep kaur wrote: > request.user Thank you sir , this was helpful. :) -- Sandeep Kaur E-Mail: mkaurkha...@gmail.com Blog: sandymadaan.wordpress.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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
INSTALLED Grappelli App and getting some error
TemplateSyntaxError at /admin/ 'url' is not a valid tag library: Template library url not found, tried django.templatetags.url,element.grappelli.templatetags.url,django.contrib.admin.templatetags.url plz help -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/bB26jUPm6h4J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
RE: Can't use admin with apache
What does your Apache log look like? What, exactly, is the 500? A common issue when deploying is if your fcgi or wsgi script doesn't have the correct permissions set, which would cause an error that can't be caught by Django. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Matt Smith Sent: Monday, July 16, 2012 10:24 PM To: django-users@googlegroups.com Subject: Can't use admin with apache Background: I work on my projects using apache2 on my desktop machine, then just rsync across to the actual server (also apache2), that way I thought I could avoid the hassle of having things work with the dev server, but not with apache. Not so. Today I've discovered that the admin works under the dev server, but not with my apache setup. I replicated this using a brand new helloWorld project. I've searched the archives, the docs, the book, also ordinary web search. Found some people had similar problems and fixed it with apache Alias directives pointing ADMIN_MEDIA_PREFIX to DJANGO_SRC/contrib/admin/media but this didn't work for me. I get a 500 internal server error, regardless of DEBUG. Appreciate any help with this. -- Matt Smith http://mattsmith.org.nz -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: one field of modelForm doesn't being displayed
You could override your ModelForm's save() method to save some data to that field. And then modify the same ModelForm to exclude that field. For example, class MyForm(ModelForm): class Meta: exclude = ('excluded_field',) That way it won't expect any data for the field when processing the form and in your save() method you can just choose whatever you like to save there. If you still need some more help, feel free to throw up some example code and I'm sure someone will be able to help more. Good luck! On Wed, Jul 18, 2012 at 9:33 AM, Javier Guerra Giraldez wrote: > On Wed, Jul 18, 2012 at 5:48 AM, mapapage wrote: > > Of course, i don't wanna change the thing that it is not nullable. > > then what do you want to insert there? > > you can either define a default value, add a hidden field to the form, > or in the view add some value to the user input before feeding to the > form object > > -- > Javier > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
CachedStaticFilesStorage unavailable in debug mode
Hi, so as explained in the docs CachedStaticFilesStorage will not be applied if DEBUG setting is set to False. I just wanted to understand why this is the case. I have a development environment and want to use CachedStaticFilesStorage. thanks. cheers, Marwan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: one field of modelForm doesn't being displayed
> You could override your ModelForm's save() method to save some data to that > field. And then modify the same ModelForm to exclude that field. For example, or maybe, just maybe, he might show us his model, form, and rendered html so we can actually help him identify and possibly fix his problem! ;) I mean, perhaps he wants to be able to fill that field as well? But unless we know the type and the output, we won't be able to help you -- "The whole of Japan is pure invention. There is no such country, there are no such people" --Oscar Wilde |_|0|_| |_|_|0| |0|0|0| (\__/) (='.'=)This is Bunny. Copy and paste bunny (")_(") to help him gain world domination. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
RE: one field of modelForm doesn't being displayed
Show us the model and form code -Mensaje original- De: mapapage Enviados: 18/07/2012 07:48:59 Asunto: one field of modelForm doesn't being displayed I confront a strange situation since one field of my modelForm doesn't being displayed (only its label is) so I can't put a value there when the form is rendered and I get the error: ORA-01400: cannot insert NULL into ("VPMS_BETA"."WEBREQUESTS"."DIRECTIONDB"). Of course, i don't wanna change the thing that it is not nullable. What should I do? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/f89DfOAf0ewJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Unit test an app using ContentType?
Hello, I've written a generic app that uses the ContentType framework. It's not designed to be used on its own, rather it plugs into an existing project, and then my other apps call a registration function. It's working well for me, but I'd like to write standalone unit tests and I'm not sure how. The problem is that there's only one model in this app, and it's the one that uses ContentType, so there are no other models with which to test it unless I involve an extra app. How does one write unit tests for a model that uses ContentType? Is there a way to put test-only models into tests.py? Thanks, Aron -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Unit test an app using ContentType?
Here's a clue from Carl Meyer in an old Stackoverflow post: http://stackoverflow.com/questions/502916/django-how-to-create-a-model-dynamically-just-for-testing The idea here is to put additional models in myapp/tests/models.py and then include myapp.tests in INSTALLED_APPS when testing. This might do the trick for me. Aron Aron Griffis wrote: [Wed Jul 18 2012, 03:52:43PM EDT] > Hello, > > I've written a generic app that uses the ContentType framework. > It's not designed to be used on its own, rather it plugs into an > existing project, and then my other apps call a registration > function. It's working well for me, but I'd like to write > standalone unit tests and I'm not sure how. > > The problem is that there's only one model in this app, and it's > the one that uses ContentType, so there are no other models with > which to test it unless I involve an extra app. How does one > write unit tests for a model that uses ContentType? Is there > a way to put test-only models into tests.py? > > Thanks, > Aron -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: many "Broken INTERNAL link" with end string "/undefined/"
Hi all, I have same problem on my PHP web tvprofil.net. I have read all posts and turned all debugging, logged JavaScript user errors and all headers and env vars. Currently concluded this: - all errors are on Windows (all versions), mostly Chrome browser - Accepts mostly */*, but there is few image/png. Empty would give all image/png errors. - request happens few seconds after first request (probably document onload event) - all requests have referrer from my site - undefined is JavaScript error - no related JavaScript errors captured with logging with window.onerror = ... - no idea what it is :) maybe some broken extension/addon/malware? On Tuesday, 10 July 2012 09:21:06 UTC+2, ferran wrote: > > Hello Melvyn, > > I'm found this information > http://stackoverflow.com/questions/11017609/undefined-randomly-appended-in-1-of-requested-urls-on-my-website-since-12-jun > > I'm have too: > > Referrer: http://www.marquezshop.com/es/catalogo/ofertas/ > Requested URL: /es/catalogo/ofertas/cache/a8790cb719ffd4424219786bc76da1a4/ > User agent: Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/536.11 (KHTML, > like Gecko) Chrome/20.0.1132.47 Safari/536.11 > IP address: x > > > What is cache/hash? > > > Thanks in advanced > > > > > > On Wednesday, July 4, 2012 2:47:20 PM UTC+2, Melvyn Sopacua wrote: >> >> On 4-7-2012 9:55, ferran wrote: >> > Hello, >> > >> > I'm update javascript libraries: >> > - Jquery from >> > http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js to >> http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js >> > - Jquery ui from >> > http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.jsto >> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js >> > >> > But not is a solutions, the problem persist... >> >> Upgrades aren't solutions. They only dress up as them in their spare >> time. >> >> You should: >> 1) Identify where you generate links via javascript >> 2) Identify what javascript variable is passed to the link >> 3) Identify how it can be undefined >> >> If you don't see how it can be, undefined, use the appropriate >> javascript forums / documentation. >> >> -- >> Melvyn Sopacua >> >> >> -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/fIL-FAwridYJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Can't use admin with apache
On 19/07/12 06:27, Demian Brecht wrote: What does your Apache log look like? What, exactly, is the 500? mod_wsgi (pid=18094): Exception occurred processing WSGI script '/usr/local/django/dogscience/apache/django.wsgi'. Traceback (most recent call last): ... File "/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py", line 200, in execute return Database.Cursor.execute(self, query, params) DatabaseError: attempt to write a readonly database mds@waitaki:/usr/local/django/dogscience$ ls -l sqlite3 -rw-r--r-- 1 mds staff 47104 Jul 18 17:41 sqlite3 Change: mds@waitaki:/usr/local/django/dogscience$ ls -l sqlite3 -rw-rw-rw- 1 www-data www-data 47104 Jul 18 17:41 sqlite3 - Now instead of DatabaseError: attempt to write a readonly database I get DatabaseError: unable to open database file Maybe I'll try a different db what do you think? A common issue when deploying is if your fcgi or wsgi script doesn't have the correct permissions set, which would cause an error that can't be caught by Django. mds@waitaki:/usr/local/django/dogscience$ ls -l apache/django.wsgi -rw-r--r-- 1 mds staff 1630 Jul 18 17:38 apache/django.wsgi How about this: Is anyone out there deploying on debian squeeze with the following packages: apache2 libapache2-mod-wsgi python-django If so, does the admin work for you? If it does, what db are you using? -- Matt Smith http://mattsmith.org.nz -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
RE: Can't use admin with apache
You're running ls -l under your user account. The apache process needs r+w permissions to the database file. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Matt Smith Sent: Wednesday, July 18, 2012 3:59 PM To: django-users@googlegroups.com Subject: Re: Can't use admin with apache On 19/07/12 06:27, Demian Brecht wrote: > What does your Apache log look like? What, exactly, is the 500? mod_wsgi (pid=18094): Exception occurred processing WSGI script '/usr/local/django/dogscience/apache/django.wsgi'. Traceback (most recent call last): ... File "/usr/lib/pymodules/python2.6/django/db/backends/sqlite3/base.py", line 200, in execute return Database.Cursor.execute(self, query, params) DatabaseError: attempt to write a readonly database mds@waitaki:/usr/local/django/dogscience$ ls -l sqlite3 -rw-r--r-- 1 mds staff 47104 Jul 18 17:41 sqlite3 Change: mds@waitaki:/usr/local/django/dogscience$ ls -l sqlite3 -rw-rw-rw- 1 www-data www-data 47104 Jul 18 17:41 sqlite3 - Now instead of DatabaseError: attempt to write a readonly database I get DatabaseError: unable to open database file Maybe I'll try a different db what do you think? > A common issue when deploying is if your fcgi or wsgi script doesn't > have the correct permissions set, which would cause an error that > can't be caught by Django. mds@waitaki:/usr/local/django/dogscience$ ls -l apache/django.wsgi -rw-r--r-- 1 mds staff 1630 Jul 18 17:38 apache/django.wsgi How about this: Is anyone out there deploying on debian squeeze with the following packages: apache2 libapache2-mod-wsgi python-django If so, does the admin work for you? If it does, what db are you using? -- Matt Smith http://mattsmith.org.nz -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Difficulties using generic views (Tutorial 4, Django 1.4)
I'm new to django and python, and decided to follow up the available tutorials to get up to speed. These were helpful and got me on my feet but while finishing up the tutorial i hit a major snag. While everything was working properly using custom views, i can't seem to make my app load the correct templates after switching to generic views. Here's the code: #urls.py from django.conf.urls import patterns, include, url from django.views.generic import DetailView, ListView from polls.models import Poll urlpatterns = patterns('', url(r'^$', ListView.as_view( queryset=Poll.objects.order_by('-pub_date')[:5], context_object_name='latest_poll_list', template_name='polls/index.html')), url(r'^(?P\d+)/$', DetailView.as_view( model=Poll, template_name='polls/detail.html')), url(r'^(?P\d+)/results/$', DetailView.as_view( model=Poll, template_name='polls/results.html'), name='poll_results'), url(r'^(?P\d+)/vote/$', 'polls.views.vote'), ) The way i decided (perhaps wrongly) to organize my apps and templates is as follows: Template dir as defined in settings.py: TEMPLATE_DIRS = ('/home/my_user/Webdev/Templates/', # this is where i'm storing my templates at the moment App location: /home/my_user/Webdev/Django-lessons/pollproject/polls If i try to access the polls app directly by using the URL: http://127.0.0.1:8000/polls/ i now get an error message stating that: TemplateDoesNotExist at /polls/ index.html, polls/poll_list.html I realize this might have something to do with where i decided to store my templates (made more sense at the time to store them separately since i thought i could use different templates for the same app, for different purposes). This is probably a basic issue but any help regarding this would be greatly appreciated. Thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/gWDhmGFeSlEJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
activate site django
hi programers! i want to make my project work in web, but i only know how deploy django-mod_python-apache, also the question! i'm keep all install corretc and work correct too, whall i will keep this project in web? process using ftp! 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Can't use admin with apache
On 19/07/12 11:06, Demian Brecht wrote: You're running ls -l under your user account. The apache process needs r+w permissions to the database file. Thx Demian my issue is now resolved (and I feel like a dumbass but who cares!) -- Matt Smith http://mattsmith.org.nz -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
RE: Can't use admin with apache
No worries, happens to the best of us. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Matt Smith Sent: Wednesday, July 18, 2012 4:54 PM To: django-users@googlegroups.com Subject: Re: Can't use admin with apache On 19/07/12 11:06, Demian Brecht wrote: > You're running ls -l under your user account. The apache process needs > r+w permissions to the database file. Thx Demian my issue is now resolved (and I feel like a dumbass but who cares!) -- Matt Smith http://mattsmith.org.nz -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Any free cloud database hosting ?
Openshift? On Monday, July 16, 2012 8:27:23 PM UTC-7, surya wrote: > > I am building a facebook application where I have to use database models > (very small size ~ 1MB - 2MB). Is there any good cloud db storage website > for hosting the database?? > > I looked around Amazon Web Services, it has really great offers but "I > don't have credit card" :( > > I thought of using Google Cloud but I need to use "django-no rel". As > there are some external lib involved in my project which create tables, I > don't think I can tweak them successfully! > > So, how exactly I should host the database?? > > -- Actually, I am using fandjango, facepy libs which need a database > models.. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/C6icsQ-om8UJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Template Loader Error: (It's been really frustrating till now..!)
I am having similar problems. did you manage to get this fixed? On Wednesday, January 25, 2012 6:51:34 AM UTC-8, leaks wrote: > > Hey all... i get this error while i have a template directory and my > about.html file It doesn't display the home.html either... > > Environment: > > > Request Method: GET > Request URL: http://127.0.0.1:8000/about/ > > Django Version: 1.3.1 > Python Version: 2.7.2 > Installed Applications: > ['django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.messages', > 'django.contrib.staticfiles'] > Installed Middleware: > ('django.middleware.common.CommonMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.middleware.csrf.CsrfViewMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware', > 'django.contrib.messages.middleware.MessageMiddleware') > > Template Loader Error: > Django tried loading these templates, in this order: > Using loader django.template.loaders.filesystem.Loader: > /home/tony/Documents/blog/blog/templates/about.html (File does not > exist) > Using loader django.template.loaders.app_directories.Loader: > > > > Traceback: > File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/ > base.py" in get_response > 111. response = callback(request, > *callback_args, **callback_kwargs) > File "/home/tony/Documents/blog/../blog/views.py" in about > 9. return render_to_response('about.html',) > File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/ > __init__.py" in render_to_response > 20. return HttpResponse(loader.render_to_string(*args, > **kwargs), **httpresponse_kwargs) > File "/usr/local/lib/python2.7/dist-packages/django/template/ > loader.py" in render_to_string > 181. t = get_template(template_name) > File "/usr/local/lib/python2.7/dist-packages/django/template/ > loader.py" in get_template > 157. template, origin = find_template(template_name) > File "/usr/local/lib/python2.7/dist-packages/django/template/ > loader.py" in find_template > 138. raise TemplateDoesNotExist(name) > > Exception Type: TemplateDoesNotExist at /about/ > Exception Value: about.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/b7u_nPwieJMJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Template Loader Error: (It's been really frustrating till now..!)
On 19 July 2012 04:46, Mark Anderko wrote: > I am having similar problems. did you manage to get this fixed? > > > On Wednesday, January 25, 2012 6:51:34 AM UTC-8, leaks wrote: >> >> Hey all... i get this error while i have a template directory and my >> about.html file It doesn't display the home.html either... >> >> Environment: >> >> >> Request Method: GET >> Request URL: http://127.0.0.1:8000/about/ >> >> Django Version: 1.3.1 >> Python Version: 2.7.2 >> Installed Applications: >> ['django.contrib.auth', >> 'django.contrib.contenttypes'**, >> 'django.contrib.sessions', >> 'django.contrib.sites', >> 'django.contrib.messages', >> 'django.contrib.staticfiles'] >> Installed Middleware: >> ('django.middleware.common.**CommonMiddleware', >> 'django.contrib.sessions.**middleware.SessionMiddleware', >> 'django.middleware.csrf.**CsrfViewMiddleware', >> 'django.contrib.auth.**middleware.**AuthenticationMiddleware', >> 'django.contrib.messages.**middleware.MessageMiddleware') >> >> Template Loader Error: >> Django tried loading these templates, in this order: >> Using loader django.template.loaders.**filesystem.Loader: >> /home/tony/Documents/blog/**blog/templates/about.html (File does not >> exist) >> > make sure that /home/tony/Documents/blog/blog/templates/about.html exist. Else, add templates directory to the TEMPLATE_DIRS. Using loader django.template.loaders.app_**directories.Loader: >> >> >> >> Traceback: >> File "/usr/local/lib/python2.7/**dist-packages/django/core/**handlers/ >> base.py" in get_response >> 111. response = callback(request, >> *callback_args, **callback_kwargs) >> File "/home/tony/Documents/blog/../**blog/views.py" in about >> 9. return render_to_response('about.**html',) >> File "/usr/local/lib/python2.7/**dist-packages/django/**shortcuts/ >> __init__.py" in render_to_response >> 20. return HttpResponse(loader.render_to_**string(*args, >> **kwargs), **httpresponse_kwargs) >> File "/usr/local/lib/python2.7/**dist-packages/django/template/ >> loader.py" in render_to_string >> 181. t = get_template(template_name) >> File "/usr/local/lib/python2.7/**dist-packages/django/template/ >> loader.py" in get_template >> 157. template, origin = find_template(template_name) >> File "/usr/local/lib/python2.7/**dist-packages/django/template/ >> loader.py" in find_template >> 138. raise TemplateDoesNotExist(name) >> >> Exception Type: TemplateDoesNotExist at /about/ >> Exception Value: about.html > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/b7u_nPwieJMJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Template Loader Error: (It's been really frustrating till now..!)
You can also have a "templates" directory in any app of yours and Django will pick them up from there. It's also best practice to start your template path with your app name. For instance: myapp/templates/myapp/my template.html Or; mytemplatedir/myapp/mytemplate.html Indeed django does not elect to use templates from a given app over another, so if two apps have a template with the same name, you're in trouble. Only the templates from your Template dirs have higher priority. This also makes overriding templates easier should you decide to redistribute your app, as one can have a myapp directory in their template dir to override your templates, as templates from this folder will have higher priority than those from the App dir. Le 19 juil. 2012 07:18, "Anoop Thomas Mathew" a écrit : > > On 19 July 2012 04:46, Mark Anderko wrote: > >> I am having similar problems. did you manage to get this fixed? >> >> >> On Wednesday, January 25, 2012 6:51:34 AM UTC-8, leaks wrote: >>> >>> Hey all... i get this error while i have a template directory and my >>> about.html file It doesn't display the home.html either... >>> >>> Environment: >>> >>> >>> Request Method: GET >>> Request URL: http://127.0.0.1:8000/about/ >>> >>> Django Version: 1.3.1 >>> Python Version: 2.7.2 >>> Installed Applications: >>> ['django.contrib.auth', >>> 'django.contrib.contenttypes'**, >>> 'django.contrib.sessions', >>> 'django.contrib.sites', >>> 'django.contrib.messages', >>> 'django.contrib.staticfiles'] >>> Installed Middleware: >>> ('django.middleware.common.**CommonMiddleware', >>> 'django.contrib.sessions.**middleware.SessionMiddleware', >>> 'django.middleware.csrf.**CsrfViewMiddleware', >>> 'django.contrib.auth.**middleware.**AuthenticationMiddleware', >>> 'django.contrib.messages.**middleware.MessageMiddleware') >>> >>> Template Loader Error: >>> Django tried loading these templates, in this order: >>> Using loader django.template.loaders.**filesystem.Loader: >>> /home/tony/Documents/blog/**blog/templates/about.html (File does not >>> exist) >>> >> > > make sure that /home/tony/Documents/blog/blog/templates/about.html exist. > Else, add templates directory to the TEMPLATE_DIRS. > > > Using loader django.template.loaders.app_**directories.Loader: >>> >>> >>> >>> Traceback: >>> File "/usr/local/lib/python2.7/**dist-packages/django/core/**handlers/ >>> base.py" in get_response >>> 111. response = callback(request, >>> *callback_args, **callback_kwargs) >>> File "/home/tony/Documents/blog/../**blog/views.py" in about >>> 9. return render_to_response('about.**html',) >>> File "/usr/local/lib/python2.7/**dist-packages/django/**shortcuts/ >>> __init__.py" in render_to_response >>> 20. return HttpResponse(loader.render_to_**string(*args, >>> **kwargs), **httpresponse_kwargs) >>> File "/usr/local/lib/python2.7/**dist-packages/django/template/ >>> loader.py" in render_to_string >>> 181. t = get_template(template_name) >>> File "/usr/local/lib/python2.7/**dist-packages/django/template/ >>> loader.py" in get_template >>> 157. template, origin = find_template(template_name) >>> File "/usr/local/lib/python2.7/**dist-packages/django/template/ >>> loader.py" in find_template >>> 138. raise TemplateDoesNotExist(name) >>> >>> Exception Type: TemplateDoesNotExist at /about/ >>> Exception Value: about.html >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/django-users/-/b7u_nPwieJMJ. >> >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Difficulties using generic views (Tutorial 4, Django 1.4)
Please provide path to your templates 2012/7/19 Ricardo Cardoso : > I'm new to django and python, and decided to follow up the available > tutorials to get up to speed. These were helpful and got me on my feet but > while finishing up the tutorial i hit a major snag. While everything was > working properly using custom views, i can't seem to make my app load the > correct templates after switching to generic views. > > Here's the code: > > #urls.py > from django.conf.urls import patterns, include, url > from django.views.generic import DetailView, ListView > from polls.models import Poll > > urlpatterns = patterns('', > url(r'^$', > ListView.as_view( > queryset=Poll.objects.order_by('-pub_date')[:5], > context_object_name='latest_poll_list', > template_name='polls/index.html')), > url(r'^(?P\d+)/$', > DetailView.as_view( > model=Poll, > template_name='polls/detail.html')), > url(r'^(?P\d+)/results/$', > DetailView.as_view( > model=Poll, > template_name='polls/results.html'), > name='poll_results'), > url(r'^(?P\d+)/vote/$', 'polls.views.vote'), > ) > > The way i decided (perhaps wrongly) to organize my apps and templates is as > follows: > > Template dir as defined in settings.py: > TEMPLATE_DIRS = ('/home/my_user/Webdev/Templates/', # this is where i'm > storing my templates at the moment > > App location: /home/my_user/Webdev/Django-lessons/pollproject/polls > > If i try to access the polls app directly by using the URL: > http://127.0.0.1:8000/polls/ i now get an error message stating that: > > TemplateDoesNotExist at /polls/ > > index.html, polls/poll_list.html > > > > I realize this might have something to do with where i decided to store my > templates (made more sense at the time to store them separately since i > thought i could use different templates for the same app, for different > purposes). > > This is probably a basic issue but any help regarding this would be greatly > appreciated. > > Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/gWDhmGFeSlEJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: INSTALLED Grappelli App and getting some error
Never use grappeli so take this advice for what it's worth, but did you check the version compatibility of your grappeli install and your django install? Le 18 juil. 2012 20:12, "chhots" a écrit : > TemplateSyntaxError at /admin/ > > 'url' is not a valid tag library: Template library url not found, tried > django.templatetags.url,element.grappelli.templatetags.url,django.contrib.admin.templatetags.url > > > plz help > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/bB26jUPm6h4J. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.