{"id":3432,"date":"2023-05-31T10:53:51","date_gmt":"2023-05-31T07:53:51","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=3432"},"modified":"2023-05-24T12:25:14","modified_gmt":"2023-05-24T09:25:14","slug":"how-to-install-django-on-linux","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/","title":{"rendered":"How to Install Django on Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you&#8217;re a Linux user and want to dive into Django development, this step-by-step guide will walk you through the installation of Django on Linux process. Django is a powerful and popular web framework for building robust and scalable web applications. By the end, you&#8217;ll have Django up and running on your Linux machine, ready to create amazing web applications.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/#Section_1_Preparing_Your_Linux_Environment\" title=\"Section 1: Preparing Your Linux Environment\">Section 1: Preparing Your Linux Environment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/#Section_2_Installing_Django_on_Linux\" title=\"Section 2: Installing Django on Linux\">Section 2: Installing Django on Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/#Section_3_Creating_Your_First_Django_Project\" title=\"Section 3: Creating Your First Django Project\">Section 3: Creating Your First Django Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/#Section_4_Setting_up_a_Database\" title=\"Section 4: Setting up a Database\">Section 4: Setting up a Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/#Section_5_Additional_Django_Configuration\" title=\"Section 5: Additional Django Configuration\">Section 5: Additional Django Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/#Final_thoughts\" title=\"Final thoughts\">Final thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Section_1_Preparing_Your_Linux_Environment\"><\/span>Section 1: Preparing Your Linux Environment<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before installing Django on Linux, let&#8217;s ensure your <a href=\"https:\/\/www.virtono.com\/memory-optimized-vps\">Linux environment<\/a> is ready. Follow these steps to set up the necessary dependencies:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Update Your System:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To begin, open a terminal and run the following command to update your system:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install Python:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Django on Linux is built with Python, so make sure it&#8217;s installed on your Linux machine. Run the following command to install Python:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt install python3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install Pip:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pip is a package manager for Python, which we&#8217;ll need to install Django and its dependencies. Execute the following command to install Pip:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt install python3-pip<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Section_2_Installing_Django_on_Linux\"><\/span>Section 2: Installing Django on Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now that your Linux environment is prepared, let&#8217;s move on to installing Django on Linux itself. Follow these steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a Virtual Environment:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A virtual environment isolates your Django project&#8217;s dependencies from your system&#8217;s Python installation. Run the following command to create a virtual environment named &#8220;myenv&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>apt install python3.10-venv\npython3 -m venv myenv<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Activate the Virtual Environment: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To activate the virtual environment, run the appropriate command based on your shell: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Bash\/Zsh: <code>source myenv\/bin\/activate<\/code> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Fish: <code>. myenv\/bin\/activate.fish<\/code> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For Csh\/Tcsh: <code>source myenv\/bin\/activate.csh<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install Django on Linux:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that your virtual environment is active, use Pip to install Django:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>pip install django<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"313\" data-attachment-id=\"3433\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/attachment\/screenshot-2023-05-24-at-10-59-32\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?fit=1874%2C784&amp;ssl=1\" data-orig-size=\"1874,784\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-05-24-at-10.59.32\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?fit=750%2C313&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?resize=750%2C313&#038;ssl=1\" alt=\"How to Install Django on Linux\" class=\"wp-image-3433\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?resize=1024%2C428&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?resize=300%2C126&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?resize=768%2C321&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?resize=1536%2C643&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-10.59.32.png?w=1874&amp;ssl=1 1874w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Verify the Installation:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure Django on Linux is successfully installed, run the following command to check the version:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>python -m django --version\n4.2.1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the version is displayed, congratulations! Django on Linux is installed correctly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Section_3_Creating_Your_First_Django_Project\"><\/span>Section 3: Creating Your First Django Project<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With Django installed, it&#8217;s time to create your first project. Follow these steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start a New Django Project:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to create a new Django project named &#8220;virtono&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>django-admin startproject virtono<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Navigate to the Project Directory:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Move into the project directory by executing the command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>cd virtono<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the Development Server:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start the Django development server with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>python manage.py migrate\npython manage.py runserver 0.0.0.0:8000<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"487\" data-attachment-id=\"3434\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/attachment\/screenshot-2023-05-24-at-11-13-24\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?fit=1942%2C1262&amp;ssl=1\" data-orig-size=\"1942,1262\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-05-24-at-11.13.24\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?fit=750%2C487&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?resize=750%2C487&#038;ssl=1\" alt=\"How to Install Django on Linux\" class=\"wp-image-3434\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?resize=1024%2C665&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?resize=300%2C195&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?resize=768%2C499&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?resize=1536%2C998&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.13.24.png?w=1942&amp;ssl=1 1942w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Access Your Django Application: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open a web browser and visit <code>http:\/\/you-server-IP:8000\/<\/code>. If you see the default Django landing page, your application is running successfully.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"431\" data-attachment-id=\"3435\" data-permalink=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-django-on-linux\/attachment\/screenshot-2023-05-24-at-11-26-19\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?fit=1982%2C1140&amp;ssl=1\" data-orig-size=\"1982,1140\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2023-05-24-at-11.26.19\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?fit=750%2C431&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?resize=750%2C431&#038;ssl=1\" alt=\"Access Your Django on Linux Application\" class=\"wp-image-3435\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?resize=1024%2C589&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?resize=300%2C173&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?resize=768%2C442&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?resize=1536%2C883&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/Screenshot-2023-05-24-at-11.26.19.png?w=1982&amp;ssl=1 1982w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Section_4_Setting_up_a_Database\"><\/span>Section 4: Setting up a Database<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Django supports various databases, and you can choose the one that suits your project requirements. Here&#8217;s an example of setting up a PostgreSQL database:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install PostgreSQL:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to install PostgreSQL:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo apt install postgresql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a Database: <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, create a new database for your Django project. Execute the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo su - postgres\ncreatedb mydatabase<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new user:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you are in the PostgreSQL command-line interface, run the following command to create a new user:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>sudo -u postgres psql\nCREATE USER your_username WITH PASSWORD 'your_password';\nGRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Update Django Settings:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In your Django project directory, open the <code>settings.py<\/code> file and locate the <code>DATABASES<\/code> section. Update it as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>DATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n        'NAME': 'mydatabase',\n        'USER': 'postgres',\n        'PASSWORD': 'your_password',\n        'HOST': 'localhost',\n        'PORT': '',\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Migrate the Database:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To apply the database changes, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>source myenv\/bin\/activate\npip install psycopg2-binary\nsudo apt-get install libpq-dev\npython manage.py migrate<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Section_5_Additional_Django_Configuration\"><\/span>Section 5: Additional Django Configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you have Django installed and your project set up, let&#8217;s cover some additional configuration steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Creating a Superuser:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A superuser account allows you to access the Django administration interface. Run the following command and follow the prompts to create a superuser:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>python manage.py createsuperuser<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Modifying Allowed Hosts:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Django only allows requests from <code>localhost<\/code>. To allow requests from your domain or IP address, open the <code>settings.py<\/code> file and locate the <code>ALLOWED_HOSTS<\/code> list. Add your domain or IP address to the list, like this:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>ALLOWED_HOSTS = &#91;'yourdomain.com', 'your_ip_address']<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-accent-color has-text-color\"><span class=\"ez-toc-section\" id=\"Final_thoughts\"><\/span>Final thoughts<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You have successfully installed Django on your Linux machine, created your first Django project, set up a database, and performed additional configurations. You&#8217;re now equipped to embark on your Django development journey. Remember to explore the vast Django documentation and engage in the vibrant Django community to enhance your skills and build exceptional web applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re a Linux user and want to dive into Django development, this step-by-step guide will walk you through the installation of Django on Linux process. Django is a powerful and popular web framework for building robust and scalable web applications. By the end, you&#8217;ll have Django up and running<\/p>\n","protected":false},"author":8,"featured_media":3436,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[439,435,441,438,436,434,440,437],"class_list":["post-3432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to","tag-create-django-project","tag-django-linux","tag-django-on-linux","tag-django-ubuntu","tag-how-to-install-django","tag-install-django","tag-installing-django","tag-installing-django-on-linux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-Django-on-Linux.png?fit=600%2C330&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-Tm","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3420,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-tensorflow-on-linux\/","url_meta":{"origin":3432,"position":0},"title":"How to Install TensorFlow On Linux","author":"George B.","date":"May 29, 2023","format":false,"excerpt":"Whether you're an aspiring data scientist or a seasoned professional, knowing how to install TensorFlow on Linux distribution is crucial. In this tutorial, we will guide you through the installation process on popular Linux distributions such as CentOS, Ubuntu, AlmaLinux, and Rocky Linux. TensorFlow is a versatile and powerful open-source\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-TensorFlow-On-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3285,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-rubygems-on-linux\/","url_meta":{"origin":3432,"position":1},"title":"How To Install RubyGems on Linux","author":"George B.","date":"April 21, 2023","format":false,"excerpt":"In this article, we will discuss how to install RubyGems on Linux. RubyGems is a package manager that allows you to easily install and manage Ruby software packages on your Linux machine. Before we begin, it is important to note that RubyGems comes pre-installed with Ruby, so if you have\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-To-Install-RubyGems-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-To-Install-RubyGems-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-To-Install-RubyGems-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3448,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-gitlab-on-linux\/","url_meta":{"origin":3432,"position":2},"title":"How to Install GitLab on Linux","author":"George B.","date":"June 3, 2023","format":false,"excerpt":"We will walk you through the step-by-step process of installing GitLab on Linux. Whether you are an Ubuntu or CentOS user, this guide has got you covered! GitLab is a powerful web-based Git repository manager that provides a complete DevOps platform for managing code repositories, continuous integration\/continuous deployment (CI\/CD), issue\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-GitLab-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-GitLab-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/05\/How-to-Install-GitLab-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3468,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-haproxy-on-linux\/","url_meta":{"origin":3432,"position":3},"title":"How to install HAProxy on Linux","author":"George B.","date":"June 7, 2023","format":false,"excerpt":"This article will provide a comprehensive, step-by-step guide on how to install HAProxy on Linux, specifically Ubuntu and CentOS distributions. So, let's dive in and explore the installation process. In today's technology-driven world, ensuring high availability and efficient load balancing of web applications is crucial. HAProxy, a powerful and open-source\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-HAProxy-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-HAProxy-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-HAProxy-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3507,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-lemp-stack-linux-nginx-mysql-and-php-on-ubuntu-22-04\/","url_meta":{"origin":3432,"position":4},"title":"How to install LEMP stack (Linux, Nginx, MySQL, and PHP) on Ubuntu 22.04","author":"George B.","date":"June 20, 2023","format":false,"excerpt":"Introduction The LEMP stack is a popular software stack for web development and hosting. It includes four major components: Linux, Nginx, MySQL, and PHP. Each component serves a specific purpose in powering dynamic websites and web applications. Linux is the operating system that serves as the LEMP stack's foundation. In\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-LEMP-stack-Linux-Nginx-MySQL-PHP-on-Ubuntu-22-04.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-LEMP-stack-Linux-Nginx-MySQL-PHP-on-Ubuntu-22-04.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-LEMP-stack-Linux-Nginx-MySQL-PHP-on-Ubuntu-22-04.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":866,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/viruses-and-linux-and-linux-antiviruses\/","url_meta":{"origin":3432,"position":5},"title":"Viruses and Linux and Linux Antiviruses","author":"Daniel Draga","date":"January 19, 2017","format":false,"excerpt":"Viruses and Linux Computer viruses are pieces of software that replicate themselves on a computer. The replication means a virus is distributing itself all over your computer, making it tough to get rid of. Viruses seem to understand that there\u2019s safety in numbers. Viruses can destroy data or send it\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/1364034317531-690x336.jpg?fit=690%2C336&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/1364034317531-690x336.jpg?fit=690%2C336&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/01\/1364034317531-690x336.jpg?fit=690%2C336&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=3432"}],"version-history":[{"count":1,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3432\/revisions"}],"predecessor-version":[{"id":3437,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/3432\/revisions\/3437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/3436"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=3432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=3432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=3432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}