├── .gitignore ├── _config.yml ├── companies ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-35.pyc │ ├── __init__.cpython-36.pyc │ ├── admin.cpython-35.pyc │ ├── admin.cpython-36.pyc │ ├── apps.cpython-35.pyc │ ├── apps.cpython-36.pyc │ ├── models.cpython-35.pyc │ ├── models.cpython-36.pyc │ ├── serializers.cpython-35.pyc │ ├── serializers.cpython-36.pyc │ ├── views.cpython-35.pyc │ └── views.cpython-36.pyc ├── admin.py ├── apps.py ├── migrations │ ├── 0001_initial.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-35.pyc │ │ ├── 0001_initial.cpython-36.pyc │ │ ├── __init__.cpython-35.pyc │ │ └── __init__.cpython-36.pyc ├── models.py ├── serializers.py ├── tests.py └── views.py ├── db.sqlite3 ├── manage.py └── website2 ├── __init__.py ├── __pycache__ ├── __init__.cpython-35.pyc ├── __init__.cpython-36.pyc ├── settings.cpython-35.pyc ├── settings.cpython-36.pyc ├── urls.cpython-35.pyc ├── urls.cpython-36.pyc ├── wsgi.cpython-35.pyc └── wsgi.cpython-36.pyc ├── settings.py ├── urls.py └── wsgi.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | .idea/ 3 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-modernist -------------------------------------------------------------------------------- /companies/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__init__.py -------------------------------------------------------------------------------- /companies/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /companies/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /companies/__pycache__/admin.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/admin.cpython-35.pyc -------------------------------------------------------------------------------- /companies/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /companies/__pycache__/apps.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/apps.cpython-35.pyc -------------------------------------------------------------------------------- /companies/__pycache__/apps.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/apps.cpython-36.pyc -------------------------------------------------------------------------------- /companies/__pycache__/models.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/models.cpython-35.pyc -------------------------------------------------------------------------------- /companies/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /companies/__pycache__/serializers.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/serializers.cpython-35.pyc -------------------------------------------------------------------------------- /companies/__pycache__/serializers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/serializers.cpython-36.pyc -------------------------------------------------------------------------------- /companies/__pycache__/views.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/views.cpython-35.pyc -------------------------------------------------------------------------------- /companies/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /companies/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Stock 3 | 4 | admin.site.register(Stock) 5 | -------------------------------------------------------------------------------- /companies/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CompaniesConfig(AppConfig): 5 | name = 'companies' 6 | -------------------------------------------------------------------------------- /companies/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9 on 2018-07-29 04:26 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Stock', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('ticker', models.CharField(max_length=10)), 21 | ('open', models.FloatField()), 22 | ('close', models.FloatField()), 23 | ('volume', models.IntegerField()), 24 | ], 25 | ), 26 | ] 27 | -------------------------------------------------------------------------------- /companies/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/migrations/__init__.py -------------------------------------------------------------------------------- /companies/migrations/__pycache__/0001_initial.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/migrations/__pycache__/0001_initial.cpython-35.pyc -------------------------------------------------------------------------------- /companies/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /companies/migrations/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/migrations/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /companies/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/companies/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /companies/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class Stock(models.Model): 5 | ticker = models.CharField(max_length=10) 6 | open = models.FloatField() 7 | close = models.FloatField() 8 | volume = models.IntegerField() 9 | 10 | def __str__(self): 11 | return self.ticker 12 | -------------------------------------------------------------------------------- /companies/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import Stock 3 | 4 | 5 | class StockSerializer(serializers.ModelSerializer): 6 | class Meta: 7 | model = Stock 8 | fields = '__all__' 9 | -------------------------------------------------------------------------------- /companies/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /companies/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import get_object_or_404 2 | from rest_framework.views import APIView 3 | from rest_framework.response import Response 4 | from rest_framework import status 5 | from .models import Stock 6 | from .serializers import StockSerializer 7 | 8 | 9 | class StockList(APIView): 10 | 11 | def get(self, request): 12 | stocks = Stock.objects.all() 13 | serializer = StockSerializer(stocks, many=True) 14 | return Response(serializer.data) 15 | 16 | def post(self): 17 | pass 18 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/db.sqlite3 -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website2.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /website2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__init__.py -------------------------------------------------------------------------------- /website2/__pycache__/__init__.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/__init__.cpython-35.pyc -------------------------------------------------------------------------------- /website2/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /website2/__pycache__/settings.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/settings.cpython-35.pyc -------------------------------------------------------------------------------- /website2/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /website2/__pycache__/urls.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/urls.cpython-35.pyc -------------------------------------------------------------------------------- /website2/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /website2/__pycache__/wsgi.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/wsgi.cpython-35.pyc -------------------------------------------------------------------------------- /website2/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kerolloz/API-django-bucky/8652449855973590147400db71286f245cacddbd/website2/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /website2/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for website2 project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.9. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.9/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'qs2p^+45mh+q(s(nq5w2v1u&89+*p1zpf_b7^+lqf#i@k01q)r' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'rest_framework', 41 | 'companies.apps.CompaniesConfig', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | # 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 51 | 'django.contrib.messages.middleware.MessageMiddleware', 52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 53 | ] 54 | 55 | ROOT_URLCONF = 'website2.urls' 56 | 57 | TEMPLATES = [ 58 | { 59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 60 | 'DIRS': [], 61 | 'APP_DIRS': True, 62 | 'OPTIONS': { 63 | 'context_processors': [ 64 | 'django.template.context_processors.debug', 65 | 'django.template.context_processors.request', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'website2.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/1.9/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.sqlite3', 82 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 83 | } 84 | } 85 | 86 | 87 | # Password validation 88 | # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators 89 | 90 | AUTH_PASSWORD_VALIDATORS = [ 91 | { 92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 93 | }, 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 102 | }, 103 | ] 104 | 105 | 106 | # Internationalization 107 | # https://docs.djangoproject.com/en/1.9/topics/i18n/ 108 | 109 | LANGUAGE_CODE = 'en-us' 110 | 111 | TIME_ZONE = 'UTC' 112 | 113 | USE_I18N = True 114 | 115 | USE_L10N = True 116 | 117 | USE_TZ = True 118 | 119 | 120 | # Static files (CSS, JavaScript, Images) 121 | # https://docs.djangoproject.com/en/1.9/howto/static-files/ 122 | 123 | STATIC_URL = '/static/' 124 | -------------------------------------------------------------------------------- /website2/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | from django.contrib import admin 3 | from rest_framework.urlpatterns import format_suffix_patterns 4 | from companies import views 5 | 6 | urlpatterns = [ 7 | url(r'^admin/', admin.site.urls), 8 | url(r'^stocks/', views.StockList.as_view()) 9 | ] 10 | 11 | urlpatterns = format_suffix_patterns(urlpatterns) -------------------------------------------------------------------------------- /website2/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for website2 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website2.settings") 15 | 16 | application = get_wsgi_application() 17 | --------------------------------------------------------------------------------