mirror of
https://github.com/Sosokker/ku-polls.git
synced 2025-12-18 13:04:05 +01:00
107 lines
2.9 KiB
Markdown
107 lines
2.9 KiB
Markdown
## KU Polls: Online Survey Questions
|
|
|
|
[](https://github.com/Sosokker/ku-polls/actions/workflows/django.yml)
|
|
|
|
An application to conduct online polls and surveys based
|
|
on the [Django Tutorial project](https://docs.djangoproject.com/en/4.2/intro/tutorial01/), with additional features.
|
|
|
|
## Installation
|
|
|
|
Here is **[Install Instruction](Installation.md)**.
|
|
|
|
## How to Run
|
|
|
|
### Docker compose
|
|
|
|
1. Clone the repository then create .env file in the following format
|
|
|
|
```bash
|
|
git clone https://github.com/Sosokker/ku-polls
|
|
```
|
|
|
|
.env Format
|
|
|
|
```file
|
|
SECRET_KEY=your_secret_key
|
|
DEBUG=True
|
|
ALLOWED_HOSTS=localhost
|
|
TIME_ZONE=Asia/Bangkok
|
|
EMAIL_HOST_PASSWORD=yourpassword
|
|
```
|
|
|
|
2. Run docker compose
|
|
|
|
```bash
|
|
docker compose up
|
|
```
|
|
|
|
### Setup.py Method
|
|
|
|
Using setup.py method, it will set `.env` for you and runserver automatically with [--insecure](https://docs.djangoproject.com/en/4.2/ref/contrib/staticfiles/#cmdoption-runserver-insecure).
|
|
You can set `DEBUG=True` later and then runserver normally to load static files.
|
|
|
|
Then, connect to [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
|
|
|
|
### Manual Installation
|
|
|
|
After follow all of instruction.
|
|
|
|
- Set Virtual Environment and Use it.
|
|
- Install Dependencies.
|
|
- Migrate and then Load fixtures.
|
|
- Set variable of `.env`
|
|
|
|
You can run with this command.
|
|
|
|
```bash
|
|
python manage.py runserver
|
|
```
|
|
|
|
Anyway, if you set `DEBUG = False` then django production server will not load static files for you.
|
|
You need to set `DEBUG = True` or run this command.
|
|
|
|
```bash
|
|
python manage.py runserver --insecure
|
|
```
|
|
|
|
Then, connect to [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
|
|
|
|
---
|
|
|
|
**NOTE** : If you have problems with port you can use runserver and specific your own port.
|
|
|
|
For example, If you run this command then you need to connect to [http://127.0.0.1:7000/](http://127.0.0.1:7000/)
|
|
|
|
```bash
|
|
python manage.py runserver 7000
|
|
```
|
|
|
|
## Demo Superuser
|
|
|
|
| Username | Password |
|
|
| :------: | :--------------: |
|
|
| admin | ineedmorebullets |
|
|
|
|
## Demo User
|
|
|
|
| Username | Password |
|
|
| :------: | :----------: |
|
|
| tester1 | aa12345678aa |
|
|
| tester2 | aa12345678aa |
|
|
| tester3 | aa12345678aa |
|
|
| tester4 | aa12345678aa |
|
|
| novote | aa12345678aa |
|
|
|
|
## Project Documents
|
|
|
|
All project documents are in the [Project Wiki](https://github.com/Sosokker/ku-polls/wiki).
|
|
|
|
- [Vision Statement](https://github.com/Sosokker/ku-polls/wiki/Vision-Statement)
|
|
- [Requirements](https://github.com/Sosokker/ku-polls/wiki/Requirements)
|
|
- [Iteration1](https://github.com/Sosokker/ku-polls/wiki/Iteration-1-Plan)
|
|
- [Iteration2](https://github.com/Sosokker/ku-polls/wiki/Iteration-2-Plan)
|
|
- [Iteration3](https://github.com/Sosokker/ku-polls/wiki/Iteration-3-Plan)
|
|
- [Iteration4](https://github.com/Sosokker/ku-polls/wiki/Iteration-4-Plan)
|
|
|
|
[Django-Tutorial](https://docs.djangoproject.com/en/4.2/intro/tutorial01/)
|