Don't forget to hit the ⭐ if you like this repo.
Steps to create a new Django project:
If you haven't already installed Django, open your terminal or command prompt and run the following command:
pip install django
Once you have installed Django, you can create a new project by running the following command in your terminal or command prompt:
django-admin startproject projek_ST
Replace "projek_ST" with the name you want to give your new Django project. This command will create a new directory with the same name as your project inside the directory where you ran the command.
Once you have created a new project, you can create a new app by running the following command:
python manage.py startapp appname
Replace "appname" with the name you want to give your new app. This command will create a new directory with the same name as your app inside the project directory.
Now that you have created a new app, you can define your models in the models.py file inside the app directory. Models are used to define the data structure of your application.
Once you have defined your models, you can create database tables by running the following command:
python manage.py makemigrations
This command will create a new migration file in the migrations directory inside your app directory.
Once you have created the migration file, you can apply the migrations by running the following command:
python manage.py migrate
This command will create the necessary database tables based on the models you have defined.
Now that you have defined your models and created the necessary database tables, you can create a view to display the data. Views are used to handle requests and render responses.
Once you have created a view, you can define URLs that will map to your views by creating a urls.py file inside your app directory.
Now that you have defined your models, created database tables, created a view, and defined URLs, you can run the development server by running the following command:
python manage.py runserver
This command will start the development server, and you can access your application by navigating to http://127.0.0.1:8000/ http://localhost:8000/ or in your web browser.
Please create an Issue for any improvements, suggestions or errors in the content.
You can also contact me using Linkedin for any other queries or feedback.