Django Framework Installation and First Project


Django Framework Installation and First Project

Django is a popular framework used to build modern and secure web applications with the Python programming language. Known for its rapid development capability, built-in admin panel, and modular structure, Django Framework is preferred by both beginners and professional developers. In this article, we will explain step by step how to install the Django Framework and how to create your first Django project in detail.

Django Framework Installation

Checking Python Installation

To use Django, Python must be installed on your system. If Python is not installed, you can download it here. To verify the installation, you can run the following command in the terminal:

python --version

Installing Django and Virtual Environment

The best way to manage dependencies in Django projects is to create a virtual environment. This way, each project works isolated with its own library versions:

python -m venv myvenv
source myvenv/bin/activate   # Linux / macOS
or
myvenv\Scripts\activate      # Windows

Now we can install the Django Framework with pip:

pip install django

To check whether the installation was successful:

django-admin --version

Creating the First Django Project

Starting a Django Project

You can start your first Django project by entering the following command into the command line:

django-admin startproject ilkproje

This command creates a folder named "ilkproje" and the main project files. You can navigate to the project folder and start the server:

cd ilkproje
python manage.py runserver

If you see an output like the following, it means Django Framework is running successfully:

Starting development server at http://127.0.0.1:8000/

You can visit http://127.0.0.1:8000/ in your browser to see your first Django project in action.

Conclusion

The installation of Django Framework and creating the first project are quite easy and quick. Anyone who wants to quickly develop professional web applications with Python can take advantage of Django's modern features and powerful infrastructure. As the next step, you can move on to customizing your application and adding apps. Don't forget to follow our blog for more content and tips about Django Framework!