Web application from the Django Tutorial project where users can vote on polls.
This project requires:
- Python 3.6 or newer
- other Python modules as in requirements.txt
- Clone this repository to your local machine.
- Use your shell, set the directory where "
requirements.txt
" is located. Run the following command:pip install -r requirements.txt
- Set the directory to "
\django-polls\mysite\
". First, you need to create the database in your local machine. Run the following command:python manage.py migrate
After you completed setting up on the first run, you will unable to manage this site. So let's setup for the admin account.
- Open the shell in "
\django-polls\mysite\
" - Run the following command:
python manage.py createsuperuser
- Enter your desired username and press enter.
Username: admin
- You will then be prompted for your desired email address:
Email address: admin@example.com
- The final step is to enter your password. You will be asked to enter your password twice, the second time as a confirmation of the first.
Password: ********** Password (again): ********* Superuser created successfully.
The Django admin site is activated by default. Let’s start the development server and explore it.
If the server is not running start it like so:
python manage.py runserver
Now, open a Web browser and go to “/admin/” on your local domain – e.g., http://127.0.0.1:8000/admin/. You should see the admin’s login screen:
This project have two sites
-
/polls
This site can vote any questions and view the results.
-
/admin
Can manage everything, such as, question, answer, time posted, result value, users, admin password.
Vichyawat Nakarugsa
Department of Computer Engineering
Kasetsart University