Skip to content

Memo is a flashcard-like web application built with Django, Celery, Django Rest Framework, jQuery and Bootstrap. (Python + Javascript)

Notifications You must be signed in to change notification settings

yamawakimiho/memo

Repository files navigation

Memo Django

Heroku

Table of Contents
  1. About The Memo
  2. Getting Started

About the memo

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

Screenshots

Project Structure

root ┐
     ├─ accounts (login)
     ├─ memo (api)
     │  └─ tests
     ├─ memo_front (app)
     ├─ project (core of memo)
     ├─ static
     └─ templates
        ├─ frontend
        └─ registration

Getting Started

Before the setup, make sure you have:

  • Python 3.9
  • Pip
  • Docker compose

Clone this repository:

$ 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

Activate the virtual environment:

$ source venv/bin/activate

or

$ workon venv

Update pip

$ pip install -U pip setuptools wheel pip-tools

Install the project requirements:

$ pip-sync

Local Environment

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

Using Celery

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