The Access Key Manager is deployed and accessible at the following link:
Access Key Manager - Deployed Application
LINK: https://access-key-manager-mtco.onrender.com/
A Take-Home Project
See TODO
Access Key Manager is a web application designed for managing multi-tenant access keys, especially for school management platforms. The application includes features like user registration, email verification, password reset, and key management. It is built using these technologies.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Postgres: A relational database(or your preferred database).
- Python 3.10^: The Python programming language.
- Django 5.0 or higher
- Courier: For email services
- AutoPEP8: An auto-formatter for Python code.
https://github.com/RansfordGenesis/Access_Key_Manager.gitor with GithubCLI
gh repo clone RansfordGenesis/Access_Key_Managerpython -m venv venvOR by using the virtualenvwrapper
mkvirtualenv venvActivate the virtual environment with
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txtNote to add a package to the project, run
pip install <package-name>Step 4: Create a .env file in the project's root directory and add the following environment variables, replacing the placeholders with your specific values:
# Postgres env
DB_NAME = #eg. key_manager
DB_USER = #e.g postgres
DB_PASSWORD = #e.g password123
DB_HOST = #e.g localhost
DB_PORT = #e.g 5432
SECRET= #notasecretkey
# Email env
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = #Email account
EMAIL_HOST_PASSWORD = #Email Password
# Courier env
COURIER_TOKEN = #API Token
ACTIVATE_TEMPLATE = #Activate Mail Template
RESET_TEMPLATE = #Reset Mail Template
ADMIN_EMAIL = #Superuser email
ADMIN_PASSWORD = #Superuser passwordNote to uncomment postgres database in settings.py
python manage.py migrate python manage.py createsuperuseror with command script
python manage.py createsu python manage.py runserverAccess_Key_Manager
ββ .gitignore
ββ Access_Key_Manager
β ββ asgi.py
β ββ settings.py
β ββ urls.py
β ββ wsgi.py
β ββ __init__.py
ββ build.sh
ββ key_manager
β ββ admin.py
β ββ apps.py
β ββ migrations
β β ββ 0001_initial.py
β β ββ 0002_accesskey_key_alter_accesskey_date_of_procurement_and_more.py
β β ββ 0003_alter_accesskey_key.py
β β ββ __init__.py
β ββ models.py
β ββ templates
β β ββ key_manager
β β ββ base.html
β β ββ home.html
β ββ tests.py
β ββ urls.py
β ββ views.py
β ββ __init__.py
ββ manage.py
ββ README.md
ββ requirements.txt
ββ users
ββ admin.py
ββ apps.py
ββ forms.py
ββ management
β ββ commands
β ββ createsu.py
ββ migrations
β ββ 0001_initial.py
β ββ __init__.py
ββ models.py
ββ templates
β ββ users
β ββ account_activated.html
β ββ account_activation_invalid.html
β ββ account_activation_sent.html
β ββ account_already_verified.html
β ββ login.html
β ββ password_reset.html
β ββ password_reset_complete.html
β ββ password_reset_confirm.html
β ββ password_reset_done.html
β ββ password_reset_email.html
β ββ password_reset_subject.txt
β ββ signup.html
ββ tests.py
ββ tokens.py
ββ utils.py
ββ views.py
ββ __init__.py
Below is the ER diagram for the Access Key Manager project:
-
Sign Up
- Users can sign up using their email and password.
- After signing up, an email will be sent to the user to verify their account.
-
Email Verification
- Users need to click the link sent to their email to verify their account.
- Once verified, they can log in to the system.
-
Requesting a Key
- Normal users can request a new access key(only if no active key exists).
- Admins can manage all the access keys.
-
Viewing Keys
- Admins can view all the access keys in a paginated format, grouped by user email.
- Users can view details and status of their access keys.
-
Revoking Keys
- Admins can revoke keys that are currently active.
-
Expiration of Keys
- Home function checks for expired keys and changes it's status.
-
API endpoint
- The application has an endpoint to check active key details by school email.
- Django: The web framework used for building the application.
- PostgreSQL: The database used for storing user and key information.
- Bootstrap: The frontend framework for styling and responsive design.
- Courier: For sending email notifications.
- Render: For hosting the application.
