Django Framework Setting
by lubmalaindia in Teachers > University+
30 Views, 1 Favorites, 0 Comments
Django Framework Setting
Learn about Django (the Python Framework) step by step.
Install Python and Pip
First of all, install python and Django. Check your version. It is essential to check the version.
Make sure you have Python installed on your system. You can download and install it from python.org.
pip (Python's package installer) is usually installed automatically with Python. You can check if it's installed by running:
Install Virtualenv
Install virtualenv using pip:
Create a Virtual Environment
Create a directory for your project and navigate to it:
Create a virtual environment:
This will create a directory named venv inside your project directory.
Activate the Virtual Environment
Activate the virtual environment. The command varies depending on your operating system:
After activation, you should see the virtual environment's name in your command prompt.
Install Django
With the virtual environment activated, now install Django using pip:
Start a New Django Project
Create a new Django project by running:
This will create a new Django project named myproject in the current directory.
Run the Development Server
Navigate to the project directory and run the development server to ensure everything is set up correctly:
You should see output indicating that the server is running, and you can visit http://127.0.0.1:8000/ in your web browser to see the default Django welcome page.
Deactivate the Virtual Environment
When you're done working, you can deactivate the virtual environment by running: