Access Key Manager is a Django-based web application that allows users to sign up, sign in, and reset their passwords. The project leverages Tailwind CSS for modern, responsive styling. Admin generates access keys for schools to be used on their systems to get access to a school management system after paying for the key instead
- User authentication (sign up, sign in, sign out)
- Password reset functionality
- Tailwind CSS for responsive UI
- Custom Django forms for authentication
- Access key generation and management
- Python 3.x
- Django 3.x or higher
- Virtual environment tool (optional but recommended)
-
Clone the repository:
git clone https://github.com/yourusername/access-key-manager.git cd access-key-manager
-
Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Apply database migrations:
python manage.py migrate
-
Create a superuser to access the Django admin:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Install Node.js and npm if you haven't already. You can download it from nodejs.org.
-
Install Tailwind CSS pip:
python -m pip install django-tailwind
-
For automatic reload install django-browser-reload:
python -m pip install 'django-tailwind[reload]'
-
Add Tailwind to
INSTALLED_APPS
insettings.py
: In your project's CSS file (e.g.,static/css/styles.css
), include the following:INSTALLED_APPS = [ # other Django apps 'tailwind', ]
-
Create a Tailwind CSS compatible Django app: NOTE: default app name is
theme
, enter the name you would like or press enter to continue, I used the default.python manage.py tailwind init
-
Add your newly created
'theme'
app toINSTALLED_APPS
insettings.py
:INSTALLED_APPS = [ # other Django apps 'tailwind', 'theme' ]
-
Register the generated
'theme'
app by adding the following line tosettings.py
file:INSTALLED_APPS = [ # other Django apps 'tailwind', 'theme' ]
-
Make sure that the
INTERNAL_IPS
list is present in thesettings.py
file and contains the127.0.0.1
ip addressINTERNAL_IPS = [ "127.0.0.1", ]
-
Install Tailwind CSS dependencies, by running the following command:
NOTE: There might be issues running the install, go tosettings.py
and editNPM_BIN_PATH = '/usr/local/bin/npm'
per the node location your OS. Read morepython manage.py tailwind install
-
Finally, Start the Tailwind CSS development server by running the following command in your terminal:
python manage.py tailwind start
To start the development server, run:
python manage.py runserver
Visit http://127.0.0.1:8000/
in your browser to see the application.
access_key_manager/
│
├── key_manager/
│ ├── migrations/
│ ├── templates/
│ │ ├── keymanager/
| | | ├── keydetails.html
| | | ├── keylist.html
│ │ │ ├── password_reset_form.html
│ │ │ ├── password_reset_done.html
│ │ │ ├── password_reset_confirm.html
│ │ │ ├── password_reset_complete.html
│ │ │ ├── signin.html
│ │ │ ├── signup.html
│ │ ├── base.html
| | ├── home.html
| ├── theme
| | ├── static
| | | ├── css
| | | | ├── dist
| | | | | ├── styles.css
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── models.py
│ ├── tests.py
│ ├── views.py
│
├── access_key_manager/
│ ├── __init__.py
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
│
├── db.sqlite3
├── manage.py
└── requirements.txt
- Sign Up: Users can sign up for a new account.
- Sign In: Existing users can sign in.
- Password Reset: Users can reset their password if they forget it.
All forms are styled using Tailwind CSS classes. Ensure you've run the Tailwind build process to generate the necessary CSS.
- Django: Backend framework
- Tailwind CSS: Frontend styling
- HTML5: Markup language
- JavaScript: Interactivity
To design an Entity-Relationship (ER) diagram for the Access Key Manager project, we need to identify the entities and their relationships based on the project requirements and functionalities. Since this project is primarily focused on user authentication and password management, the entities and relationships will be straightforward.
- User: This entity represents users of the application.
- PasswordReset: This entity represents password reset requests made by users.
-
User:
id
: Primary Keyusername
: Unique identifier for the useremail
: Email address of the userpassword
: Hashed password of the userfirst_name
: First name of the userlast_name
: Last name of the user
-
PasswordReset:
id
: Primary Keyuser_id
: Foreign Key referencingUser
reset_token
: Unique token for password resetcreated_at
: Timestamp of when the reset request was createdused
: Boolean indicating whether the reset request has been used
- User to PasswordReset: One-to-Many (One user can have many password reset requests)
Here's a textual representation of the ER diagram:
+-------------------+ +-------------------+
| User | | PasswordReset |
+-------------------+ +-------------------+
| id (PK) |<----| id (PK) |
| username | | user_id (FK) |
| email | | reset_token |
| password | | created_at |
+-------------------+ | used |
+-------------------+