Update Installation Guide and .env

This commit is contained in:
sosokker 2023-09-21 20:48:47 +07:00
parent c8d35735a6
commit fc784a2ce5
2 changed files with 14 additions and 6 deletions

View File

@ -31,7 +31,7 @@ or run `setup.ps1` (For Windows User)
2. Run these commands to clone this repository and enter the directory.
```bash
git clone https://github.com/Sosokker/ku-polls
cd ku
cd ku-polls
```
3. (Optional: You can use venv instead)Install virtualenv via pip
@ -41,20 +41,20 @@ python -m pip install --user virtualenv
```
4. Create virtual environment with `venv` or `virtualenv`.
```bash
python -m virtualenv .venv
python -m virtualenv venv
or
python -m venv .venv
python -m venv venv
```
5. Use `virtual environment`
- Windows
```bash
.venv\Scripts\activate
.\venv\Scripts\activate
```
- Linux or MacOS
```bash
source .venv/bin/activate
source venv/bin/activate
```
6. Install require module.
```
@ -65,6 +65,10 @@ pip install -r requirements.txt
**You can look at `sample.env` for more information and others environment variables to set.**
```bash
SECRET_KEY=your_secret_key
DEBUG = False
ALLOWED_HOSTS = *.ku.th, localhost, 127.0.0.1, ::1
TIME_ZONE = Asia/Bangkok
EMAIL_HOST_PASSWORD = yourpassword
```
You can generate your own `your_secret_key` by this command

View File

@ -7,4 +7,8 @@ DEBUG = False
# You can use wildcard chars (*) and IP addresses. Use * for any host.
ALLOWED_HOSTS = *.ku.th, localhost, 127.0.0.1, ::1
# Your timezone
TIME_ZONE = Asia/Bangkok
TIME_ZONE = Asia/Bangkok
# Password to use for the SMTP server defined in EMAIL_HOST. This setting is used in conjunction
# with EMAIL_HOST_USER when authenticating to the SMTP server.
# If either of these settings is empty, Django wont attempt authentication.
EMAIL_HOST_PASSWORD=somepassword