Skip to content

Commit

Permalink
Merge 0d98c92 into b659599
Browse files Browse the repository at this point in the history
  • Loading branch information
salma-nyagaka committed Nov 28, 2018
2 parents b659599 + 0d98c92 commit 1652180
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ install:
global:
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)

before_script:
- createdb authorshaven

script:
- ./manage.py makemigrations
- ./manage.py migrate
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
![license](https://img.shields.io/github/license/mashape/apistatus.svg)
[![Build Status](https://travis-ci.org/andela/ah-technocrats.svg?branch=ch-travis-integration-161966599)](https://travis-ci.org/andela/ah-technocrats.svg?branch=ch-travis-integration-161966599)

[![Build Status](https://travis-ci.org/andela/ah-technocrats.svg?branch=develop)](https://travis-ci.org/andela/ah-technocrats)

## Authors Haven
A Social platform for the creative at heart.



Authors Haven - A Social platform for the creative at heart.

## Vision
Create a community of like minded authors to foster inspiration and innovation
by leveraging the modern web.
Expand Down
20 changes: 20 additions & 0 deletions authors/apps/authentication/migrations/0002_blacklistedtoken.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 2.1 on 2018-11-27 10:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('authentication', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='BlacklistedToken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('token', models.CharField(max_length=255)),
],
),
]
17 changes: 17 additions & 0 deletions authors/apps/authentication/migrations/0003_auto_20181127_1102.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.1 on 2018-11-27 11:02

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('authentication', '0002_blacklistedtoken'),
]

operations = [
migrations.AlterModelTable(
name='user',
table='users',
),
]
17 changes: 17 additions & 0 deletions authors/apps/authentication/migrations/0004_auto_20181127_1103.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.1 on 2018-11-27 11:03

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('authentication', '0003_auto_20181127_1102'),
]

operations = [
migrations.AlterModelTable(
name='blacklistedtoken',
table='blacklist',
),
]
8 changes: 8 additions & 0 deletions authors/apps/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ def get_short_name(self):
"""
return self.username

class Meta:
db_table = "users"


class BlacklistedToken(models.Model):
token = models.CharField(max_length=255, null=False)

class Meta:
db_table = "blacklist"
class BlacklistedToken(models.Model):
token = models.CharField(max_length=255, null=False)
8 changes: 6 additions & 2 deletions authors/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv("DB_NAME", 'authorshaven'),
'HOST': os.getenv("DB_HOST", 'localhost'),
'PASSWORD': os.getenv('DB_PASSWORD', '123'),
'USER': os.getenv('DB_USER', 'postgres'),
'PORT': os.getenv('DB_PORT', '5432')
}
}

Expand Down
25 changes: 25 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
certifi==2018.10.15
chardet==3.0.4
coreapi==2.3.3
coreschema==0.0.4
Django==2.1
django-cors-headers==2.4.0
django-cors-middleware==1.3.1
django-extensions==2.1.4
django-rest-swagger==2.2.0
djangorestframework==3.9.0
djangorestframework-jwt==1.11.0
idna==2.7
itypes==1.1.0
Jinja2==2.10
MarkupSafe==1.1.0
openapi-codec==1.3.2
psycopg2==2.7.6.1
psycopg2-binary==2.7.6.1
PyJWT==1.6.4
pytz==2018.7
requests==2.20.1
simplejson==3.16.0
six==1.11.0
uritemplate==3.0.0
urllib3==1.24.1
Django==2.1
django-cors-middleware==1.3.1
django-extensions==2.1.4
Expand Down

0 comments on commit 1652180

Please sign in to comment.