jessamynsmith / eggtimer-server Goto Github PK
View Code? Open in Web Editor NEWServer for online menstrual tracker
Home Page: https://eggtimer.jessamynsmith.ca
License: MIT License
Server for online menstrual tracker
Home Page: https://eggtimer.jessamynsmith.ca
License: MIT License
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
It would be nice to see moon phases on the calendar.
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.
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.
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)
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
It would be nice if we could pause our cycles so that the data is not invalidated when our cycles are interrupted.
It has been weeks since I last received a notification email, and I should surely have received one by now.
When creating a period on the current day, the timestamp file is not initialized in the popup.
All notifications should include a link to log into the site, and a link to report bugs or suggest features.
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
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',))
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.