site
site copied to clipboard
Document frequently asked questions: DRF-specific topics
- DRF is a thing we use apparently, can we include some basic “getting started” stuff with it?
- Also we technically don’t mention we use DRF anywhere, so it would probably be good to mention that we use it to start
- How do you actually interface with a new model you create? There’s a lot of assumed knowledge here from when I was asking questions.
- “It's a matter of adding models and setting up DRF views”
- DRF isn’t really part of basic Django knowledge. Maybe provide resources on this or how it works. So far all the site mentions is Django, so it’s a bit of curveball to now deal with this when it isn’t really mentioned anywhere currently.
- “I just go to the serializers folder on the site repo and look at the endpoint examples”
- Do we have to write the serializers? How do serializers fit in here? I thought it was just models and viewsets, but now it also involves serializers?
- “interfacing is done with DRF, which auto generates docs”
- How is this done? Is there a command that needs to be run like the migrations?
- How do you even view this? This is the first I’ve heard of this.
- How do tests work? Is it just for DRF/api? Are there tests elsewhere?
- Is there a good example of what a test with django api/drf looks like?
- I’m only familiar with django auto migration stuff. If I add a new model, migrations need to be added. Maybe a few best practices/tips for that. I don’t think most people are aware you can rename migrations to something that makes sense.
- There’s a
bot/folder under models. Is that just for Python bot? Do other bots get their own folders?- It would be good to go through some of the important files under api. Despite me having gone through the Django tutorial and done some hobby work in Django, it’s unclear what parts of Django we use and how that fits into these models.
How would you like to document this FAQ?
Hi, well, some parts of it will be covered elsewhere by e.g. the app-specific documentation. The rest I'm not sure yet - perhaps a good place to link it would be in the site contributing site for both DRF-specific topics and pydis-specific topics