Django Web-App for studying which creates an easier customer experience for applying a mix between Flash Cards and Active Recall techniques.
🏠 The home link is the following: https://cloudquestions.es/
Contributions are warmly welcomed. Doesn't have to be implementing new functionality, issues are also opened for documentation, support, etc.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This instructions will get you up and running for development purposes. See testing for notes on how to test the app and special requests on tests created.
At CloudQuestions, we use environments for development pyvenv. On these environments, we install the dependencies with pip.
-
Clone this repository.
-
Checkout to the "dev" branch:
git checkout dev
-
Create a new branch off the "dev" branch:
git checkout -b <new_branch_name>
-
Add EXCLUDE info to avoid unwanted files.
cat EXCLUDE.txt >> .git/info/exclude
-
Set up your environment and dependencies:
python3 -m venv <environment_name>
source <environment_name>/bin/activate
pip install -r requirements.txt
Note: CloudQuestions uses API calls (auth, calendar events). Local development might malfunction if API keys are not provided to the environment. We use os to provide privacy on source files to important bits.
import os
os.environ['NAME']
As I said before, CloudQuestions uses API calls for some functionality. To be able to access the full experience when developing, we use a template to be included in the environment:
export DJANGO_SECRET='YOUR_DJANGO_KEY'
export EMAIL_HOST_USER='YOUR_EMAIL'
export EMAIL_HOST_PASSWORD='YOUR_EMAIL_PASSWORD'
export DEFAULT_FROM_EMAIL='YOUR_EMAIL'
export SERVER_EMAIL='YOUR_EMAIL'
export SOCIAL_AUTH_GITHUB_KEY='YOUR_KEY'
export SOCIAL_AUTH_GITHUB_SECRET='YOUR_KEY'
export SOCIAL_AUTH_TWITTER_KEY='YOUR_KEY'
export SOCIAL_AUTH_TWITTER_SECRET='YOUR_KEY'
export SOCIAL_AUTH_GOOGLE_OAUTH2_KEY='YOUR_KEY'
export SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET='YOUR_KEY'
export CALENDAR_CLIENT_ID='YOUR_KEY'
export CALENDAR_CLIENT_SECRET='YOUR_KEY'
export CALENDAR_API_KEY='YOUR_KEY'
export RECAPTCHA_PUBLIC_KEY='YOUR_KEY'
export RECAPTCHA_PRIVATE_KEY='YOUR_KEY'
export DEBUG='True/False'
export DEV='True/False'
To be able to include this template into your environment, fill the keys for the functionality you are interested in on the TEMPLATE_KEYS.txt file and include it the following way:
cat TEMPLATE_KEYS.txt >> <environment_name>/bin/activate
At this point the app should be running locally. To create migrations and create the database.
python manage.py makemigration questions accounts
python manage.py migrate
To run the Django server:
python manage.py runserver
We use pytest to run all our tests. It is included in the dependencies, so the only steps required are:
cd CloudQuestions_Web
pytest
We recommend writing tests on new functionality for an easier process for merging it to the repo.
We use Black formatter at CloudQuestions. To test files to have a black format:
pytest --black
This project is licenced under the MIT Licence - see the LICENCE for details.