Go back

Running Django Demos

Note: Visual Studio Code is configured to use /home/coder as the project home folder. Any new files and folders during development must be created under /home/coder .

/img/common/python-django-flask-common-images/vscode-web-interface.png

Follow below steps to create and run the demos:

  • Make sure to create new django projects inside the /home/coder/ directory, so that your new projects will be available in the Browser based Visual Studio Code.

  • Once your project is created, navigate to your project directory where manage.py file exist. for example as shown in below screenshot.

  cd /home/coder/myproject

/img/common/python-django-flask-common-images/start-django-project.png

  • Then run below command to start Django server
sudo python manage.py runserver 0:80

/img/common/python-django-flask-common-images/run-django-server-new.png

  • After running the command, open http://publicip and you should see the demo page displayed. Make sure to use http and not https.

    /img/common/python-django-flask-common-images/django-demo-page-new.png

  • Some demos require creating super/admin user . To create admin user, run below command from the demo’s home directory and follow the instructions.

  sudo python manage.py createsuperuser

/img/common/python-django-flask-common-images/django-root-user.png

  • You can access the admin interface from http://publicip/admin/. Run the server again to access the admin interface.

/img/common/python-django-flask-common-images/django-admin-page.png

  • Provide the super/admin user name and password created in above step.

/img/common/python-django-flask-common-images/django-admin-home-page.png

Go back