To run this project on localhost
first you need to install PostgreSQL 10.3
then follow the list below :
-
Install PostgreSQL
-
Make sure it works
-
Create a Database using
psql
- Open up
cmd
- Run
psql -U <username> -d postgres
- Run the following command one line at a time:
CREATE USER <username> WITH ENCRYPTED PASSWORD '' CREATEDB; CREATE DATABASE crowdcur_server WITH ENCODING 'UTF-8' OWNER "<username>"; GRANT ALL PRIVILEGES ON DATABASE crowdcur_server TO <username>;
replace
<username>
with your user name!- Go to
crowdcur_server/crowdcur_server/settings.py
and replace :
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/Users/Payam/PycharmProjects/crowdcur_server/db.sqlite3', } }
with :
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'crowdcur_server', 'USER': '<username>', 'HOST': '127.0.0.1', 'PORT': '5432', }, }
be careful about
<username>
- Open up
-
Using
cmd
again, go to the root folder of the project (crowcur_server/
) and run this :pip install -r requirements.txt
make sure everything is installed correctly.
-
run
python manage.py check
everything must be fine.
-
run
python manage.py makemigrations
-
run
python manage.py migrate
-
run
python manage.py runscript -v 2 scripts.workinterface_data_dump