Permalink
Browse files

minimal django website stufff

  • Loading branch information...
stnbu committed Sep 2, 2018
1 parent 8bc5912 commit cc4a13d33271d124e9258fb95ce167e104ab6741
Showing with 64 additions and 0 deletions.
  1. +4 −0 coincharts/admin.py
  2. +24 −0 coincharts/models.py
  3. +19 −0 coincharts/settings.py
  4. +7 −0 coincharts/urls.py
  5. +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)

0 comments on commit cc4a13d

Please sign in to comment.