Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unwanted ML files #3

Open
wants to merge 1 commit 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
30 changes: 15 additions & 15 deletions Helpers/share_price_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
django.setup()

from SellBuy.models import Share, SharePrice
from WallStreetML.wallstreet import sharePrice
# from WallStreetML.wallstreet import sharePrice

def share_price_update():
share_obj = Share.objects.all()
for share in share_obj:
# # Changing each share price
# old_share_price = share.current_price
# new_share_price = (old_share_price) * (random.uniform(0.7, 1.3))
# if new_share_price < 1000:
# new_share_price = (new_share_price)*(random.uniform(1.1, 1.3))
# elif new_share_price > random.randint(50000,60000):
# new_share_price = (new_share_price)*(random.uniform(0.7, 0.9))
# new_share_price = round(new_share_price, 2)
# new_share = SharePrice.objects.create(share=share, price=new_share_price)
# new_share.save()
# share.current_price = new_share_price
# share.previous_price = old_share_price
# share.save()
# Changing each share price
old_share_price = share.current_price
new_share_price = sharePrice(share.name, old_share_price)
new_share_price = (old_share_price) * (random.uniform(0.7, 1.3))
if new_share_price < 1000:
new_share_price = (new_share_price)*(random.uniform(1.1, 1.3))
elif new_share_price > random.randint(50000,60000):
new_share_price = (new_share_price)*(random.uniform(0.7, 0.9))
new_share_price = round(new_share_price, 2)
new_share = SharePrice.objects.create(share=share, price=new_share_price)
new_share.save()
share.current_price = new_share_price
share.previous_price = old_share_price
share.save()
# old_share_price = share.current_price
# new_share_price = sharePrice(share.name, old_share_price)
# new_share_price = round(new_share_price, 2)
# new_share = SharePrice.objects.create(share=share, price=new_share_price)
# new_share.save()
# share.current_price = new_share_price
# share.previous_price = old_share_price
# share.save()
print("Share price changed")
return True

Expand Down
6 changes: 4 additions & 2 deletions LoginRegister/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ def register_post(request):
current_user_holding.save()

shares = Share.objects.all()
user_share_quantity_list = []
for share in shares:
user_share_quantity = UserShareQuantity.objects.create(
user_share_quantity = UserShareQuantity(
share=share,
user=user,
quantity=0
)
user_share_quantity.save()
user_share_quantity_list.append(user_share_quantity)
UserShareQuantity.objects.bulk_create(user_share_quantity_list)

response = {
'success' : True,
Expand Down
41 changes: 29 additions & 12 deletions WallStreet18/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

import os
import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -78,17 +78,17 @@
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
# 'default': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'newtest',
# 'USER': 'wallstreet',
# 'PASSWORD': 'wallstreet',
# 'HOST': 'localhost',
# }
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'wallstreet',
'USER': 'wallstreet',
'PASSWORD': 'wallstreet',
'HOST': 'localhost',
}
}


Expand All @@ -110,6 +110,23 @@
},
]

# LOGGING = {
# 'version': 1,
# 'handlers': {
# 'console': {
# 'level': 'DEBUG',
# 'class': 'logging.StreamHandler'
# },
# },
# 'loggers': {
# 'gunicorn.access' : {
# 'level': 'DEBUG',
# 'handlers': ['console'],
# 'propagate':False
# }
# }
# }


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion templates/LoginRegister/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- <link href="https://fonts.googleapis.com/css?family=Fjalla+One|Oswald" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> -->
<link rel="icon" href="/static/images/logo.png">
<title>Login | WallStreet '18</title>
<title>Login | WallStreet '19</title>
<script src="/static/js/validation.js"></script>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
Expand Down
4 changes: 2 additions & 2 deletions templates/LoginRegister/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- <link href="https://fonts.googleapis.com/css?family=Fjalla+One|Oswald" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> -->
<link rel="icon" href="/static/images/logo.png">
<title>Register | WallStreet '18</title>
<title>Register | WallStreet '19</title>
<script src="/static/js/validation.js"></script>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
Expand Down Expand Up @@ -73,7 +73,7 @@
<div id="loader"></div>
<img src="/static/images/logo.png" alt="Logo not available!" id="logows">
<div class="card mx-auto container">
<div class="display-4 text-center mt-5 mb-3"> Wallstreet'18 </div>
<div class="display-4 text-center mt-5 mb-3"> Wallstreet'19 </div>
<p class="text-center"> Register a new account </p>
<div class="form-group mt-4 mr-2 ml-2">
<div class="input-group">
Expand Down
2 changes: 1 addition & 1 deletion templates/SellBuy/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet"> -->
<link rel="icon" href="/static/images/logo.png">
<title>Dashboard | WallStreet '18</title>
<title>Dashboard | WallStreet '19</title>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/css/dashboard.css">
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet"> -->
<link rel="icon" href="/static/images/logo.png">
<title>Wallstreet '18</title>
<title>Wallstreet '19</title>
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/css/homepage.css">
Expand Down