Coder Social home page Coder Social logo

jessamynsmith / eggtimer-server Goto Github PK

View Code? Open in Web Editor NEW
48.0 48.0 17.0 927 KB

Server for online menstrual tracker

Home Page: https://eggtimer.jessamynsmith.ca

License: MIT License

Python 70.60% CSS 1.15% JavaScript 10.96% HTML 16.46% Shell 0.78% Procfile 0.05%

eggtimer-server's People

Contributors

dependabot[bot] avatar jessamynsmith avatar nedbat avatar ojacobson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eggtimer-server's Issues

API exclude

Hi

¿ I can exclude data from one day through the API?

curl -v -k -X GET -H "Content-Type: application/json" -H 'Authorization: Token 1ef8640838bb404567212b47da03e4130428eec8' "https://eggtimer.herokuapp.com/api/v2/periods/" | python -m json.tool
[{"id":545,"timestamp":"2016-01-14T05:00:00Z","first_day":true,"level":2,"color":1,"clots":null,"cramps":null,"comment":""},{"id":546,"timestamp":"2016-01-14T17:01:34Z","first_day":false,"level":2,"color":2,"clots":null,"cramps":null,"comment":null},{"id":547,"timestamp":"2016-01-15T17:30:54Z","first_day":false,"level":2,"color":2,"clots":null,"cramps":null,"comment":null},{"id":548,"timestamp":"2016-01-16T17:30:54Z","first_day":false,"level":2,"color":2,"clots":null,"cramps":null,"comment":null},{"id":550,"timestamp":"2016-01-17T06:00:00Z","first_day":false,"level":2,"color":2,"clots":null,"cramps":null,"comment":""},{"id":551,"timestamp":"2016-01-18T06:00:00Z","first_day":false,"level":1,"color":2,"clots":null,"cramps":null,"comment":""},{"id":552,"timestamp":"2016-01-19T21:12:25Z","first_day":false,"level":1,"color":2,"clots":null,"cramps":null,"comment":""}]

Example, i want:

curl -v -k -X GET -H "Content-Type: application/json" -H 'Authorization: Token 1ef8640838bb404567212b47da03e4130428eec8' "https://eggtimer.herokuapp.com/api/v2/periods/timestamp:2016-01-19" 
{"id":552,"timestamp":"2016-01-19T21:12:25Z","first_day":false,"level":1,"color":2,"clots":null,"cramps":null,"comment":""}]

Thanks

Calendar view shows wrong dates

When I enter yesterday's date (May 25) as the first day of my period, it shows on the calendar as Sunday the 24th. I tried changing the timestamp to different times to see if that made a difference, but it did not. Entering the first day as May 26 changed it to show on Monday the 25th.

Allow custom cycle length

Thanks for the great app, tried it out for a few months - but the predictions have always been way early (>1week) for me. This is because the app doesn't have enough of my data to calculate a reliable average. Also there was a month when I was terribly sick and my cycle length was much shorter than normal, throwing off the average calculation.

Would you be open to a PR that allows users to set custom cycle length? This will also allow first-time users to get more accurate predictions from the onset, given they know their average length. The calculated average will still be shown, and the user can go back to using the calculated average at anytime.

Get coverage measurement on templates again

diff --git a/eggtimer/settings.py b/eggtimer/settings.py
index af25b4b..c1acce3 100644
--- a/eggtimer/settings.py
+++ b/eggtimer/settings.py
@@ -19,8 +19,7 @@ ADMINS = (
 SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY',
                             'psu&&83=i(4wgd@9*go=nps9=1rw#9b_w6psy4mp6yoxqv1i5g')

-DEBUG = os.environ.get('DJANGO_DEBUG', False)
-TEMPLATE_DEBUG = DEBUG
+DEBUG = bool(int(os.environ.get('DJANGO_DEBUG', False)))

 ALLOWED_HOSTS = ['eggtimer.herokuapp.com', 'localhost', '127.0.0.1']
 CORS_ORIGIN_ALLOW_ALL = True
@@ -66,25 +65,29 @@ MIDDLEWARE_CLASSES = (
 ROOT_URLCONF = 'eggtimer.urls'


-TEMPLATE_DIRS = (
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-    BASE_DIR + '/eggtimer/templates/',
-)
-
-TEMPLATE_CONTEXT_PROCESSORS = (
-    "django.contrib.auth.context_processors.auth",
-    "django.core.context_processors.debug",
-    "django.core.context_processors.i18n",
-    "django.core.context_processors.media",
-    "django.core.context_processors.request",
-    "django.core.context_processors.static",
-    "django.core.context_processors.tz",
-    "django.contrib.messages.context_processors.messages",
-    "settings_context_processor.context_processors.settings",
-)
-
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [
+            BASE_DIR + '/eggtimer/templates/',
+        ],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                "django.contrib.auth.context_processors.auth",
+                "django.core.context_processors.debug",
+                "django.core.context_processors.i18n",
+                "django.core.context_processors.media",
+                "django.core.context_processors.request",
+                "django.core.context_processors.static",
+                "django.core.context_processors.tz",
+                "django.contrib.messages.context_processors.messages",
+                "settings_context_processor.context_processors.settings",
+            ],
+            'debug': DEBUG,
+        },
+    },
+]

 # Python dotted path to the WSGI application used by Django's runserver.
 WSGI_APPLICATION = 'eggtimer.wsgi.application'

(Yes, I should have made a pull request.... I still could)

Request from Arduino

Hi
I 'm trying to make a request from Arduino , but can not receive any response from the server,

"GET /api/v2/periods/ HTTP/1.1\r\n"
                    "Host: eggtimer.herokuapp.com\r\n"
                    "User-Agent: ESP8266\r\n"
                    "Content-Type: application/json\r\n"
                    "Authorization: Token "+ MyApi_Key + "\r\n";

Could you help me a little to make the request ?

Thanks

Emails not sending

It has been weeks since I last received a notification email, and I should surely have received one by now.

Moon Phase API seems to be offline

I forked the project and set everything up but I found that the request for the moon phase going out to https://api.usno.navy.mil seems to always run into a timeout for me. This slows down the view generation of the calendar because the server waits for the API to respond until it generates the rest

moon phase api not reachable

i currently reside in china and it seems i can't connect to the us navy api, i used a vpn to bypass the censorship but still it fails, below is a traceback of the error that occured

HTTPConnectionPool(host='api.usno.navy.mil', port=80): Max retries exceeded with url: /moon/phase?date=10%2F27%2F2019&nump=8 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xabdf99cc>: Failed to establish a new connection: [Errno -2] Name or service not known',))

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.