Coder Social home page Coder Social logo

kevinbowen777 / learning-log Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 5.73 MB

An Django web application for creating learning lists

License: MIT License

Python 6.51% HTML 3.61% Procfile 0.01% Dockerfile 0.25% CSS 40.71% JavaScript 47.55% Shell 1.38%
django django-application python

learning-log's Introduction

Learning Log

Status GitHub Issues License Coverage

Learning Log is an online journal system that lets you keep track of information you’ve learned about particular topics. Learning log is built using the Django 5.0.x web framework.

It allows users to log the topics they’re interested in and to make journal entries as they learn about each topic. Once logged in, a user can create new topics, add new entries, and read and edit existing entries.

Table of Contents

Features

  • Application

    • Create & edit new topics and entries
    • User registration with email verification & social(GitHub) login using django-allauth
    • Bootstrap4 & crispy-forms decorations
    • Customizable user profile pages with bio, profile pic, & country flags
    • For additional links to package resources used in this repository, see the Package Index
  • Dev/testing

  • run command menu

    (adapted from Nick Janetakis' helpful docker-django-example)

    You can run ./run to get a list of commands and each command has documentation in the run file itself. This comes in handy to run various Docker commands because sometimes these commands can be a bit long to type.

    If you get tired of typing ./run you can always create a shell alias with alias run=./run in your ~/.bash_aliases or equivalent file. Then you'll be able to run run instead of ./run.


Installation

  • git clone https://github.com/kevinbowen777/learning_log.git
  • cd learning_log
  • Local installation:
    • poetry shell
    • poetry install
    • python manage.py migrate
    • python manage.py createsuperuser
    • python manage.py runserver
  • Docker installation:
    • docker compose up --build
    • docker compose exec web python manage.py migrate
    • docker compose exec web python manage.py createsuperuser Additional commands:
      • docker compose exec web python manage.py shell_plus (loads Django shell autoloading project models & classes)
      • docker run -it django-start-web bash (CLI access to container)
  • Browse to http://127.0.0.1:8000 or http://127.0.0.1:8000/resources/
  • Pre-commit:
    • To add the hook, run the following command in the poetry shell:
      • pre-commit install

Testing

  • docker compose exec web python manage.py test
  • coverage run -m pytest
  • Nox (includes sessions for black, lint, typing, safety, tests)
    • testing supported for Python 3.10, 3.11, 3.12
    • e.g. nox, nox -rs lint-3.11, nox -s tests
      • nox
      • nox -s coverage-3.12
      • nox -s docs-3.11
      • nox -rs lint-3.10 (Use the 'r' flag to reuse existing session)
      • nox -s pyright-3.11
      • nox -s safety (will run tests against all Python versions)
      • nox -s tests

Application Demo

A live application demonstration:

TBD


Screenshots

Home Page Home Page

Topic List Topic List

Topic Entries Topic Entries

Profile Page Profile Page

Email Validation Email Validation

Password Reset Password Reset

Lost Password Request Lost Password Request


Reporting Bugs

Visit the Issues page to view currently open bug reports or open a new issue.

learning-log's People

Contributors

kevinbowen777 avatar

Stargazers

Jarrian Gojar avatar Nikolaus Schlemm avatar

Watchers

 avatar James Cloos avatar  avatar

learning-log's Issues

Install Django debug toolbar

Install django-debug-toolbar


  1. poetry add -D django-debug-toolbar

  2. There are three separate configurations to set in our config/settings.py file:

  • INSTALLED_APPS
  • Middleware
  • INTERNAL_IPS

2a. Add to INSTALLED_APPS

# config/settings.py
INSTALLED_APPS = [
    'django.contrib.admin',
    ...
    'django.contrib.sites',

    # Third-party
    'debug_toolbar', # new

    # Local
    'accounts',
    'pages',
    'books',
]

2b. Add to MIDDLEWARE section:

# config/settings.py
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    ...
    'debug_toolbar.middleware.DebugToolbarMiddleware', # new
]

2c. Add the following lines at the bottom of config/settings.py.:

# django-debug-toolbar
import socket
# Use the following in Docker only:                                     
# INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]                                  
# The following is for use locally:                                             
INTERNAL_IPS = ["127.0.0.1"]
  1. Update URLconf:
# config/urls.py
if settings.DEBUG: # new
    import debug_toolbar
    urlpatterns = [
        path('__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns

Implement django-allauth

Application is currently using basic auth. Convert to using allauth for additional functionality

Override allauth email & password templates

Create new template to match our theme and override the default django-allauth templates for the following:

templates/account/email.html
templates/account/email_confirm.html
templates/account/password_change.html
templates/account/password_reset.html
templates/account/password_reset_done.html
templates/account/password_reset_from_key.html
templates/account/password_reset_from_key_done.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.