I am new to web development. Wanted to help my daughter with a simple website (she does pet portraits) and learn something that interests me. I watched some you tube tutorials, then bought a book. First couple simple projects went OK. Then I got to templates and I have not been able to get the example project to work. Been banging my head against the wall for about a week. Part of the problem is my directory structure does not look like the authors and so I am not sure I am putting things in the right place. When I go searching for another explanation of how to set it up, I find that nobody seems to do it the same way. Also, I find the jargon confusing. At this point I just want to display a simple html page. If this is in the wrong place, maybe someone can direct me to a better one.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fe83a557-759d-460d-96ec-2c7fd18117bb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANfN%3DK9POCHxkn8-OoU2Yoy3rj%3D%3D9%3DPVOZo0E07fOrPbqcV87w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM%3DzXYddr_TyXy43rhgtAAfJNJS%3D7D-EE6KngCcyYuhGQ9wXcw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BC7wFQhMzBAWQH-f3N8uxcUYyPtPY8tLLn2Df0eL114DL9%3DQA%40mail.gmail.com.
C:\Users\Phil\desktop\django\pages\pages_project\urls.py", line 21, in <module>
path(", include('pages.urls')), #newTo view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BC7wFQhMzBAWQH-f3N8uxcUYyPtPY8tLLn2Df0eL114DL9%3DQA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BC7wFQhMzBAWQH-f3N8uxcUYyPtPY8tLLn2Df0eL114DL9%3DQA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BC7wFQhMzBAWQH-f3N8uxcUYyPtPY8tLLn2Df0eL114DL9%3DQA%40mail.gmail.com.
Thank you all for your help and your interest. I am not sure how best to handle getting
Information that you all have requested. Don’t want to clutter up the thread more than
necessary, so I will send the information to all that have shown interest as .pdf attachments in emails.
To Jorge Gimeno: I checked the settings.py as you suggested to see if
'pages.apps.PagesConfig' was correctly added and it appears OK
I also checked pages/urls.py and pages_project urls.py and they also appear correct.
Alvaro Orozco suggested that I might not have the virtual environment activated. I think that was a possibility, so I did a “pipenv shell” and then “runserver” and the traceback appears to have changed a little. I will email the new traceback to all who responded.
One thing that bothers me is that the author of the book refers to the pages directory as if there is only one. In fact, django created two. The top level, (Is that referred to as the base?) has manage.py in it. One of the childs of this is another ‘page’ which is where I put urls.py. At one point I put urls.py
In both ‘page’ directories, figuring the one that the one in the wrong place would be ignored. This didn’t seem to make any difference. Is it possible that the book was written when there was only one “page” directory and the code in the book won’t work with a second “page” sub-directory?
To Shankar Jha: Yes, I did compare my code with the Github code posted by the author and it matches perfectly, with one exception. The exception is where a second template is added later in the chapter. That is beyond where I encountered the error.
To Alvaro Orozco: You are probably correct. I may not have had the virtual environment active. I have run it again and the traceback seems to have changed slightly. I will send you the new one by email.
To all: I still have the problem and welcome your suggestions.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGrwwCbPt961jBRYRFvSE%2BNVY%2Bu38Txy9Dhc9C29y5V2gYQ3qg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJeZY9eivYpJngtnv8qA4KZDC2aAnWXiQgeoLOFvpVG%2BfP7Qrg%40mail.gmail.com.
"One thing that bothers me is that the author of the book refers to the pages directory as if there is only one. In fact, django created two. The top level, (Is that referred to as the base?) has manage.py in it. One of the childs of this is another ‘page’ which is where I put urls.py. At one point I put urls.py
In both ‘page’ directories, figuring the one that the one in the wrong place would be ignored. This didn’t seem to make any difference. Is it possible that the book was written when there was only one “page” directory and the code in the book won’t work with a second “page” sub-directory?"
Outer "pages" is just the directory to store the django project and initialise the project using pipenv and all. That has nothing to do with the project itself. The "pages" inside is one of the apps of the project(This project has only one app). Django has this concept of "projects" and "apps". Project means whole web application that you are developing and apps are specific functionalities inside the web app. So, pay attention to the "pages" folder inside only, it will have "urls.py" file to display pages in specific routes, and other "urls.py" is inside "pages_project" which represents whole project. The "urls.py" file here is to let django know which apps have urls setup and where to look for them
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANfN%3DK-uR4v5o%3Dgw2jomf2PcCQv_qhM-3QfnmTmBSQ92Afe8tw%40mail.gmail.com.
I am new to web development. Wanted to help my daughter with a simple website (she does pet portraits) and learn something that interests me. I watched some you tube tutorials, then bought a book. First couple simple projects went OK. Then I got to templates and I have not been able to get the example project to work. Been banging my head against the wall for about a week. Part of the problem is my directory structure does not look like the authors and so I am not sure I am putting things in the right place. When I go searching for another explanation of how to set it up, I find that nobody seems to do it the same way. Also, I find the jargon confusing. At this point I just want to display a simple html page. If this is in the wrong place, maybe someone can direct me to a better one.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM%3DzXYddr_TyXy43rhgtAAfJNJS%3D7D-EE6KngCcyYuhGQ9wXcw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BC7wFRG5Az-euL0RgV4Kg07dzeOWfCPBptjVcjb6xLHYTajpQ%40mail.gmail.com.