# install virtual environments brew
mkdir django_website
cd django_website
django_website brew update
django_website brew install pyenv-virtualenv # install virtual evnironment which
django_website pyenv virtualenv 3.8.10 # help install depandancies for python
# not conflicted with other # depandancies in other project
django_website pyenv virtualenv 3.8.10 djangowebsite@3.8.10 # name virtual # environment
# install vim if you didn't already
django_websitevim .python-version # create python version file
# in python version file put name djangowebsite@3.8.10
# python-version file automatically activates your virtual environment
# when you " cd " into project directory
# you can also activate it manually by running "pyenv activate djangowebsite@3.8.10" in
# terminal
django_websitepyenv virtualenvs # show installed virtual environments
# in your project folder in vs_code make folder " requirements ".
# in requirements folder make dev.txt and prod.txt
# in dev.txt write
# everything the developer needs in addition to the production requirements
-r prod.txt
#go back to terminal
djangowebsitepip install -r requirements/dev.txt
djangowebsitepip install django
# when install Django it will show in terminal version of Django(Django-3.0.7)
# take that version and put it in " prod.txt " file
# if I want to pin that version I will change Django-3.0.7 to Django==3.0.7
# to check if Django is installed we can run on terminal
djangowebsitepython
djangowebsiteimport django
djangowebsiteprint[django.get_version()]
# press CTRL + D to exit that shell
# django has django-admin with tools for creating project
djangowebsitedjango-admin startproject hackershack # hackershack is name of proj.
# it will create our boilerplate for our project
# python-boilerplate puts all source code for your project under the src/<package> folder. #This contrasts with the other typical approach of leaving the python packages directly in the #root of the the source tree.
djangowebsitels # list hackershack website
# if I go to my vs_code project I can see " manage.py " file
# also, have folder " hackershack " with __init__.py, asgi.py, settings.py,urls.py and wsgi.py
# you can removing nasted folder hackershack by moving all files to parent folder
# you can move manage.py to root
# manage.py is our start point where we type commands to running our server
djangowebsitepython manage.py runserver # this will start our server for us
# it start our server at port:8000
# if I open my Chrome and type localhost:8000 you can see my Django site is up and running