Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

Jassim Al-Hatem
Jassim Al-Hatem
20,093 Points

Django REST Framework

Is there a way to override django's REST framework default interface? I've been trying for a minute and I still can't figure it out.

Chris Freeman
Chris Freeman
Treehouse Moderator 66,111 Points

After several hot minutes, I found default templates located in the directory <your_venv_dir>/lib/<your_python_version>/site-packages/rest_framework/templates/rest_framework.

Then, on this page, it discusses how to include your own templates to override the built-in ones. I suspect you'd need to put your versions in a project directory then add your templates directory to the settings.py file. IIRC, your templates directory structure should mirror the call path. For exaxple, your base.html would be placed in: <your_proj_temple_dir>/rest_framework/base.html

It might be as simple as creating your own base.html file to change the look and feel.

Good luck!!

Chris Freeman
Chris Freeman
Treehouse Moderator 66,111 Points

Let me know if this was a sufficient answer, I can change comment to answer.