Unable to see Django Error Pages
Hi Friends, I have been using Django for quite sometime now. It has been working well for me all this while. For the past couple of days am not able to see the Fancy Error Pages of Django. Whenever an error occurs all I see is the name of the error - 'OperationalError', 'SyntaxError' etc on the title bar and an empty page. I have kept the DEBUG mode ON. Am unable to find out the reason for the missing error pages. Would be glad if you guys could help me out. -- Alagappan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: merge 2 views?
Thanks for the solution =) but on everypage the navigation will be called so there wont be unneccecary code, Thanks for the tip though will surely look at it for some other project On 1 jan, 08:01, Sam Lai wrote: > The one downside to this solution is that these variables will fetched > for every request, even if navigation.html was not included in the > output template. > > An alternative solution would be to create a template tag that fetches > these variables, and only load and use this template tag in > navigation.html. That way those variables are only fetched if > navigation.html is included. > > It's a little bit more complicated in code though (made a lot easier > in Django 1.3 with simple_tag), and might not be worthwhile if you > aren't doing complicated computations. > > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ > > On 30 December 2010 05:32, Thom van Ledden wrote: > > > > > > > > > Thanks a lot for pointin me in the right direction! > > > made a context_processor.py for my navigation, and added it to my > > settings.py > > > from basic.blog.models import Category > > from common.models import fillNavigationFinishedProjects > > from common.models import fillNavigationUnfinishedProjects > > > def navigation(request): > > """ > > Adds navigation variables to the context. > > > """ > > return { > > 'finishedProjects':fillNavigationFinishedProjects(), > > 'unfinishedProjects':fillNavigationUnfinishedProjects(), > > 'blogCategories':Category.objects.all(), > > } > > > Seems to work perfectly! > > thanks much! > > > On 29 dec, 18:51, Michael wrote: > >> Look into context processors, that sounds like what you need. > > >>http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-c... > >> -- > >> Michael > > >> On Wed, 2010-12-29 at 08:51 -0800, Thom van Ledden wrote: > >> > Hi django developers, > > >> > Ive got a seperate navigation.html file which need to be rendered on > >> > each page, but the page need some vars for that. how can i get those > >> > vars to be defined just only once? > > >> > my idea: the main_page should add the vars for the navigation, and the > >> > views of the content pages will have their own vars, and those need to > >> > be merged some how > >> > some files i uploaded:http://thomvl.pastebin.com/gGjGj4NP > >> >http://thomvl.pastebin.com/uYUp5iCjhttp://thomvl.pastebin.com/Yv6fPTP7 > > >> > could anyone point me where i go wrong? (the main_page 's vars are the > >> > ones i need, aside of title ofcourse) > > >> > Thanks 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-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://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-us...@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: merge 2 views?
On 1 jan, 08:01, Sam Lai wrote: (snip) > An alternative solution would be to create a template tag (snip) > It's a little bit more complicated in code though (made a lot easier > in Django 1.3 with simple_tag) "simple_tag" is nothing new - it has been here since the 0.96 days IIRC. And FWIW, writing a "full" custom tag is far from difficult (even if sometimes a bit boring), and it's really something all django coders should learn. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Help getting started.....I think it is installed correctly
Quote from "Writing your first Django app, part 1": >From the command line, cd into a directory where you’d like to store your code, then run the command django-admin.py startproject mysite. This will create a mysite directory in your current directory. Put your code in some directory outside of the document root, such as / home/mycode. OK, please explain where /hom/mycode should be located. Is it directly on the C:, or like I have a www folder for playing with html, or within the Python directory somewhere? Sorry, but I'm looking at this again for the first time in over a year, and need a bump start. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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 BOOTCAMP
I've found many books that demonstrate how Django can be used. Django 1.0 Web Site Development Practical Django Projects, Second Edition and The Definitive Guide to Django: Web Development Done Right, Second Edition are all pretty nice. I'd recommend checking these out. On Dec 31 2010, 6:17 am, delegb...@dudupay.com wrote: > Hi all, > > I recently started working on a project which is based on django. I've had > reasons to work through the documentation several times to get things done. > However, each time I check the documentation, I find out there is more to > learn hence, my thought. > > Is there any or can there be a django clinic for beginners or a bootcamp for > beginners where people can go through the process of learning django. > > With the little I have seen of the so many that is possible, can there not be > such arrangement for beginners like me to tap into. Reading the documentation > alone may not help as having a guide. > > Regards. > Sent from my BlackBerry wireless device from MTN -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: merge 2 views?
On 2 January 2011 00:56, bruno desthuilliers wrote: > "simple_tag" is nothing new - it has been here since the 0.96 days > IIRC. But only the version in v1.3 has the ability to manipulate the context object (which is what's needed in the suggested alternative solution), thanks to the new takes_context parameter. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Ajax and SSL
Hi, I'm using Satchmo to build a store for a Django-powered webpage. Satchmo provides a convenient middleware ('satchmo_store.shop.SSLMiddleware.SSLRedirect') which allows me to add { 'SSL' : True } arguments to my view specifications (in urls.py). This forwards requests to using the HTTPS protocol when so specified. There are other middlewares that do roughly the same thing, so this is not necessarily Satchmo-specific. I have some views configured to be forwarded to using SSL (HTTPS protocol). However, I also have some general Ajax views configured. E.g. I have one that updates a progress bar on every page once that page has loaded. The problem is the following: consider me having the following (abstract) specification in urls.py: VIEW1[SSL=True] AJAX1[SSL=False] where a client-side call to AJAX1 is performed once the page has fully loaded as generated by VIEW1. The page generated by VIEW1 should call AJAX1 using the HTTPS protocol, but the convenient middleware will forward it to HTTP, as specified above, which will cause problems (i.e. it will not work). If I set AJAX1[SSL=True] I will get problems when I access views using the HTTP protocol. Is there a way to make use of the above-mentioned convenient declarative middleware (just adding { 'SSL' : True } in view- specifications), but get around these kinds of problems? What are some common design patterns for these kinds of problems? Thanks, Jakob -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Help getting started.....I think it is installed correctly
You can put your code anywhere you like although you shouldn't put it anywhere public. Just pick a private folder somewhere and let django-admin.py set up the folder. On 1 January 2011 16:14, Anthony Pearce wrote: > Quote from "Writing your first Django app, part 1": > > From the command line, cd into a directory where you’d like to store > your code, then run the command django-admin.py startproject mysite. > This will create a mysite directory in your current directory. > > Put your code in some directory outside of the document root, such as / > home/mycode. > > > OK, please explain where /hom/mycode should be located. Is it > directly on the C:, or like I have a www folder for playing with html, > or within the Python directory somewhere? Sorry, but I'm looking at > this again for the first time in over a year, and need a bump start. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@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-us...@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.
constructor for model, automatically generate field, __init__
class Word: fWord=models.CharField(blank=True, default='') fsmth=models.CharField(blank=True, default='') def __init__(self, fWord): self.fWord=fWord self.fsmth=fWord+fWord I need to add entrance to fsmth automatically. The code above gives mistakes in sites.py about Type error "classobj is not iterable". -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: constructor for model, automatically generate field, __init__
On Sat, Jan 1, 2011 at 9:27 PM, gintare wrote: > > class Word: >fWord=models.CharField(blank=True, default='') >fsmth=models.CharField(blank=True, default='') >def __init__(self, fWord): >self.fWord=fWord >self.fsmth=fWord+fWord > > I need to add entrance to fsmth automatically. > The code above gives mistakes in sites.py about Type error "classobj > is not iterable". > > maybe because you've forgotten to inherit from models.Model in the Word class definition or it's just a transcription mistake? -- Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Help getting started.....I think it is installed correctly
OK thank you. One last question though. What makes a folder private? Sorry but I really am a noob at this. On Jan 2, 3:31 am, Acorn wrote: > You can put your code anywhere you like although you shouldn't put it > anywhere public. > > Just pick a private folder somewhere and let django-admin.py set up the > folder. > > On 1 January 2011 16:14, Anthony Pearce wrote: > > > > > Quote from "Writing your first Django app, part 1": > > > From the command line, cd into a directory where you’d like to store > > your code, then run the command django-admin.py startproject mysite. > > This will create a mysite directory in your current directory. > > > Put your code in some directory outside of the document root, such as / > > home/mycode. > > > OK, please explain where /hom/mycode should be located. Is it > > directly on the C:, or like I have a www folder for playing with html, > > or within the Python directory somewhere? Sorry, but I'm looking at > > this again for the first time in over a year, and need a bump start. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Help getting started.....I think it is installed correctly
/home/mycode or /home is a linux location. Apparently, you are using windows. I would suggest creating a folder for all your django projects, say C:\DjangoProjects\ , and run django-admin.py from there. You do not want to put your django project folder in your www folder, since that may allow access to the sources themselves, instead of running them to create the html. On 1/2/2011 12:14 AM, Anthony Pearce wrote: > Quote from "Writing your first Django app, part 1": > >>From the command line, cd into a directory where you’d like to store > your code, then run the command django-admin.py startproject mysite. > This will create a mysite directory in your current directory. > > Put your code in some directory outside of the document root, such as / > home/mycode. > > > OK, please explain where /hom/mycode should be located. Is it > directly on the C:, or like I have a www folder for playing with html, > or within the Python directory somewhere? Sorry, but I'm looking at > this again for the first time in over a year, and need a bump start. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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: Help getting started.....I think it is installed correctly
Thank you, that helps. Will give it a shot. On Jan 2, 10:00 am, Blue Cuenca wrote: > /home/mycode or /home is a linux location. Apparently, you are using > windows. > > I would suggest creating a folder for all your django projects, say > C:\DjangoProjects\ , and run django-admin.py from there. > > You do not want to put your django project folder in your www folder, > since that may allow access to the sources themselves, instead of > running them to create the html. > > On 1/2/2011 12:14 AM, Anthony Pearce wrote: > > > > > Quote from "Writing your first Django app, part 1": > > >>From the command line, cd into a directory where you d like to store > > your code, then run the command django-admin.py startproject mysite. > > This will create a mysite directory in your current directory. > > > Put your code in some directory outside of the document root, such as / > > home/mycode. > > > OK, please explain where /hom/mycode should be located. Is it > > directly on the C:, or like I have a www folder for playing with html, > > or within the Python directory somewhere? Sorry, but I'm looking at > > this again for the first time in over a year, and need a bump start.- Hide > > quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Cant locate problem with trunk: 'ModelForm' object has no attribute '_meta'
Hey, could someone have a look at this, I updated to Django trunk and face some problems. I get the error message ' 'ModelForm' object has no attribute '_meta''. But the traceback doesn't have any position of my own code inside. Only Django internal function calls. So I don't really know how to locate the issue. This is all I get when I load my site: http://dpaste.com/293197/ Tried to reproduce it in the shell by importing all models, views, urls, etc. but nothing. Could someone point out where I should look at? Thank you for your time! :) Best regards Martin -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.
Customize the admin look and feel
I have made it to the "Writing your first Django app, part 2" page down to "Customize the admin look and feel", at the bottom. I'm stuck with this paragraph.. Now copy the template admin/base_site.html from within the default Django admin template directory in the source code of Django itself (django/contrib/admin/templates) into an admin subdirectory of whichever directory you're using in TEMPLATE_DIRS. For example, if your TEMPLATE_DIRS includes "/home/my_username/mytemplates", as above, then copy django/contrib/admin/templates/admin/base_site.html to /home/ my_username/mytemplates/admin/base_site.html. Don't forget that admin subdirectory. I found the "base_site" at C:/Django-1.2.4/django/contrib/admin/ templates/admin/base_site.html. I have no idea where this is supposed to be copied and pasted to. Any help please? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.