Login with username and password which was provided earlier by you on previous step Conclusion To use administrative interface,Access with /admin This will show you the default Django web page.īefore accessing the Django application on browser,You need to open the port on the server to access it externally,Refer this article to open the port on Iptables Open your web browser and access the Django Application with your server IP on port 8000. Note : Change your_server_IP details with your actual server IP as xx.xx.xx.xxįinally, run the Django application server with below command python3 manage.py runserver 0.0.0.0:8000ĭjango application server is running now. Vim django_app/settings.pyĪdd the IP ALLOWED_HOSTS = To allow external hosts, edit settings.py file and add IP under ALLOWED_HOSTS. By default, Django doesn’t allow external hosts to access the web interface. You will get an output as below,Enter the details Step 5 : Run the Django Application Run the following command from your Django application directory. We will now be creating a superuser account for the administration of the Django application. Python3 manage.py migrate Step 4 : Creating a Super User for Django Application Go to the path and migrate the changes cd django_app The django-admin command provides you the option to create a new Django application via command line.Navigate to the directory you need to create a new application and use below command django-admin startproject django_app You can also use pip to install Django on Ubuntu systems pip3 install DjangoĪfter Django is installed,You can verify the versionĢ.2.7 Step 3 : Create A Django Application Pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6) Step 2 : Installing Djangoĭjango source code is available as Github repository. To install pip,Use below command sudo apt-get install python3-pip If you have launched a new server,Then we recommend to update the server with below command sudo apt-get updateīy default, Python 3 is installed on your, but if your system doesn’t have Python installed, Execute the below commands to install it sudo apt-get install python3 Sudo access to your Ubuntu 18.04 (or) Ubuntu 16.04 server.Django’s primary goal is to ease the creation of complex, database-driven websites.In this article we will show you the steps to Install Django on Ubuntu 18.04 & 16.04 LTS Prerequisite It is maintained by the Django Software Foundation, an independent organization established as a 501 non-profit. Django is a Python-based free and open-source web framework, which follows the model-template-view architectural pattern.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |