Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSahar Nasiri
7,454 Pointsadmin.py
Why is the admin.py file in the courses folder not in the root learning_site folder?
Sahar Nasiri
7,454 PointsThanks.
I get what you're saying, but it seems that we have a learning_site application too, you know in the learning_site folder inside of the learning_site root folder. I meant that why don't we have an admin.py file in there? Isn't an application?
Paco Rosales
663 PointsI think the outer learning_site folder is just for organization, in fact you can change its name to wathever you want (I like to call it "src"), what maters is the apps and "stub" folders inside
Aimn Blbol
10,352 Pointslearning_site is the project, courses is the the app. if you want to add your app models (courses models) in the admin, then create the admin.py in the app (courses) and use it to register your courses models. If you have another app in learning_site, then do the same thing
1 Answer
__ROLLER__ Angel
25,606 PointsHaving it in the root would get really messy if you have a lot of apps, this is Python so they think about things like that ahead of time to help you out down the road.
Aimn Blbol
10,352 PointsAimn Blbol
10,352 PointsEach app has its own admin.py. So if your project is learn_site and your have 2 apps in there, then each app will have its own admin.py. This way you can choose which app to add to your site admin panal. I hope that helps.