In a browser, navigate to public DNS of the instance, make sure to append port “8000” at the end and if everything was properly configured, it will show the index page of the application. Use the following commands to migrate the database, get static files ready and to test run the Django inbuilt development server. To install Django, run the following command: The most important dependency would be Django which can be installed using pip. If not, please install the necessary dependencies to run the Django app without any errors. Note: A repository may or may not contain requirements file. To install the necessary requirements, run the following command: pip install -r requirements.txt Press Esc key and type :wq to save the file. Note: Add instance’s DNS name/IP to “Allowed Hosts” in settings.py ALLOWED_HOSTS= This line specifies the directory where all the static files are located. STATIC_ROOT = os.path.join(BASE_DIR, "static/") Press I to insert in the file, and insert the following line at the end of the file. The second command will open up the settings.py file in vim editor. Use the following commands to edit the settings.py file: cd myproject Here we will set up our virtual environment and also clone our Django application repository.Īctivate the virtual environment with the command: source myprojectenv/bin/activate
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |