VisualStudioCode: Startup Kit

DJANGO


1. Install Python and set path variable in the installation

2. Create new folder and create virtual environment

python -m venv env

 

3. Set interpreter

 

 

4. Navigate to terminal and install Django

python -m pip install django

5. Create Django Project

django-admin startproject web_project .

6. Create New app

python manage.py startapp hello

 7. Create debugger profile

https://code.visualstudio.com/docs/python/tutorial-django

8. Serve Static Files (Development)

from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns += staticfiles_urlpatterns()

 

9. Serve Static files (Production)

Note app static files should be saved under app>static>app>

STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected')

 

10. Run the following commands

python manage.py makemigrations

python manage.py migrate

python manage.py collectstatic 

 

11. Continue with your project activities as usual

 

Reference

https://code.visualstudio.com/docs/python/tutorial-django

 

 

            Related
VisualStudioCode: Startup Kit