Hello, 

In the settings.py please give the full path to your appsclass as mentioned in 
app.py. That should be the standard. 
Please share the HTML code here, then it should be clear for further suggestion.
Regards,Amitesh Sahay


primary :: 91-907 529 6235
 

    On Thursday 16 November 2017, 6:47:43 AM IST, drone4four 
<drone4f...@gmail.com> wrote:  
 
 I am having fun trying to initiate a django project with some apps. I am 
taking an awesome course on udemy called, The Ultimate Beginner's Guide to 
Django. I was able to follow along and I have a basic blog up and running. Now 
I am back tracking a little by starting over, this time using a supplementary 
Django cheat sheet. I encountered a number of issues and resolved them but now 
I find myself stuck. 

When I try navigating to my new homepage, Django provides me with this debug 
traceback. Django is telling me here that the templates directory doesn’t 
exist, when it clearly does. Here is a screenshot of Atom so you can see my 
project’s file tree. As you can see my directory tree for my project, there is 
an folder which is called, blogitems. and within the blogitems folder is a 
sub-folder called, templates, then blogitems again and finally my file, 
home.html
It’s rather confusing. I don’t like the redundancy and the recursive nature of 
all the app files and directory names. Maybe this is my problem. Can any of 
your make sense of my debug output to explain why I am getting the error? Can 
anyone please provide some clarity here?
Here is the cheat sheet:
Creating a Django App

1. Open terminal and navigate to django project folder (where manage.py exists)
2. django-admin startapp [app name] # use pluralised names, e.g. posts
3. Navigate to new app folder.
4. Create new subfolder called “templates”
5. Navigate to new templates folder.
6. Create new subfolder called same name as your app (e.g. posts)
7. Go back to project folder
9. Open project urls.py and add “from [appname] import views”. Then add url 
path for new view.
     e.g. url(r’^$’, views.home, name=‘home’)
10.Open views.py and add:
def home(request):
    return render(request, ‘posts/home.html’)

11. Navigate to projectfolder\appfolder\templates\appfolder
12.  Create new file ‘home.html’
13.  Go to project folder and open settings.py. Scroll down to INSTALLED_APPs 
and add ‘appname’, to the end of the list of apps.

It's this last step where I encounter the error. 
Here are the contents of urls.py:from django.conf.urls import url
from django.contrib import admin
from blogitems import views

urlpatterns = [
    #initialization admin interface:
    url(r'^admin/', admin.site.urls),
    url(r’^$’, views.home, name=‘home’),
]



I added the app into the settings.py:
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'blogitems',
]
Is there any other information I could provide?
Thanks for your attention.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/770a99c0-3824-4e73-914e-f380fd5f48f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/305066308.976010.1510803284773%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to