- The project runs on Python 3.10.
Apart from cloning this project, you also need the following -
Make sure you get both the PostgreSQL server, and the Postgres Admin. The default installation comes with both.
Clone the repository.
git clone https://github.com/imraan024/survey-application.git
Create and activate a virtual environment for the project.
For creating virtual environment we can use packages like Virtualenv or Pyenv. I've used Virtualenv.
cd survey-application
virtualenv venv
source venv/bin/activate
Install all required packages.
pip install -r requirements.txt
Open .env.keep
file and update these values.
# Comma separated hosts or IPs, set * to allow all
ALLOWED_HOSTS=127.0.0.1
DEBUG=True
# Secret key should be atleast 32 characters long and consists of alphanumeric and special characters
SECRET_KEY=****
#Create a database on postgres and update DB_URL according to your credentials
DB_URL=postgres://USER:PASSWORD@HOST:PORT/NAME
If you do any update on models run this command
python manage.py makemigrations
Run migrations to apply changes on database
python manage.py migrate
Create a super user
python manage.py createsuperuser
Run the project.
python manage.py runserver
- After running project you need to log in using your super user credentials.
- You can sign up new user or add new user from default django admin dashboard.
- To make new user active you should have set user type as
Customer
and check theis_active
field otherwise you can not log in using new users credentials. - For New user creation you need to follow instruction 2 & 3 everytime.
- You can make new survey and add question to them from admin panel after log in as
Admin
- You can participate on surveys from customer panel after log in as a
Customer