Comments (5)
Interesting. This may be a change to Django. I did not have to modify settings.py this way. I took a look at their documentation and don't see anything about a change here though.
From https://docs.djangoproject.com/en/3.1/intro/tutorial03/#write-views-that-actually-do-something, it looks like you shouldn't have to do this:
Your project’s TEMPLATES setting describes how Django will load and render templates. The default settings file configures a DjangoTemplates backend whose APP_DIRS option is set to True. By convention DjangoTemplates looks for a “templates” subdirectory in each of the INSTALLED_APPS.
Within the templates directory you have just created, create another directory called polls, and within that create a file called index.html. In other words, your template should be at polls/templates/polls/index.html. Because of how the app_directories template loader works as described above, you can refer to this template within Django as polls/index.html.
With 'APP_DIRS': True
, the app should work, since the directory structure is following the app_name/templates/app_name
convention. What version of Django are you using?
from msgraph-sample-pythondjangoapp.
Django==3.1.4
Looking at the diff I see that 3.1.4 uses pathlib whereas 3.0.4 used os, to build BASE_DIR.
BASE_DIR = Path(__file__).resolve().parent.parent
instead of
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Swapping out settings.py with the one in this repo works fine.
from msgraph-sample-pythondjangoapp.
Interesting. I have 3.1.4 on my machine, but when it generates a project, settings.py still says it was generated by 3.0.4, and it uses the os.path.dirname
approach. It looks like I've got an issue with multiple Python versions on this machine. I'll clean that up and get this straightened out in the tutorial. Thanks for reporting.
from msgraph-sample-pythondjangoapp.
I cleaned up my Python installs and started this over with Python 3.9.2 and Django 3.1.7. I did see the following line in settings.py:
BASE_DIR = Path(__file__).resolve().parent.parent
However, I still did not need to modify settings.py as you did. Did you add tutorial
in the INSTALLED_APPS
section as described in step 6? If I skip that step I also get a TemplateDoesNotExist
error.
from msgraph-sample-pythondjangoapp.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
from msgraph-sample-pythondjangoapp.
Related Issues (20)
- Sign in does not work HOT 6
- Home Page is Not rendering after Providing Credentials HOT 12
- Question about Tutorial code HOT 1
- Not pulling calendar events HOT 3
- Replace get_sign_in_url with get_sign_in_flow
- Update documentation HOT 1
- Syntax Error on Raise From in Manage.py because of the shebang line? HOT 4
- Redirection to the incorrect locale HOT 3
- is user_athenticated not being set to true on login HOT 6
- ValueError ("state missing from auth_code_flow") HOT 4
- OWA graph simple example required - no django HOT 6
- authority issue needs to be discussed in tutorial HOT 2
- Unauthenticated user cannot access the site. HOT 1
- Tutorial part 3: Sign-In throws error - localhost refused to connect. HOT 4
- Authentication Problem - ValueError at /callback HOT 1
- Why is pycparser needed? HOT 2
- Use the O365 package? HOT 2
- Quickstart Fails to Authenticate. HOT 8
- Unauthenticated User Exception HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msgraph-sample-pythondjangoapp.