From 052dc9788a792a886a4c55463cb50238e68436f9 Mon Sep 17 00:00:00 2001 From: <> Date: Thu, 29 Jun 2023 02:51:35 +0000 Subject: [PATCH] Deployed a86a029 with MkDocs version: 1.4.3 --- .nojekyll | 0 404.html | 1018 +++ apps/activities/index.html | 1166 +++ apps/admissions/index.html | 1076 +++ apps/monitoring/introduction/index.html | 1113 +++ apps/monitoring/scripts/index.html | 1243 +++ assets/_mkdocstrings.css | 36 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.c2be25ad.min.js | 29 + assets/javascripts/bundle.c2be25ad.min.js.map | 8 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.208ed371.min.js | 42 + .../workers/search.208ed371.min.js.map | 8 + assets/stylesheets/main.85bb2934.min.css | 1 + assets/stylesheets/main.85bb2934.min.css.map | 1 + assets/stylesheets/palette.a6bdf11c.min.css | 1 + .../stylesheets/palette.a6bdf11c.min.css.map | 1 + .../configuring-the-github-secrets/index.html | 1059 +++ deployment/environment-variables/index.html | 1233 +++ endponts/index.html | 1039 +++ images/dockerhub.PNG | Bin 0 -> 127183 bytes images/github-secrets.PNG | Bin 0 -> 82390 bytes index.html | 1303 ++++ installation/environment-variables/index.html | 1137 +++ installation/fixtures/index.html | 1118 +++ objects.inv | Bin 0 -> 735 bytes search/search_index.json | 1 + security/capabilities/index.html | 1414 ++++ .../google-cloud-functions/index.html | 1190 +++ services/google_cloud/storage/index.html | 1346 ++++ services/slack integration/icons/index.html | 1054 +++ signals/quickstart/index.html | 1190 +++ sitemap.xml | 138 + sitemap.xml.gz | Bin 0 -> 495 bytes testing/mixins/bc-cache/index.html | 1194 +++ testing/mixins/bc-check/index.html | 2214 ++++++ testing/mixins/bc-database/index.html | 3365 +++++++++ testing/mixins/bc-datetime/index.html | 1426 ++++ testing/mixins/bc-fake/index.html | 1054 +++ testing/mixins/bc-format/index.html | 2914 +++++++ testing/mixins/bc-random/index.html | 1500 ++++ testing/mixins/bc-request/index.html | 1583 ++++ testing/mixins/bc/index.html | 1567 ++++ testing/mocks/mock-requests/index.html | 1944 +++++ testing/mocks/using-mocks/index.html | 1229 +++ testing/runing-tests/index.html | 1173 +++ 77 files changed, 47327 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 apps/activities/index.html create mode 100644 apps/admissions/index.html create mode 100644 apps/monitoring/introduction/index.html create mode 100644 apps/monitoring/scripts/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.c2be25ad.min.js create mode 100644 assets/javascripts/bundle.c2be25ad.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.208ed371.min.js create mode 100644 assets/javascripts/workers/search.208ed371.min.js.map create mode 100644 assets/stylesheets/main.85bb2934.min.css create mode 100644 assets/stylesheets/main.85bb2934.min.css.map create mode 100644 assets/stylesheets/palette.a6bdf11c.min.css create mode 100644 assets/stylesheets/palette.a6bdf11c.min.css.map create mode 100644 deployment/configuring-the-github-secrets/index.html create mode 100644 deployment/environment-variables/index.html create mode 100644 endponts/index.html create mode 100644 images/dockerhub.PNG create mode 100644 images/github-secrets.PNG create mode 100644 index.html create mode 100644 installation/environment-variables/index.html create mode 100644 installation/fixtures/index.html create mode 100644 objects.inv create mode 100644 search/search_index.json create mode 100644 security/capabilities/index.html create mode 100644 services/google_cloud/google-cloud-functions/index.html create mode 100644 services/google_cloud/storage/index.html create mode 100644 services/slack integration/icons/index.html create mode 100644 signals/quickstart/index.html create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 testing/mixins/bc-cache/index.html create mode 100644 testing/mixins/bc-check/index.html create mode 100644 testing/mixins/bc-database/index.html create mode 100644 testing/mixins/bc-datetime/index.html create mode 100644 testing/mixins/bc-fake/index.html create mode 100644 testing/mixins/bc-format/index.html create mode 100644 testing/mixins/bc-random/index.html create mode 100644 testing/mixins/bc-request/index.html create mode 100644 testing/mixins/bc/index.html create mode 100644 testing/mocks/mock-requests/index.html create mode 100644 testing/mocks/using-mocks/index.html create mode 100644 testing/runing-tests/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..684bcdcae --- /dev/null +++ b/404.html @@ -0,0 +1,1018 @@ + + + +
+ + + + + + + + + + + + + +This API uses Google DataStore as storage, there is not local storage on Heroku or Postgres.
+We need Google DataStore because we plan to store huge amounts of activities that the user can do inside breathecode.
+Possible activities (so far): +
"breathecode_login" //every time it logs in
+"online_platform_registration" //first day using breathecode
+"public_event_attendance" //attendy on an eventbrite event
+"classroom_attendance" //when the student attent to class
+"classroom_unattendance" //when the student miss class
+"lesson_opened" //when a lessons is opened on the platform
+"office_attendance" //when the office raspberry pi detects the student
+"nps_survey_answered" //when a nps survey is answered by the student
+"exercise_success" //when student successfully tests exercise
+
Any activity has the following inputs:
+ +Get recent user activity +
+Add a new user activity (requires authentication) +
POST: activity/user/{email_or_id}
+{
+ 'slug' => 'activity_slug',
+ 'data' => 'any aditional data (string or json-encoded-string)'
+}
+
+💡 Node: You can pass the cohort in the data json object and it will be possible to filter on the activity graph like this:
+
+{
+ 'slug' => 'activity_slug',
+ 'data' => "{ \"cohort\": \"mdc-iii\" }" (json encoded string with the cohort id)
+}
+
Endpoints for the Cohort
+Get recent user activity +
+Endpoints for the coding_error's + +Add a new coding_error (requires authentication)
+POST: activity/coding_error/
+
+{
+ "user_id" => "my@email.com",
+ "slug" => "webpack_error",
+ "data" => "optional additional information about the error",
+ "message" => "file not found",
+ "name" => "module-not-found,
+ "severity" => "900",
+ "details" => "stack trace for the error as string"
+}
+
This module take care of the academic side of breathecode: Students, Cohorts, Course (aka: Certificate), Syllabus, etc. These are some of the things you can do with the breathecode.admissions API:
+TODO: finish this documentation.
+Override previous academies +
+This app is ideal for running diagnostic and reminders on the breathecode platform.
+Setup the monitor app job for once a day, this is the command: +
+Setup the monitor script job for once a day, this is the command: +
+A monitoring script is something that you want to execute recurrently withing the breathecode API, for example:
+scripts/alert_pending_leads.py
is a small python script that checks if there is FormEntry Marketing module database that are pending processing.
You can create a monitoring script to remind academy staff members about things, or to remind students about pending homework, etc.
+./breathecode/monitoring/scripts
#!/usr/bin/env python
+"""
+Alert when there are Form Entries with status = PENDING
+"""
+from breathecode.utils import ScriptNotification
+# start your code here
+
ScriptNotification
to notify for MINOR
or CRITICAL
reasons, for example:# here we are raising a notification because there are 2 pending tasks
+raise ScriptNotification("There are 2 pending taks", status='MINOR', slug="pending_tasks")
+
There are some global variables that you have available during your scripts:
+Variable name | +Value | +
---|---|
academy | +Contains the academy model object, you can use it to retrieve the current academy id like this: query.filter(academy__id=academy.id) |
+
You can test your scripts by running the following command:
+$ python manage.py run_script <file_name>
+
+# For example you can test the alert_pending_leads script like this:
+$ python manage.py run_script alert_pending_leads.py
+
The following script checks for pending leads to process:
+#!/usr/bin/env python
+"""
+Alert when there are Form Entries with status = PENDING
+"""
+from breathecode.marketing.models import FormEntry
+from django.db.models import Q
+from breathecode.utils import ScriptNotification
+
+# check the database for pending leads
+pending_leads = FormEntry.objects.filter(storage_status="PENDING").filter(Q(academy__id=academy.id) | Q(location=academy.slug))
+
+# trigger notification because pending leads were found
+if len(pending_leads) > 0:
+ raise ScriptNotification(f"Warning there are {len(pending_leads)} pending form entries", status='MINOR')
+
+# You can print this and it will show on the script results
+print("No pending leads")
+
from breathecode.monitoring.actions import run_script
+script = run_script(model.monitor_script)
+
+del script['slack_payload']
+del script['title']
+
+expected = {'details': script['details'],
+ 'severity_level': 5,
+ 'status': script['status'],
+ 'text': script['text']
+ }
+
+self.assertEqual(script, expected)
+
+self.assertEqual(self.all_monitor_script_dict(), [{
+ **self.model_to_dict(model, 'monitor_script'),
+}])
+
name | +description | +
---|---|
ENV | +Represents the current environment, can be DEVELOPMENT , TEST , and PRODUCTION |
+
LOG_LEVEL | +Represents the log level for the logging module, can be NOTSET , DEBUG , INFO , WARNING , ERROR and CRITICAL |
+
DATABASE_URL | +Represents the connection string to the database, you can read more about schema url | +
CACHE_MIDDLEWARE_MINUTES | +Represents how long an item will last in the cache | +
API_URL | +Represents the url of api rest | +
ADMIN_URL | +Represents the url of frontend of the admin | +
APP_URL | +Represents the url of frontend of the webside | +
REDIS_URL | +Represents the url of Redis | +
CELERY_TASK_SERIALIZER | +Represents the default serialization method to use. Can be pickle json , yaml , msgpack or any custom serialization methods |
+
EMAIL_NOTIFICATIONS_ENABLED | +Represents if the server can send notifications through email | +
SYSTEM_EMAIL | +Represents the email of Breathecode for support |
+
GITHUB_CLIENT_ID | +Represents the client id used for the OAuth2 with Github |
+
GITHUB_SECRET | +Represents the secret used for the OAuth2 with Github |
+
GITHUB_REDIRECT_URL | +Represents the redirect url used for the OAuth2 with Github |
+
SLACK_CLIENT_ID | +Represents the client id used for the OAuth2 with Slack |
+
SLACK_SECRET | +Represents the secret used for the OAuth2 with Slack |
+
SLACK_REDIRECT_URL | +Represents the redirect url used for the OAuth2 with Slack |
+
MAILGUN_API_KEY | +Represents the api key used for the OAuth2 with Mailgun |
+
MAILGUN_DOMAIN | +Represents the domain of Breathecode that provided Mailgun |
+
EVENTBRITE_KEY | +Represents the key used for the OAuth2 with Eventbrite |
+
FACEBOOK_VERIFY_TOKEN | +Represents the verify token used for the OAuth2 with Facebook |
+
FACEBOOK_CLIENT_ID | +Represents the client id used for the OAuth2 with Facebook |
+
FACEBOOK_SECRET | +Represents the secret used for the OAuth2 with Facebook |
+
FACEBOOK_REDIRECT_URL | +Represents the redirect url used for the OAuth2 with Facebook |
+
ACTIVE_CAMPAIGN_KEY | +Represents the key used for the OAuth2 with Active Campaign |
+
ACTIVE_CAMPAIGN_URL | +Represents the domain of Breathecode that provided Active Campaign |
+
GOOGLE_APPLICATION_CREDENTIALS | +Represents the file will be saved the service account of Google Cloud |
+
GOOGLE_SERVICE_KEY | +Represents the content of the service account used for the OAuth2 with Google Cloud |
+
GOOGLE_PROJECT_ID | +Project ID on google cloud used for the integration of the entire API | +
GOOGLE_CLOUD_KEY | +Represents the key used for the OAuth2 with Google Cloud |
+
GOOGLE_CLIENT_ID | +Represents the client id used for the OAuth2 with Google Cloud |
+
GOOGLE_SECRET | +Represents the secret used for the OAuth2 with Google Cloud |
+
GOOGLE_REDIRECT_URL | +Represents the redirect url used for the OAuth2 with Google Cloud |
+
DAILY_API_KEY | +Represents the api key used for the OAuth2 with Daily |
+
DAILY_API_URL | +Represents the domain of Breathecode that provided Daily |
+
SAVE_LEADS | +Represents if Breathecode will persist the leads | +
COMPANY_NAME | +Represents the company name | +
COMPANY_CONTACT_URL | +Represents the company contact url | +
COMPANY_LEGAL_NAME | +Represents the company legal name | +
COMPANY_ADDRESS | +Represents the company address | +
MEDIA_GALLERY_BUCKET | +Represents the bucket for the media gallery | +
DOWNLOADS_BUCKET | +Represents the bucket for the CSV files | +
PROFILE_BUCKET | +Represents the bucket for profile avatars | +
^L${JAUqS7^gb7{02g`Zz+wa@dzK+k(yDPuH8Q)AUfQKSHV-Q~XZ0|aDwaA0?
zxQ)Ptb|V43Iy5m!uu|#1aptmB5c(!d@y+cVqfa&;@2lt*ytJ|!3CLdH6A`t!!4`aB
zEn!rAet*X8y85{!jrR|uRtg?vpFRHl(N~`TYj)33=SywK{}GvvF(8vq;78wnHd>Rs
z%OF{3N4f1BS>}UG{kp0jL`Q|1L+2eEX(}LLlTD}npY@4z;uwha*C2BPqMbBZ@gxx(V_;e!txOf;95043Dp
z{=$Z~d(?RR{y_jjdi=}M|L7%f`|##>!Tfyw#o_lU^z(7RncoNF=VR5Qzm4
I3PfoT<MR>!Kx=tm^1fUegbGz%@84;wRmOm
zQ;!Z~^ai}1HFRhZ-Ff2k3!ZKWZhgW#2^VBSkZ@nz%6Me2b&GUxn|K8fhgN?_icBSf
zsr^oDl&>
b1ouit>b%(S$|y(?A2`wAd~Kz5Pu+m~OLeZ*
zNrCmEv521@?GHreKWMM^pWWh-lkj&OZ=rIa(aGJ731OR{LC#1-CvgEP7~+1m408BZ
zO9@&)Yr_-aA0de7!ZxI0V@;Ox!Nh9&5crWY>z0z8c6m?K4-HlVI$btbYAV5UDqsVQ
zT~$|0A*WMMpt)%yRWwThe)pDg9|!^tk@iGRkJ^Ez%lY=%HR~W?(5t>4TWJ3ncZl
zM01=}KdG~0vGXlYebmZ|&*2qgC+jEGiqB~QYqGU}p1Zg@5>{K-8}=M?ZZMg&)rW)D
zXWMR47f;Gd?H|Qo2u!bllNnc?nBujcUs
sA+|LMN18GrX$dKN9&yc4O
z-_IYHp~J8(Cl4JkJL!!_EywilWb!9gm8-neVUfpp^S(*do9Vxs7te!JJZ-1SwdGfm
zftF;I!0Ct-_tE>=v*d1TT3|