Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
114d793
(MVP) : Setup the virtual environment, started the django app, done i…
decagondev Dec 3, 2018
18ba21d
(MVP DAY 1) : wrote the initial notes class in the notes model file
decagondev Dec 3, 2018
f250cca
(MVP DAY1) : added the notes app config to the project config file
decagondev Dec 3, 2018
acc64dd
(MVP DAY1) : migrated the notes table / model
decagondev Dec 3, 2018
6ea3524
(MVP DAY 1) : added a str method to my notes class for a bit of debug…
decagondev Dec 3, 2018
72ae9f1
(MVP DAY 1) : installed decouple, moved the key and debug variables t…
decagondev Dec 3, 2018
59b5c8d
(MVP DAY 1) : completed day 1
decagondev Dec 3, 2018
01462be
(MVP DAY 2) added created_at , last_modified fileds to the Note model…
decagondev Dec 3, 2018
76022f7
(MVP DAY 2) : added the PersonalNote subclass to the models file
decagondev Dec 3, 2018
ad705a7
(MVP DAY 2) : MVP day 2 completed
decagondev Dec 3, 2018
408b0eb
(MVP DAY 3) : installed rest framework and added it to the projects a…
decagondev Dec 3, 2018
c399d39
(MVP DAY 3) : created an api.py file and added a serializer class. a …
decagondev Dec 3, 2018
9388398
(MVP DAY 3) : tested the api get method and wrote and tested the crea…
decagondev Dec 3, 2018
b0c7508
(MVP DAY 3) : added cors to django and set it to allow all origins : …
decagondev Dec 3, 2018
c23785e
(MVP DAY 4) : set up token authentication
decagondev Dec 3, 2018
e547265
(MVP DAY 4) : Set up auth routes
decagondev Dec 3, 2018
da4e831
(MVP DAY 4) : done for now done the mvp of day 1, 2, 3, 4 on day 1 as…
decagondev Dec 3, 2018
76418e7
(STRETCHING) : creating a polls app
decagondev Dec 4, 2018
c392bf7
(STRETCHING) : added urls.py and initial index path to the polls app
decagondev Dec 4, 2018
1c567f9
(STRETCHING) : added the url patterns for the polls app
decagondev Dec 4, 2018
9a20bac
(STRETCHING) : adding ___str___ methods to the models in the polls app
decagondev Dec 4, 2018
03007a7
(STRETCHING) : added was_published_recently method to the Question class
decagondev Dec 4, 2018
573d6b3
(STRETCHING) registered Question and Choice tables in the admin inter…
decagondev Dec 4, 2018
1379cef
(STRETCHING) DAY 2 : added templates to the polls app for index view
decagondev Dec 4, 2018
16df015
(POLLS APP) : refactored index view
decagondev Dec 4, 2018
c63e633
(POLLS APP) : re added detail view with template
decagondev Dec 4, 2018
0d36adc
(POLLS APP) : refactored the details teplate
decagondev Dec 4, 2018
8bf767b
(POLLS APP) : refacoted the index template to be more universal using…
decagondev Dec 4, 2018
b1c4e57
(POLLS APP) : added namespace polls to the polls application
decagondev Dec 4, 2018
2e35792
(POLLS APP) : added a simple form to the retail template
decagondev Dec 4, 2018
93c0185
(POLLS APP) : added results view
decagondev Dec 4, 2018
524420e
(POLLS APP) : added template for results view
decagondev Dec 4, 2018
f47646a
(POLLS API) added RESTful GET and POST to the Questions
decagondev Dec 4, 2018
3fdc895
{POLLS APP FRONT END) : got the votes button functioning and the vote…
decagondev Dec 4, 2018
9c3e725
(POLLS APP STYLES) : added a static css to the templates TODO: style …
decagondev Dec 4, 2018
7100d8d
(POLL APP STYLES) : added some styles to the details and results page…
decagondev Dec 4, 2018
47c971c
(POLL APP STYLES) styled button and text in the details template
decagondev Dec 4, 2018
ad60123
(HEROKU DEPLOY) : started setting up for deployment
decagondev Dec 5, 2018
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
18 changes: 18 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
django = "*"
python-decouple = "*"
djangorestframework = "*"
django-cors-headers = "*"
gunicorn = "*"
psycopg2-binary = "*"
whitenoise = "*"

[requires]
python_version = "3.7"
111 changes: 111 additions & 0 deletions Pipfile.lock

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

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn djorg.wsgi --log-file -
Empty file added djorg/__init__.py
Empty file.
142 changes: 142 additions & 0 deletions djorg/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
"""
Django settings for djorg project.

Generated by 'django-admin startproject' using Django 2.1.4.

For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
# day 1 completeed MVP
import os
from decouple import config

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', cast=bool)

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
'notes.apps.NotesConfig',
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'corsheaders',
]


MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]

REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
],
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
}

ROOT_URLCONF = 'djorg.urls'
CORS_ORIGIN_ALLOW_ALL = True

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'djorg.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.1/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/2.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/2.1/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/2.1/howto/static-files/

STATIC_URL = '/static/'
33 changes: 33 additions & 0 deletions djorg/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""djorg URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
# day 4 mvp completed will work on stretch tomorrow
from django.contrib import admin
from django.urls import path, include, re_path
from rest_framework.authtoken import views
from rest_framework import routers
from notes.api import PersonalNoteViewSet
from polls.api import QuestionViewSet

router = routers.DefaultRouter()
router.register(r'notes', PersonalNoteViewSet)
router.register(r'questions', QuestionViewSet)

urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
path('api/', include(router.urls)),
re_path(r'^api-token-auth/', views.obtain_auth_token),
]
16 changes: 16 additions & 0 deletions djorg/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for djorg project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djorg.settings')

application = get_wsgi_application()
15 changes: 15 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python
import os
import sys

if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djorg.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
23 changes: 23 additions & 0 deletions noteclient/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading