-
Notifications
You must be signed in to change notification settings - Fork 0
Django first version #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
aak523
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, I like the practical/step-by-step nature of this HackPack.
I made a few changes, mostly around explaining some of the concepts that you introduced, and also suggested a few changes / new sections you could add.
| class Meta: | ||
| model = Note | ||
| fields = ['id', 'title', 'content', 'created_at'] | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explained what a serializer actually does on a conceptual level but I think it might also be useful to explain what the code itself is actually doing, even if relatively simple.
Even just the fact that it uses interfaces and classes is already a bit beyond basic beginner Python knowledge.
| class NoteViewSet(viewsets.ModelViewSet): | ||
| queryset = Note.objects.all() | ||
| serializer_class = NoteSerializer | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here again. The explanation of ViewSets makes sense, but you probably also want to explain the code in a bit more depth as well.
| - **What is Django REST Framework?** DRF is *"a powerful and flexible toolkit for building Web APIs"*. It makes it easy to expose your data (e.g. notes) as JSON over HTTP so that any frontend (mobile app, web UI, etc.) can use it. | ||
| - **Local deployment:** All steps below target running Django on your own machine. We'll use **SQLite** (the default database), which requires no extra installation. No cloud or complex servers are needed. | ||
|
|
||
| ## Prerequisites & Setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the detailed installation/setup instructions. However, it might also be a good idea to add a troubleshooting section at the end (I know from experience that the python/python3 command difference confuses people, venv setup might also not be trivial, etc.).
Can suggest a few more potential issues if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the HackPack's quite step-by-step and finishes pretty abruptly once you've finished building the app, you probably want to add a "What's next" section to go through what the hacker has learnt and how they could apply that knowledge in their own project.
|
One other thing - it might be good to review Tim's API design HackPack and delegate some of the explaining of basic concepts to that guide. |
|
Also can we remove the py_cache folders before merging? |
No description provided.