Set up the core Django project and a dedicated recipes app, then model the domain your API will rely on (recipes, ingredients, and ratings). You’ll configure settings (SQLite, CORS, static files), register models in the admin, and add a couple of CLI scripts to seed data and safely wipe/reset tables for local development.
Overview
Syllabus
- Unit 1: Initializing Your Django Project
- Fixing the Codesignal Environment
- Enabling Cross Origin Request Support
- Configuring Database for Your Cooking App
- Creating the Main URL Router
- Executing our app
- Unit 2: Designing Database Models
- Create Ingredient model
- Add Recipe Model
- Implement Recipe-Ingredient Many-to-Many Relationship in Django
- Create Review Model with ForeignKey to Recipe
- Register Ingredient, Recipe and Review Models in Django Admin
- Unit 3: Resetting Your Database
- Implement imports and Django setup in reset_database.py
- Add User Confirmation to Database Reset Script
- Enhance Database Reset Script with Transaction and Error Handling
- Correct Deletion Order in Database Reset Script
- Add Entry-Point Guard to Reset Database Script
- Unit 4: Adding Manual Recipes
- Fix Project Root Import Path in Add Manual Recipe Script
- Add Recipe Name Prompt and Validation
- Collect Recipe Ingredients
- Implement prompt_for_steps Function
- Implement Recipe Persistence with Django ORM
- Implement Duplicate Recipe Prevention