Code Monkey home page Code Monkey logo

pyfolio's Issues

ImportError at /portfolio No module named http.client

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 !

Make Portfolio page better

  • Money spent/earned section: add dollar sign in the front, add thousands separator ($###,###)
  • Add thousands separator for data in all tables
  • Need to click refresh button to see the updated money
  • Can the โ€œBuyโ€ trigger the refresh?
  • News open up in separate window?

Page Not Found at http://127.0.0.1:8000/accounts/login/?next=/portfolio

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.

ValueError at / 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

TypeError at /portfolio argument of type 'NoneType' is not iterable

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

ValueError at / cannot use LOCALE flag with a str pattern

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

Trading History

Add feature to track trading history: buying price, selling price, number of shares, date, etc.

Requirements File needed.

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.