Skip to content

Added settings.py modification after creating a template#115

Closed
doriczapari wants to merge 1 commit into
DjangoGirls:masterfrom
doriczapari:master
Closed

Added settings.py modification after creating a template#115
doriczapari wants to merge 1 commit into
DjangoGirls:masterfrom
doriczapari:master

Conversation

@doriczapari
Copy link
Copy Markdown
Contributor

I couldn't make my app work with the base template until I added the TEMPLATE_DIRS line in the settings.py file, just like we did with the static files. I hope this is a useful contributon as this is my first one ever! :)

@bmispelon
Copy link
Copy Markdown
Contributor

Using TEMPLATE_DIRS is the proper way to do it but it shouldn't have been necessary since 'mysite' is in INSTALLED_APPS so its templates are found automatically.

I haven't done the tutorial from beginning to end in a while, but maybe what is missing is simply a restart of runserver (it usually detects new/modified files automatically but it's possible that a new directory might not trigger the automatic restart).

@olasitarska
Copy link
Copy Markdown
Member

I just fixed it a couple of days ago with this: 5c1a110. @doriczapari probably took tutorial before this change...

@bmispelon what is easiest / best solution? I am on the fence :)

@doriczapari
Copy link
Copy Markdown
Contributor Author

@olasitarska yes, for me there was only ´'blog'´ in ´INSTALLED_APPS´, I had a hunch this could be the problem but I wasn't familiar enough with Django yet to prove my point :) Thanks!

@bmispelon
Copy link
Copy Markdown
Contributor

For me, having mysite in INSTALLED_APPS is kind of a hack and I think we can fix it without making things more complicated.

I'll try to work on this and review the current situation this week.

@bmispelon
Copy link
Copy Markdown
Contributor

I opened #117 as an alternative solution to this.

The approach I took there is to put all the templates inside the blog application so we don't need to either add mysite to INSTALLED_APPS or add the TEMPLATE_DIRS settings.

Feedback welcome as always,
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants