Table of Contents
Memo is a flashcard-like web application built with Django, Django Rest Framework, jQuery, Bootstrap and Celery. You can create your own deck and also create flashcards about contents you want to learn. The object of this application is to make learning interesting and fun.
You can check the deployed project here.
Use the login credencial below to access the web application:
Username: visitor
Password: v1s1t0r@123
root ┐
├─ accounts (login)
├─ memo (api)
│ └─ tests
├─ memo_front (app)
├─ project (core of memo)
├─ static
└─ templates
├─ frontend
└─ registration
Before the setup, make sure you have:
- Python 3.9
- Pip
- Docker compose
$ git clone https://github.com/yamawakimiho/memo_django.git
Create a virtual environment running Python 3.9:
virtualenv venv -p $(which python3)
or
$ mkvirtualenv -p $(which python3) venv
$ source venv/bin/activate
or
$ workon venv
$ pip install -U pip setuptools wheel pip-tools
Install the project requirements:
$ pip-sync
Make a copy of .env_example
file and named it to .env
Use the command below to build, create and start the docker compose:
$ docker-compose up
Migrate your model:
$ python manage.py migrate
Run the localhost (make sure docker is up in your localhost!):
$ python manage.py runserver
You can use Celery locally by using this command:
$ celery -A project worker -l info
If you want to activate task manually, run:
$ python manage.py shell
Python 3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from project.tasks import send_email_task
>>> send_email_task()
>>> 'Email sent'
- Remember: To receive a email, you need at least 1 deck with activate = True or notification ON and your registered email should be a valid email.
Or run periodic scheduling with celery beat (scheduler). See this documentation. ** You can change the scheduler configuration in settings.py **
$ celery -A project.celery beat
or using beat with the worker:
$ celery -A project worker -l info -beat