This is server side for my blog. Will update more content in the future You can refer my Django Boilerplate
- Python 3.8+
- PIP
Some virtualenv you can follow. Currently, I'm using miniconda.
- With conda/miniconda
$ conda create -n venv python=3.8
$ conda activate venv
- With virtualenv
# Install virtualenv from pip
$ pip install virtualenv
# create
$ python -m venv venv
$ source .venv/bin/active
- With pipenv
# Install pipenv from pip
$ pip install --user pipenv
After create your python virtual environment and activate it, the console will look like:
(venv) $
# Clone the project
(venv) $ git clone https://github.com/ngahoangvan/django-boilerplate.git
# Go to project
(venv) $ cd django-boilerplate
# Install package
(venv) $ pip install requirements.txt
# Copy .env file
(venv) $ cp src/.env.example src/.env
# Create migration
(venv) $ python src/manage.py makemigrations
# Apply migration file
(venv) $ python src/manage.py migrate
# Run server
(venv) $ python src/manage.py run server
Note: If you got issue is connection with database, please look at
src/app/settings/common.py
to edit DATABASES setting
- Step 1: Install Jupyter Lab package
pip install jupyterlab
- Step 2: Use below config inside
src/app/settings/dev.py
try:
import jupyterlab
notebook_default_url = '/lab'
except ImportError:
notebook_default_url = '/tree'
NOTEBOOK_ARGUMENTS = [
'--ip', '0.0.0.0',
'--port', '8888',
'--NotebookApp.default_url', notebook_default_url,
]
IPYTHON_KERNEL_DISPLAY_NAME = 'Django Kernel'
- Step 3: Start Jupyter Lab server
python manage.py shell_plus --notebook
.
├── bin # folder of bash file as quick tool
│ └── gunicorn.sh
│ └── dc-*.sh # script for docker-compose
│
├── docker-compose.db.dev.yml # docker-compose file for db
├── docker-compose.yaml # docker-compose file for development
├── requirements # requirements folder
│ ├── all.txt
│ ├── common.txt
│ ├── dev.txt
│ ├── prod.txt
│ └── test.txt
└── src # django source app
├── app # core setting
├── authentication # authentication app
├── users # user app
├── tests # unit test
├── manage.py # django manage file
└── ...
- DRF JWT Authentication
- Get value from .env file
- Users api CRUD endpoints
- Add docker configurations
- Document folder structure
- Configure static/media & templates
- Unit test
- Setup Jupyter Lab
- Setup pre-commit
- Integrate reactjs
- Github action