amay22 / pyfolio Goto Github PK
View Code? Open in Web Editor NEWStock Portfolio with trading Simulation. Python Django Framework
Stock Portfolio with trading Simulation. Python Django Framework
Although ADRs maybe listed on NYSE, they are currently not supported in PyFolio. We will include them in next phase of update.
Occurs when selecting a stock. I have found that adding the argument on_delete=models.CASCADE to the proper variables in models.py to fix this in other django projects.
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/portfolio
Django Version: 1.8.4
Python Version: 3.5.2
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'LoginFolio',
'StockFolio',
'compressor',
'django.contrib.humanize']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "C:\Users\matt\Desktop\Prog\PyFolio\env\lib\site-packages\django\core\handlers\base.py" in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\matt\Desktop\Prog\PyFolio\env\lib\site-packages\django\contrib\auth\decorators.py" in _wrapped_view
22. return view_func(request, *args, **kwargs)
File "C:\Users\matt\Desktop\Prog\PyFolio\StockFolio\views.py" in portfolio
30. return render(request, 'StockFolio/portfolio.html', {'stock':get_current_info([''+symbol]), 'news' : get_news_feed(symbol), 'portfolio' : porfolio, 'portfolio_rows' : plot(user_id), 'symbols' : json.dumps(STOCK_SYMBOLS), 'money' : money})
File "C:\Users\matt\Desktop\Prog\PyFolio\lib\yahoo_stock_scraper\stockretriever.py" in get_current_info
65. return __validate_response(response, 'quote')
File "C:\Users\matt\Desktop\Prog\PyFolio\lib\yahoo_stock_scraper\stockretriever.py" in __validate_response
47. if __is_valid_response(response, tagToCheck):
File "C:\Users\matt\Desktop\Prog\PyFolio\lib\yahoo_stock_scraper\stockretriever.py" in __is_valid_response
43. and field in response['query']['results']
Exception Type: TypeError at /portfolio
Exception Value: argument of type 'NoneType' is not iterable
I suspect this is a bug within Python 3.6, will try downgrading to see if it fixes the problem.
--
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.8.4
Python Version: 3.6.4
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'LoginFolio',
'StockFolio',
'compressor',
'django.contrib.humanize']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\handlers\base.py" in get_response
119. resolver_match = resolver.resolve(request.path_info)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\urlresolvers.py" in resolve
366. for pattern in self.url_patterns:
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\urlresolvers.py" in url_patterns
402. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\django\core\urlresolvers.py" in urlconf_module
396. self.urlconf_module = import_module(self.urlconf_name)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\importlib_init.py" in import_module
126. return _bootstrap.gcd_import(name[level:], package, level)
File "C:\Users\matt\Desktop\Prog\PyFolio\PyFolio\urls.py" in
19. from StockFolio import urls as StockFolio_urls
File "C:\Users\matt\Desktop\Prog\PyFolio\StockFolio\urls.py" in
3. from . import views as StockFolio_views
File "C:\Users\matt\Desktop\Prog\PyFolio\StockFolio\views.py" in
8. import xlwt
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt_init.py" in
4. from .Worksheet import Worksheet
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\Worksheet.py" in
38. from .Row import Row
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\Row.py" in
7. from . import ExcelFormula
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\ExcelFormula.py" in
3. from . import ExcelFormulaParser, ExcelFormulaLexer
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\site-packages\xlwt\ExcelFormulaLexer.py" in
53. VERBOSE+LOCALE+IGNORECASE)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\re.py" in compile
233. return _compile(pattern, flags)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\re.py" in _compile
301. p = sre_compile.compile(pattern, flags)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\sre_compile.py" in compile
562. p = sre_parse.parse(p, flags)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\sre_parse.py" in parse
865. p.pattern.flags = fix_flags(str, p.pattern.flags)
File "C:\Users\matt\AppData\Local\Programs\Python\Python36\lib\sre_parse.py" in fix_flags
832. raise ValueError("cannot use LOCALE flag with a str pattern")
Exception Type: ValueError at /
Exception Value: cannot use LOCALE flag with a str pattern
After starting the server with python manage.py runserver
I try to open the website by using http://127.0.0.1:8000/
However, I then get the following errors:
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.8.4
Python Version: 3.6.3
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'LoginFolio',
'StockFolio',
'compressor',
'django.contrib.humanize']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\handlers\base.py" in get_response
119. resolver_match = resolver.resolve(request.path_info)
File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\urlresolvers.py" in resolve
366. for pattern in self.url_patterns:
File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\urlresolvers.py" in url_patterns
402. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\ProgramData\Anaconda3\lib\site-packages\django\core\urlresolvers.py" in urlconf_module
396. self._urlconf_module = import_module(self.urlconf_name)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py" in import_module
126. return _bootstrap._gcd_import(name[level:], package, level)
File "C:\ProgramData\Anaconda3\Lib\site-packages\PyFolio\PyFolio\urls.py" in <module>
19. from StockFolio import urls as StockFolio_urls
File "C:\ProgramData\Anaconda3\Lib\site-packages\PyFolio\StockFolio\urls.py" in <module>
3. from . import views as StockFolio_views
File "C:\ProgramData\Anaconda3\Lib\site-packages\PyFolio\StockFolio\views.py" in <module>
8. import xlwt
File "C:\ProgramData\Anaconda3\lib\site-packages\xlwt\__init__.py" in <module>
4. from .Worksheet import Worksheet
File "C:\ProgramData\Anaconda3\lib\site-packages\xlwt\Worksheet.py" in <module>
38. from .Row import Row
File "C:\ProgramData\Anaconda3\lib\site-packages\xlwt\Row.py" in <module>
7. from . import ExcelFormula
File "C:\ProgramData\Anaconda3\lib\site-packages\xlwt\ExcelFormula.py" in <module>
3. from . import ExcelFormulaParser, ExcelFormulaLexer
File "C:\ProgramData\Anaconda3\lib\site-packages\xlwt\ExcelFormulaLexer.py" in <module>
53. VERBOSE+LOCALE+IGNORECASE)
File "C:\ProgramData\Anaconda3\lib\re.py" in compile
233. return _compile(pattern, flags)
File "C:\ProgramData\Anaconda3\lib\re.py" in _compile
301. p = sre_compile.compile(pattern, flags)
File "C:\ProgramData\Anaconda3\lib\sre_compile.py" in compile
562. p = sre_parse.parse(p, flags)
File "C:\ProgramData\Anaconda3\lib\sre_parse.py" in parse
865. p.pattern.flags = fix_flags(str, p.pattern.flags)
File "C:\ProgramData\Anaconda3\lib\sre_parse.py" in fix_flags
832. raise ValueError("cannot use LOCALE flag with a str pattern")
Exception Type: ValueError at /
Exception Value: cannot use LOCALE flag with a str pattern
Clicking portfolio link at the top results in a 404 error.
Request Method: | GET |
---|---|
http://127.0.0.1:8000/accounts/login/?next=/portfolio |
Using the URLconf defined in PyFolio.urls, Django tried these URL patterns, in this order:
^(?i)admin/
^$ [name='home']
^(?i)login [name='login']
^(?i)home [name='home']
^(?i)about [name='about']
^(?i)team [name='team']
^(?i)logout [name='logout']
^(?i)register [name='register']
^(?i)portfolio [name='portfolio']
The current URL, accounts/login/, didn't match any of these.
Hey!
Python 2.7 doesn't have http.client and has httplib.
I replaced it and after making a few changes, I'm getting an error of TypeError at /portfolio
'NoneType' object has no attribute 'getitem' , when I try searching for any stock !
Any help would be appreciated !
Add feature to track trading history: buying price, selling price, number of shares, date, etc.
Some of the dependancies need to be listed on a Requirements File.
Top of my head are:
django-compressor (1.5)
simplejson (3.8.0)
yql-finance (0.1.0)
ystockquote (0.2.4)
pylint (1.4.4)
pylint-django (0.6.1)
pylint-plugin-utils (0.2.3)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.