Commit 0e466c2b authored by Daniel W Bond's avatar Daniel W Bond

configurations (for dev and deployment) and their docs

parent ec8bb2e2
......@@ -36,20 +36,33 @@ Open a terminal window and type in the following commands. (If you're on Windows
To set up the PostgreSQL database, open a terminal and type in the following commands:
``First, we must install some dependencies for PostgreSQL.``
First, we must install some dependencies for PostgreSQL.
``$ sudo apt-get install libpq-dev python-dev``
``Next, we need to install PostgreSQL.``
Next, we need to install PostgreSQL.
``$ sudo apt-get install postgresql postgresql-contrib``
``Now, we need to become the postgres user, create our database, and create our user.``
Now, we need to become the postgres user, create our database, and create our user.
``$ sudo su - postgres``
``$ createdb roomlist``
``$ createuser -P``
``Now follow the prompts, the username should be "django" (without the qoutes) and the password should be "H0jrp0llTJ" (without the qoutes). Next enter 'n' and press "Enter" for the following three promts.``
``Finally, we need to enter the PostgreSQL command line interface to grant permissions.``
Choose your username, and execute the next command without the quotes.
``$ createuser -P "your_username"``
You'll then be prompted to twice enter your password. Choose a strong passphrase for production. For local development, password strength is less important.
Finally, we need to enter the PostgreSQL command line interface to grant permissions.
``$ psql``
``postgres=# GRANT ALL PRIVILEGES ON DATABASE roomlist TO django;``
Your PostgreSQL database should now be set up to work with the Roomlist project.
Copy the secret.py.template and config.py.template to secret.py and config.py respectively. For each, follow the comment instruction provided in each file.
Next, run `python manage.py migrate`, then `python manage.py runserver`.
Have your virtualenvironment running and with the requirements.txt installed.
......
# installation configurations
# copy to config.py
# These configurations are set by default for a local development environment. Turning off debug mode will display 404 and 500 error pages instead of detailed logs.
# Don't run with debug turned on in production!!!
DEBUG = True
TEMPLATE_DEBUG = True
# the domains this application will be deployed on, e.g. which
# domains this app should listen to requests from.
ALLOWED_HOSTS = ['127.0.0.1']
# secret settings
# copy to secret.py
# used for django's cryptographic signing, 50 characters long
# you can generate one here http://www.miniwebtool.com/django-secret-key-generator/
SECRET_KEY = ''
# These configurations are partially set by default for a local development environment. Remember to use a strong passphrase for deployment. Use the username and password you configured creating the database while following the README. Change the database name, host, or port as necessary for deployment.
DB_NAME = 'roomlist'
DB_USER = ''
DB_PASSWORD = ''
DB_HOST = 'localhost'
# often left blank
DB_PORT = ''
......@@ -46,16 +46,10 @@ TEMPLATE_CONTEXT_PROCESSORS = (
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'fGTL0pyk8MRq9YLXIOzFKZlneTdg3etdRxXs1FN2FqlVk595Ix'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
import config
DEBUG = config.DEBUG
TEMPLATE_DEBUG = config.TEMPLATE_DEBUG
ALLOWED_HOSTS = config.ALLOWED_HOSTS
# Application definition
......@@ -96,18 +90,20 @@ ROOT_URLCONF = 'settings.urls'
WSGI_APPLICATION = 'settings.wsgi.application'
import secret
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
SECRET_KEY = secret.SECRET_KEY
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'roomlist',
'USER': 'django',
'PASSWORD': 'H0jrp0llTJ',
'HOST': 'localhost',
'PORT': '',
'NAME': secret.DB_NAME,
'USER': secret.DB_USER,
'PASSWORD': secret.DB_PASSWORD,
'HOST': secret.DB_HOST,
'PORT': secret.DB_PORT,
}
}
......@@ -116,7 +112,7 @@ DATABASES = {
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
TIME_ZONE = 'America/New_York'
USE_I18N = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment