Skip to content

Commit

Permalink
deps: configure django-cors-header
Browse files Browse the repository at this point in the history
  • Loading branch information
chidimo committed Jul 21, 2019
1 parent e49f5a3 commit ec19b69
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ whitenoise = "==4.1.2"
psycopg2 = "==2.7.7"
dj-database-url = "==0.5.0"
drf-yasg = "==1.16.0"
django-cors-headers = "*"

[dev-packages]
coverage = "==4.0.3"
Expand Down
10 changes: 9 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@

Catholic Orthodoxy in electronic format

## Site
## URLs

<http://chidimo.github.io/Ethodoxy/>
1. Site: <http://chidimo.github.io/Ethodoxy/>
1. API root: <https://ethodoxy.herokuapp.com/api/v1>
1. Swagger documentation: <https://ethodoxy.herokuapp.com/swagger/>

## API

The API root URL is located at <https://ethodoxy.herokuapp.com/api/v1>. The swagger documentation is available at <https://ethodoxy.herokuapp.com/swagger/>.

The following API endpoints have been exposed
## Available endpoints

1. <https://ethodoxy.herokuapp.com/api/v1/versions/>
1. <https://ethodoxy.herokuapp.com/api/v1/books/>
Expand All @@ -37,6 +35,17 @@ It is possible to recreate the database on your local machine as the necessary `
1. Optional. Create superuser with `python manage.py superuser`
1. Optional. Create user with `python manage.py user`
1. Both have the following optional arguments `-email admin@ethodoxy.net -password dwarfstar`
1. Create a `PostgreSQL` database name `ethodoxy-api`.
1. Set up the following environment variables

DEBUG
DJANGO_SETTINGS_MODULE=ethodoxy-api.settings.dev
SECRET_KEY
EMAIL_HOST_PASSWORD
EMAIL_PORT
ALLOWED_HOSTS=localhost
DATABASE_URL
DB_PASSWORD

1. Set up **Douay-Rheims** bible database by running the following commands in order

Expand All @@ -45,12 +54,11 @@ It is possible to recreate the database on your local machine as the necessary `
python manage.py create_nt
python manage.py create_chapters
python manage.py create_verses

1. Set up Challoner commentary by running `python manage.py create_commentary`
python manage.py create_commentary # challoner commentary

## Contributing

I am still working on this project and I haven't quite figured out how to query verses.
I haven't figured it out yet. Feel free to message me at orjichidi95@gmail.com

## Querying

Expand Down
8 changes: 8 additions & 0 deletions ethodoxy-api/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,25 @@
]

THIRD_PARTY_APPS = [
'corsheaders',
'rest_framework',
'django_extensions',
'drf_yasg',
]

CORS_ORIGIN_ALLOW_ALL = True;

CORS_ALLOW_METHODS = [
'GET',
]

INSTALLED_APPS = PREREQ_APPS + PROJECT_APPS + THIRD_PARTY_APPS

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
Expand Down

0 comments on commit ec19b69

Please sign in to comment.