Here are the steps to create a folder, set up a virtual environment, install Django, create a Django project, and run the development server:
-
Create a Folder: First, create a new directory for your Django project.
-
Open Command Prompt in the Folder: Now, navigate to the folder you just created in Command Prompt.
-
Set Up a Virtual Environment: In your Command Prompt, use the following command to create a virtual environment named 'my_env':
python -m venv env
Activate the virtual environment:
env\Scripts\activate
-
Install Django: With the virtual environment activated, install Django using pip:
pip install django
-
Create a Django Project: To start a new Django project, run the following command, replacing 'my_project' with your desired project name:
django-admin startproject AAAIH
-
Navigate to Your Project Folder: Change to the project directory using the 'cd' command:
cd AAAIH
-
Run the Development Server: Finally, start the Django development server:
python manage.py runserver
This will display a URL, typically
http://127.0.0.1:8000/
, in the command prompt. -
Access the Development Server: Copy the URL displayed in the command prompt and paste it into your web browser to access your Django project.
These steps will help you create a clean development environment and get your Django project up and running professionally.