reading-notes

  1. Install Django
    • Install the latest version of Django using pip by running pip install django
  2. Create a new project
    • Create a new Django project by running the command django-admin startproject projectname
  3. Create a new app
    • Create a new app within your project by running the command python manage.py startapp appname
  4. Configure the database
    • Configure the database settings in the project’s settings.py file, you can use the default SQLite database or any other database of your choice.
  5. Create models
    • Define the models for your application by creating a models.py file in the app folder and defining classes for each model.
  6. Create views
    • Create views to handle requests and return responses by creating a views.py file in the app folder and defining functions for each view.
  7. Create templates
    • Create templates for your views by creating a templates folder in the app folder and creating HTML files for each view.
  8. Create URLs
    • Create URLs for your views by creating a urls.py file in the app folder and defining URLs for each view.
  9. Run migrations
    • Run migrations to create the necessary database tables by running the command python manage.py makemigrations and python manage.py migrate
  10. Test the project
    • Test the project by running the development server with the command python manage.py runserver
    • Run tests for the app by running the command python manage.py test appname where appname is the name of the app you want to test.