Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

[Guide] Viewing the Website Locally

Yutong Huang edited this page Mar 27, 2017 · 4 revisions

After cloning the repository, there are three steps to viewing the website locally.

Configuring Python virtual environment

Create a Python virtual environment and activate it. Then install requirements with

pip install -r requirements.txt

In case some compilation errors related to psycopg2. In Ubuntu, execute following commend: (this project is focused on Python 3.6, thus python3.6-dev is used as example)

sudo apt-get install libpq-dev python3.6-dev

Exporting config vars

Django expects several environment variables on startup. For each required environment variable, execute

export <VAR_NAME>=<value>

The required environment variables are:

Name Value
DJANGO_SECRET_KEY Give this variable a dummy value.
GITHUB_KEY Retrieve this value from GitHub
GITHUB_SECRET Retrieve this value from GitHub
BASICAUTH_USERNAME Give this variable a dummy value. (you will need to enter it when accessing the local site)
BASICAUTH_PASSWORD Give this variable a dummy value. (you will need to enter it when accessing the local site)

It might be helpful to add these to a file that you can run whenever you need to export them to your environment. Just remember not to commit it!

If you want to disable basic authentication for the local site, remove BasicAuthMiddleware from cam2webui/settings.py.

Run the local server

python manage.py runserver

Then open lvh.me:8000 in your browser.

Clone this wiki locally