Changeset - 76733b05472a
[Not reviewed]
0 2 0
Josh Simmons - 6 years ago 2018-07-05 19:16:55
joshuasimmons@google.com
update readme and add 127.0.0.1 to allowed hosts
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
 
North Bay Python
 
=================
 

	
 
The website for North Bay Python is a Django application with Symposion and Registrasion.
 

	
 
Setup
 
-----
 

	
 
Development
 
~~~~~~~~~~~
 
1. pip install -r requirements/base.txt
 
2. python manage.py createsuperuser
 
3. python manage.py loaddata fixtures/*
 
4. python manage.py migrate
 
2. python manage.py migrate
 
3. python manage.py createsuperuser
 
4. python manage.py loaddata fixtures/*
 
5. python manage.py runserver
 

	
 
Prod
 
~~~~
 
Use `pip install -r requirements.txt` instead.
 

	
 
Reference Material
 
------------------
 

	
 
* Registrasion docs are at http://registrasion.readthedocs.io
 
* Symposion docs are at http://symposion.readthedocs.io
pinaxcon/settings.py
Show inline comments
 
import os
 
import dj_database_url
 

	
 

	
 
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
 
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
 
BASE_DIR = PACKAGE_ROOT
 

	
 
DEBUG = bool(int(os.environ.get("DEBUG", "1")))
 

	
 
DATABASES = {
 
    "default": {
 
        "ENGINE": "django.db.backends.sqlite3",
 
        "NAME": os.path.join(PROJECT_ROOT, "dev.db"),
 
    }
 
}
 

	
 
UNPREPEND_WWW = bool(int(os.environ.get("DJANGO_UNPREPEND_WWW", "0")))
 

	
 
# HEROKU: Update database configuration with $DATABASE_URL.
 
import dj_database_url
 
db_from_env = dj_database_url.config()
 
DATABASES['default'].update(db_from_env)
 

	
 
ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org"]
 
ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org", "127.0.0.1"]
 
CANONICAL_HOST = os.environ.get("DJANGO_CANONICAL_HOST", None)
 

	
 
# If DEFAULT_FROM_EMAIL is not set, email will most likely break in prod.
 
from_email = os.environ.get("DJANGO_DEFAULT_FROM_EMAIL", None)
 
if from_email is not None:
 
    DEFAULT_FROM_EMAIL = from_email
 
    SERVER_EMAIL = DEFAULT_FROM_EMAIL
 
    
 
THEME_CONTACT_EMAIL = os.environ.get("THEME_CONTACT_EMAIL", None)
 
    
 

	
 
# Local time zone for this installation. Choices can be found here:
 
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
 
# although not all choices may be available on all operating systems.
 
# On Unix systems, a value of None will cause Django to use the same
 
# timezone as the operating system.
 
# If running in a Windows environment this must be set to the same as your
 
# system time zone.
 
TIME_ZONE = os.environ.get("TZ", "America/Los_Angeles")
 

	
 

	
 
# Set the email address that will receive errors.
 
admin_email = os.environ.get("DJANGO_ADMIN_EMAIL", None)
 
if admin_email is not None:
0 comments (0 inline, 0 general)