Giter VIP home page Giter VIP logo

Comments (12)

dylanleigh avatar dylanleigh commented on June 12, 2024

Sorry, there's a missing step in the install instructions - you need to set up an environment variable containing the Django Secret Key. I'll update the documentation ASAP

from priceandnutritiontrackingsystem.

dylanleigh avatar dylanleigh commented on June 12, 2024

Updated in e396f37

from priceandnutritiontrackingsystem.

JeffCdev avatar JeffCdev commented on June 12, 2024

Hi Dylan,
Thanks for getting back to me!! (btw, love the committment to writing clear instructions) Getting a lot closer, but still no joy. Since you're obviously serious about getting the docs right, here's my feedback, First, I think you should add this line:

git clone https://github.com/dylanleigh/PriceAndNutritionTrackingSystem.git
cd PriceAndNutritionTrackingSystem # add this line
pip install -r requirements.txt

Now on to where I'm at. :)

After setting the secret key, I got this error:
File "/home/pi/pants/local/lib/python2.7/site-packages/django_filters/filterset.py", line 184
def init(self, data=None, queryset=None, *, request=None, prefix=None):
^
SyntaxError: invalid syntax

After doing some research, I found this:

https://stackoverflow.com/questions/53482772/getting-started-with-django-rest-framework-syntaxerror-invalid-syntax

"My two cents: As @9769953 and @livonia said the version of django-filter you are using uses in https://github.com/carltongibson/django-filter/blob/master/django_filters/filterset.py#L184 a Python 3.x syntax not compatible with Python 2.7 so this version. The new syntax is specified on https://www.python.org/dev/peps/pep-3102/.

The error that your are getting is on line 184:

File "/Library/Python/2.7/site-packages/django_filters/filterset.py", line 184
def init(self, data=None, queryset=None, *, request=None, prefix=None):
^

SyntaxError: invalid syntax

So:

pip install "django-filter<2.0 "

So I used the pip command, and now I'm getting this error:

File "/home/pi/pants/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
raise original_exception
django.db.utils.OperationalError: no such table: auth_user

To make sure that I'm not making a newbie error (just starting out with python), here's how I'm creating the virtual environment:

virtualenv -p /usr/bin/python2.7 pants

Thanks again for all your hard work!!!

from priceandnutritiontrackingsystem.

JeffCdev avatar JeffCdev commented on June 12, 2024

an addendum (just noticed the copy/paste didn't work quite right). the caret is pointing to the comma after the asterisk:
File "/home/pi/pants/local/lib/python2.7/site-packages/django_filters/filterset.py", line 184
def init(self, data=None, queryset=None, *, request=None, prefix=None):
^

from priceandnutritiontrackingsystem.

JeffCdev avatar JeffCdev commented on June 12, 2024

darn, still didn't work right, second attempt:
an addendum (just noticed the copy/paste didn't work quite right). the caret is pointing to the comma after the asterisk:
File "/home/pi/pants/local/lib/python2.7/site-packages/django_filters/filterset.py", line 184
def init(self, data=None, queryset=None, *, request=None, prefix=None):
-------------------------------------------^
ignore the dashes

from priceandnutritiontrackingsystem.

dylanleigh avatar dylanleigh commented on June 12, 2024

Thanks @JeffCdev - I'm still updating the Installation docs.
I'm going to include Python 3+ in requirements from now on as many libraries are deprecating Python 2, that should also resolve the syntax issues.

from priceandnutritiontrackingsystem.

JeffCdev avatar JeffCdev commented on June 12, 2024

Thanks Dylan! Just FYI, I have tried the install under python 3.7, also with no joy. I am really looking forward to trying out your work. (so much so that I tried to hack my way through to remove the need to login just to see how things would work, without very much luck :) )

from priceandnutritiontrackingsystem.

JeffCdev avatar JeffCdev commented on June 12, 2024

Hi Dylan, Woo Hoo, up and running. A few notes/comments. After the initial install, and reaching this point in the instructions:
./manage.py createsuperuser
The process will throw a warning about unapplied migrations, and fail with the error:
no such table: auth_user
After running python manage.py migrate, I was able to run ./manage.py createsuperuser successfully.
However, I ran into issues with the initial error error being ObjectDoesNotExist is not defined. I went ahead and created a second user, and logged in via the admin interface, and then tried the website. I then saw errors: Target Matching Query Does Not Exist with daily_Target = True showing up earlier in the log. Thinking it might be related to the user, I went ahead and filled in a daily target info for the new user. I then ran into KeyErrors: protein_per_j. I then set up the user completely (all targets) leaving no fields blank. At this point, I was able to access the website. So, I think you might want to either add a "sample user" to populate the database to prevent this issue, and/or modify the code.
Thank you so very, very much for this project! Now that I'm able to run it, I am looking forward to exploring its functionality.

from priceandnutritiontrackingsystem.

dylanleigh avatar dylanleigh commented on June 12, 2024

Thanks @JeffCdev for all the reports - I haven't had time to look at it this week but as soon as I can I will fix the code so these missing object issues won't occur on a fresh install.

from priceandnutritiontrackingsystem.

dylanleigh avatar dylanleigh commented on June 12, 2024

These haven't been tested on a fresh install yet, but don't break an existing install or unit tests:

Initial migration added to docs in 82cbdfb
Fixed Target;s Exceptions called incorrectly in a4b934b
Fixed home page missing defaults if protein_per_j and fibre_per_j can't be derived from the daily target in 4a8bba7

from priceandnutritiontrackingsystem.

JeffCdev avatar JeffCdev commented on June 12, 2024

Thanks Dylan! I have to tell you, now that I've had a chance to work with your app, you've done spectacular work. The thought that you've put into the app shows you really understand what people will want to track, and I very much look forward to your future work. I do have a couple of suggestions. First, the addition of ingredients. I'm from the states, so we're still kcal rather than kj, but I've been using an Aussie website to get data. However, even with that site, kj per kilogram is a bit like furloughs per fortnight. :) Having functionality that would allow a user to enter kj (or kcal) and other nutritional info by the suggested serving in grams (like what is listed on the nutritional data section of a package) and then converting it to kilograms would really enhance the user experience. Second, I'm assuming based on the personal info that you've shared that the reason you're putting so much time and effort into the project is that you are concerned about your health. So, my second suggestion would be to add some type of bio-metric info that could be track along with nutrition so that a person could see the results. Just adding body weight at a date would be great, but other info (bmi, blood pressure, etc.) would be useful. I'm going to hold off on redoing an install at this point, since I'm concerned about losing all of the ingredient info I've entered so far, but when I have some time, I'll set up another virtual environment and do a second install and let you know how it goes. Again, thank you very much!

from priceandnutritiontrackingsystem.

dylanleigh avatar dylanleigh commented on June 12, 2024

Sorry I missed your comment @JeffCdev , for some reason I didn't get a notification.
Glad you're finding the app useful, and thanks for all your feedback.

Regarding data entry: I've added some new TODOs to the roadmap to make data entry easier (including allowing per-something other than kg entry). Also there is now a fixture with some sample ingredient data including basics like eggs, flour, oats etc.

Biometrics: This has been planned for a while, there is a section in the roadmap for adding diary entries for exercise sessions and recording metrics (blood pressure, pulse etc). The diary code is already set up to be compatible non-food entries although none have been implemented yet.

from priceandnutritiontrackingsystem.

Related Issues (8)

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.