/community-project

Web application for viewing all upcoming events in the Carleton CS community

Primary LanguagePython

Community Project

Backend Setup

Docker Setup

Everything in this application is preconfigured to use host names from our docker-compose.yml.

docker-compose up

Non-Docker Setup

Do the following setup in the api directory.

1. Create virtual environment

virtualenv venv -p python3

2. Activate virtual environment

source venv/bin/activate

You will also need to know how to deactivate your virtual environment later, which can be done by running the following:

deactivate

3. Install Python dependencies

Option 1:

pip install -r requirements.txt

If Option 1 does not run currectly try the following:

pip3 install -r requirements.txt

4. Update your Database configuration

Currently this application uses a postgres database, but for local development if may be quicker for you to use SQLite.

Open api/settings.py

If you would like to use SQLite, uncomment the SQLite config. If you would like to use postgres, enter your postgres information.

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    }
}

# DATABASES = {
#    'default': {
#        'ENGINE': 'django.db.backends.postgresql',
#        'NAME': 'db',
#        'USER': 'postgres',
#        'PASSWORD': '1234',
#        'HOST': 'db',
#        'PORT': 5432,
#    }
# }

5. Migrate Database

python manage.py migrate

6. Start Django server

python manage.py runserver 0.0.0.0:8000