Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
64 additions
and 0 deletions.
- +4 −0 coincharts/admin.py
- +24 −0 coincharts/models.py
- +19 −0 coincharts/settings.py
- +7 −0 coincharts/urls.py
- +10 −0 coincharts/views.py
@@ -0,0 +1,4 @@ | ||
from django.contrib import admin | ||
from .models import Prices | ||
|
||
admin.site.register(Prices) |
@@ -0,0 +1,24 @@ | ||
|
||
from django.db import models | ||
|
||
class Prices(models.Model): | ||
|
||
symbol_id = models.CharField(max_length=100) | ||
time_period_start = models.CharField(max_length=100) | ||
time_period_end = models.CharField(max_length=100) | ||
time_open = models.CharField(max_length=100) | ||
time_close = models.CharField(max_length=100) | ||
price_open = models.FloatField() | ||
price_high = models.FloatField() | ||
price_low = models.FloatField() | ||
price_close = models.FloatField() | ||
volume_traded = models.FloatField() | ||
trades_count = models.IntegerField() | ||
|
||
def __str__(self): | ||
class_name = self.__class__.__name__ | ||
return '<{}({}@{})>'.format( | ||
class_name, | ||
getattr(self, TIME), | ||
getattr(self, PRICE) | ||
) |
@@ -0,0 +1,19 @@ | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
DEBUG = True | ||
INSTALLED_APPS = [ | ||
'coincharts', | ||
] | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | ||
} | ||
} | ||
LANGUAGE_CODE = 'en-us' | ||
TIME_ZONE = 'UTC' | ||
USE_I18N = True | ||
USE_L10N = True | ||
USE_TZ = True |
@@ -0,0 +1,7 @@ | ||
|
||
from django.urls import path | ||
from . import views | ||
|
||
urlpatterns = [ | ||
path('', views.index, name='index'), | ||
] |
@@ -0,0 +1,10 @@ | ||
from django.shortcuts import render | ||
|
||
from django.shortcuts import get_object_or_404, render | ||
from django.http import HttpResponseRedirect | ||
#from .models import Page, Content | ||
|
||
def page(request, current_page_name): | ||
context = { | ||
} | ||
return render(request, 'main/index.html', context) |