Create Project Directory
$ mkdir project_name
Go to Project Dir
$ cd project_name
Create Virtualenv
$ virtualenv virtual_env_name
a. virtual_env_name\Scripts\activate
b. pip freeze (to check packages installed)
c. pip install django==2.1.8
$ for specific version of python
virtualenv -p c:\python34.exe myvirtualenv
Make SRC for applications
$ mkdir src
$ cd src
Create Root application
$ django-admin startproject project_name .
Run Application
$ python manage.py runserver
Create app inside src application
$ cd src
$ django-admin startapp app_name
Structure kind of like this:
[projectname]/ <- project root
├── venv
| ├── Scripts
| ├── bin
| ├── ...
|
├── [projectname]/
│ ├── __init__.py
│ ├── settings/
│ │ ├── common.py
│ │ ├── development.py
│ │ ├── i18n.py
│ │ ├── __init__.py
│ │ └── production.py
│ ├── urls.py
│ └── wsgi.py
├── apps/
│ └── __init__.py
├── configs/
│ ├── apache2_vhost.sample
│ └── README
├── doc/
│ ├── Makefile
│ └── source/
│ └── *snap*
├── manage.py
├── README.rst
├── run/
│ ├── media/
│ │ └── README
│ ├── README
│ └── static/
│ └── README
├── static/
│ └── README
└── templates/
| ├── base.html
| ├── core
| │ └── login.html
| └── README
-
format code: CTR + ALT + L
-
Django Use Jinja2 technique currently for templating
** If there is running project after closing on server
netstat -o get the PID and type > Taskkill PID **** /F
we can JSON data type stored in MySQL
- https://stackoverflow.com/questions/4251124/inserting-json-into-mysql-using-python
- https://django-mysql.readthedocs.io/en/latest/model_fields/json_field.html
- https://geert.vanderkelen.org/2015/mysql577-json-python/
- https://medium.com/aubergine-solutions/working-with-mysql-json-data-type-with-prepared-statements-using-it-in-go-and-resolving-the-15ef14974c48
- https://dev.mysql.com/doc/refman/8.0/en/json.html