Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How To Install Django on Fedora 35/34/33

    How To Install Django on Fedora 35/34/33

    RahulBy RahulAugust 30, 20193 Mins ReadUpdated:February 14, 2022

    Django is a Python Web framework that encourages the rapid development of applications. This tutorial helps you to install Django on Fedora 35/34/33/32/31/30 Linux. After that, we will create a Django application and run it.

    Step 1 – Prerequisites

    Fedora’s latest versions have already installed Python 3. The minimal installation systems may not have Python installed, Execute the below commands to install it. Also, install pip on your system.

    sudo dnf install python3 python3-pip 
    

    Then check the Python and pip version:

    python3 -V 
    
    Python 3.7.3
    
    pip3 -V 
    
    pip 19.0.3 from /usr/lib/python3.7/site-packages/pip (python 3.7)
    

    Step 2 – Install Django on Fedora

    Django source code is available as a Github repository. This tutorial uses pip3 for the Django installation on Fedora Linux. Simply execute the following command from the terminal:

    pip3 install Django 
    

    You will get a django-admin command for creating new projects. Check the current installed verson:

    django-admin --version 
    
    2.2.5
    

    Step 3 – Create Django Application

    Django has been installed on your system. Now we will create a new Django application. The django-admin command provides you the option to create a new Django application via the command line. First, navigate to the directory you need to create a new application.

    Then use the django-admin startproject command followed by the application name to create a new Django application on a Debian Linux.

    cd /var/www 
    django-admin startproject django_app 
    

    After that migrate the pending changes.

    cd django_app 
    python3 manage.py migrate 
    

    Step 4 – Create Super Admin Account

    Now, create a superuser account for the administration of the Django application. Run the following command from your Django application directory.

    python3 manage.py createsuperuser 
    

    Step 5 – Run Django Application

    A new Django application is ready to use. By default, Django doesn’t allow external hosts to access the web interface. To allow external hosts, edit the settings.py file and add IP under ALLOWED_HOSTS.

    nano django_app/settings.py 
    

    Add IP:

    ALLOWED_HOSTS = ['192.168.1.239']
    

    Here 192.168.1.239 is the IP address of the system where Django is installed.

    Finally, run the Django application server with the below command. Here 0.0.0.0:8000 defined that Django will listen on all interfaces on port 8000. You can change this port with any of your choices.

    python3 manage.py runserver 0.0.0.0:8000 
    

    running django on fedora

    The Django application server is running now. Open your favorite web browser and access to Django system IP on port 8000. This will show you the default Django web page.

    http://192.168.1.239:8000
    

    Django also provides an administrative web interface. You can access this at /admin subdirectory URL of your Django application. Use superuser login credentials created in the previous step.

    http://192.168.1.239:8000/admin
    

    Installing django on Fedora

    The Django admin dashboard looks like below. Here you can add more users and groups to your application.

    Django Admin on Fedora

    django fedora python framework
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install and Use virtualenv with Python 3
    Next Article How to Prevent Image Hotlinking in Apache with .htaccess

    Related Posts

    How to Install Ionic Framework on Ubuntu 22.04

    3 Mins Read

    What is the /etc/hosts file in Linux

    Updated:June 27, 20222 Mins Read

    How to Create DMARC Record For Your Domain

    3 Mins Read

    What is Computer Hardware?

    4 Mins Read

    What is Information Technology (IT)?

    Updated:June 20, 20223 Mins Read

    How to Recycle IIS Application Pool in Windows

    Updated:June 16, 20222 Mins Read

    1 Comment

    1. Jamal A M on August 9, 2020 10:25 am

      Very easy, just typed and my django app is up. Thanks Dude, just started learning Django in Fedora 32.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    • How to Install Angular CLI on Ubuntu 22.04
    • How to Install Composer on Ubuntu 22.04
    • How to Create DMARC Record For Your Domain
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.