Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizGeneral Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Can you share the place of the template directory. if the templates directory in the Appapi/ or in each app's directory.
Django Version ?
I have suggest some changes in settings.py file.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'templates'),)
add a directory templates in every app
Appapi/
movies/
settings.py
urls.py
wsgi.py
imdb/
templates/
migrations/
migrationsfiles....
models.py
views.py
serializers.py
...
venv/
manage.py
README.md
requirements.txt
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
manpreet
Best Answer
2 years ago
Before anyone asks, I've checked a lot of answers, and 'rest_framework' is listed on my Installed Apps. I have created a new venv and installed all dependencies on it again and still the same error.
When I try the url http://127.0.0.1:8000/admin I get the error template TemplateDoesNotExist at /Admin. When I try any endpoint of my API I get the same error.
I'm a bit confused because this project was running on my computer 1 month ago, but I got a problem in my computer and had to format. When I cloned the project again, got this error.
I'm going to list some of my settings about directory folder, I'm having a bad feeling about it.
Folders structure is:
And some other files, like gitignore, procfile, etc.
Some of the errors traceback: django.template.exceptions.TemplateDoesNotExist: index.html
Edit:
Django version 2.1;
I don't have a templates directory, I'm using rest-framework to make an API, so I'm not dealing with html, css and js with Django.