Re: Tutorial Error - TemplateDoesNotExist at /polls/
I fully understood that and I thought it was implied in that I said I was working with the tutorial I would have that file created. You only asked where my template dir was directed to and that I put urls.py in my reply, I would have put this in there if you had requested. Here it is. Now, as far as I understand you only have to put the path in the loader form the end of the template_dirs variable. Do I have to put the abs path or do I have another issue. GNU nano 2.2.4 File: views.py # Create your views here. from django.template import Context, loader from polls.models import Poll from django.http import HttpResponse def index(request): latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] t = loader.get_template('polls/index.html') c = Context({ 'latest_poll_list': latest_poll_list, }) return HttpResponse(t.render(c)) def detail(request, poll_id): return HttpResponse("You are viewing Poll %s." % poll_id) def results(request, poll_id): return HttpResponse("You are looking the results of Poll %s." % poll_id) [ Read 23 lines ] On Oct 21, 4:09 pm, Robbingtonwrote: > You see, what I tried to explain in the last message, my friend was > that index in 'polls.views.index') doesnt point the url polls/ to the > index.html but to the function you are suppose to create in the > views.py file in your app directory. > > Your view.py file (inside your poll app folder)should look like > > from django.http import HttpResponse > > def index(request): > return HttpResponse("Hello world blah blah blah") > > I can see that its a bit confusing. > > Rob -- 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: Tutorial Error - TemplateDoesNotExist at /polls/
The index.html file is in the right location, what worries me is that the template loaders are showing that they are loading nothing. In all the other qustion in the google groups here that referenced an isssue with templates not loading, their traceback had something like unable to find documnet at c:\blah\blah\tmplates. Mine is empty. All the files have the same owner, but nothing is loading. My template_dir is pointed to /home/me/Templates and I have tried it with with index.html being in there and in a dir called polls/, same thing no matter what Urls.py GNU nano 2.2.4 File: urls.py from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^tutorial/', include('tutorial.foo.urls')), (r'^polls/$', 'polls.views.index'), (r'^polls/(?P\d+)/$', 'polls.views.detail'), (r'^polls/(?P\d+)/results/$', 'polls.views.results'), (r'^polls/(?P\d+)/vote/$', 'polls.views.vote'), # Uncomment the admin/doc line below to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)), ) On Oct 21, 2:43 pm, Robbingtonwrote: > Where is your template_dirs in settings.py pointed too? > If you can post your urls.py. > > Looking at the tutorial again, > > (r'^polls/$', 'polls.views.index'), means that the url 'polls' will > serve the index function in the views.py file inside your polls app. > Your index.html should lie inside the top level of your templates > directory and will serve what ever you set as your top level domain > name, orhttp://192.168.1.131:/of course you have to set that up > in your urls.py > > I use urlpatterns = patterns('django.views.generic.simple', > (r'^$', 'direct_to_template',{'template': 'index.html'}), > > and then you would have > > (r'polls/$ , ('polls.view.index') -- 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.
Tutorial Error - TemplateDoesNotExist at /polls/
I searched the posts for this, but I couldn't find my issue. I am getting TemplateDoesNotExist at /polls/ when after adding the index.html, but the template loaders show no directory being loaded. My traceback is here http://dpaste.com/261308/. Thanks for the input. -- 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: Error when following the tutorial
sorry, that should've read home/kevin/crossen On Apr 7, 4:57 pm, TheNational22 <kevin.cullin...@gmail.com> wrote: > Yes /home/crossen/crossen has the init and so does polls > > On Apr 7, 4:55 pm, Shawn Milochik <sh...@milochik.com> wrote: > > > > > On Apr 7, 2010, at 4:53 PM, TheNational22 wrote: > > > > I have added /home/crossen/crossen to the python path, and I am still > > > getting the errors > > > Okay, but do the directories you've added to the path contain __init__.py > > files? (zero-byte is fine, they just have to be there) -- 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: Error when following the tutorial
Yes /home/crossen/crossen has the init and so does polls On Apr 7, 4:55 pm, Shawn Milochik <sh...@milochik.com> wrote: > On Apr 7, 2010, at 4:53 PM, TheNational22 wrote: > > > I have added /home/crossen/crossen to the python path, and I am still > > getting the errors > > Okay, but do the directories you've added to the path contain __init__.py > files? (zero-byte is fine, they just have to be there) -- 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: Error when following the tutorial
I have added /home/crossen/crossen to the python path, and I am still getting the errors On Apr 7, 4:26 pm, Shawn Milochikwrote: > Off of the top of my head that looks correct. Perhaps there's a problem with > your PYTHONPATH. > > Try to echo $PYTHONPATH and see what you get. See if anything in your home > directory is in there, > and whether the fact that you have a subdirectory with a name identical to > it's parent directory could be part of the problem. > > I'm assuming you're on Linux based on the path you specified. > > Is there an __init__.py in your polls directory? > > Also, as for the IRC chat, it's on freenode.net, so I recommend heading over > there and registering your nickname. > > Shawn -- 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: Error when following the tutorial
On Apr 7, 4:09 pm, Shawn Milochikwrote: > Your poll app is not in INSTALLED_APPS properly. > > What does INSTALLED_APPS look like in your settings.py? > > What does your directory structure look like, starting with the directory in > which you ran startproject? > > Shawn I have the site installed in /home/kevin/crossen/crossen, and the dir listing is __init__.py __init__.pyc manage.py polls(dir) settings.py settings.pyc testdb(sqlite3 database) test.db(0bytes) urls.py urls.pyc and the end of my settings.py file looks like this: INSTALLED_APPS=( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'crossen.polls' ) The crossen.polls following the mystie.polls convention found in the guide. I have tried it with just polls, same error -- 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.
Error when following the tutorial
I am following the django tutorial here. I have followed it step by step. I am using sqlite3 as to not have to set up a DB. When I get to python manage.py sql polls, it returns "Error: App with labsl polls could not be found. Are you sure your installed apps setting is correct?" I have a polls dir in my site dir, ans I added the line crossen.polls(crossen being the site dir name). I have also have tried it with just polls. Nothing doing. I have googled for the answer, but no luck. Also, the irc chat is rejecting me based on a lack of a password, but I cannot find a reference to a password anywhere o the community sites. I can post screens of my dirs, but, as I said I followed the tutorial exactly. 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-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.