Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Resize field #39

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Django CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
env:
SECRET_KEY: secret
DATABASE_URL: sqlite:////tmp/tmp.db
run: |
python manage.py test
2 changes: 1 addition & 1 deletion conduit/apps/articles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Article(TimestampedModel):
slug = models.SlugField(db_index=True, max_length=255, unique=True)
title = models.CharField(db_index=True, max_length=255)
title = models.CharField(db_index=True, max_length=300)

description = models.TextField()
body = models.TextField()
Expand Down
11 changes: 11 additions & 0 deletions conduit/apps/core/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.apps import apps
from django.contrib import admin


models = apps.get_models()

for model in models:
try:
admin.site.register(model)
except admin.sites.AlreadyRegistered:
pass
53 changes: 28 additions & 25 deletions conduit/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,41 @@
https://docs.djangoproject.com/en/1.10/ref/settings/
"""

import environ
import os
import sentry_sdk

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
from sentry_sdk.integrations.django import DjangoIntegration


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '2^f+3@v7$v1f8yt0!s)3-1t$)tlp+xm17=*g))_xoi&&9m#2a&'
# config using django-environ
env = environ.Env(
DEBUG=(bool, False)
)
environ.Env.read_env()

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = env('DEBUG')
SECRET_KEY = env('SECRET_KEY')
DATABASES = {
'default': env.db(),
}

ALLOWED_HOSTS = []
# sentry for app monitoring
if env('SENTRY_URL', default=False):
sentry_sdk.init(
dsn=env('SENTRY_URL'),
integrations=[DjangoIntegration()],
send_default_pii=True
)

#CACHES = {
# 'default': env.cache(),
#}

# Application definition
ALLOWED_HOSTS = ['*']

INSTALLED_APPS = [
'django.contrib.admin',
Expand Down Expand Up @@ -80,17 +96,6 @@
WSGI_APPLICATION = 'conduit.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}


# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators

Expand All @@ -114,20 +119,18 @@
# https://docs.djangoproject.com/en/1.10/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')


CORS_ORIGIN_WHITELIST = (
'0.0.0.0:4000',
Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ django-extensions==1.7.1
djangorestframework==3.4.4
PyJWT==1.4.2
six==1.10.0
gunicorn==20.0.4
django-environ==0.4.5
psycopg2-binary==2.8.4
sentry-sdk==0.14.2
newrelic==5.10.0.138