summer-of-code-2023

DevClub Summer of Code 2023

Backend Development: Week 2

Note: Since we will be progressing with the project, we will be using the backend folder in the root of this repository as our project folder. So, make sure you have cloned this repository in your system.

Task 2A: Creating a Virtual Environment and Installing Django

You have to create a python virtual environment for your project. You can use the venv module to create a virtual environment. You can refer to the official documentation for more details.

Task 2B: Creating a Django Project and App

You have to create a Django project. You can refer to the official documentation for more details.

Task 2C: Creating Models and Rendering Templates

You have to create models for your app and render templates using the models. You can refer to the official documentation for more details.

Task 2D: Adding Authentication

You have to add authentication to your project. You can refer to the official documentation for more details.

Task 2E: Creating form for adding products

You have to create a form for adding products to the database. You can refer to the official documentation for more details.

Bonus Task

  1. Visualise your schema! Create a file backend/schema.md and write each field and their data type etc. for each Model in table format in markdown, keeping a separate Table for each Model. Also, create a diagram for your schema using Mermaid.
  2. By default, Django uses sqlite3 as its database for development. However, for production, you need to set up a database like MySQL or PostgreSQL. So, for the first bonus task, setup PostgreSQL on your local machine and connect it to Django
  3. When using Django on production, we prefer a different server like nginx or apache for rendering the static files like the templates and assets. So, set up a simple nginx static server, and place your static files accordingly
  4. Django server runs on port 8000 usually. However, port 80 is used to listen to HTTP traffic in a server. Although it may seem straightforward, the catch here is that 80 and 443 are privileged ports, so it is an unsafe practice to allow Django to use them directly. Now, setup a reverse proxy on nginx to forward traffic to and from port 80 to 8000