A Django application for logging daily activities.
- User authentication (registration, login, logout)
- Journal entries (create, read, update, delete)
- WYSIWYG (What You See Is What You Get) rich text editor support
- View entries with filter/search by date, tags, and public/private status
- Responsive design using Bootstrap
- Tag management (create, read, delete tags)
- User Profile (view and edit profile information)
- User registers an account.
- User logs in to the application.
- User can create a new journal entry by clicking "New Entry".
- User fills out the entry form with a title and content in the WYSIWYG editor.
- User can save the entry as public or private.
- User can view a list of their journal entries on the dashboard.
- User can filter entries by date range, tags, or public/private status.
- User can edit or delete existing entries.
- User can create and manage tags to categorize entries.
- User can view individual entries with their content rendered from JSON to HTML.
- User can log out of the application.
User: Extends Django's built-in User model for authentication.
JournalEntry:
user: ForeignKey to the User model, linking each entry to its author.title: CharField for the title of the entry.content: JSONField for the content of the entry.date: DateTimeField for the date of the entry, defaulting to the current date and time.is_public: BooleanField to indicate if the entry is public or private.tags: ManyToManyField for associating tags with the entry, allowing for categorization.created_at: DateTimeField for when the entry was created, automatically set to the current date and time.updated_at: DateTimeField for when the entry was last updated, automatically set to the current date and time on save.
Tag:
user: ForeignKey to the User model, linking each tag to its creator.name: CharField for the name of the tag, unique to prevent duplicates.created_at: DateTimeField for when the tag was created, automatically set to the current date and time.updated_at: DateTimeField for when the tag was last updated, automatically set to the current date and time on save.
- Home/Dashboard: Displays a list of journal entries with options to filter by date, tags, and public/private status. (paginated)
- Entry Detail: Displays a single journal entry with its content rendered from JSON to HTML.
- Create/Edit Entry: Form for creating and editing a journal entry with WYSIWYG content.
- User Profile: View and edit user profile information.
/auth/register/: User registration view./auth/login/: User login view./auth/logout/: User logout view./auth/profile/: User profile view and edit./: Home/Dashboard view showing all journal entries./entry/new/: Form for creating a new journal entry./entry/<uuid:id>/: View for a single journal entry./entry/<uuid:id>/edit/: Form for editing an existing journal entry./tags/list/: View for managing tags (creating, deleting)./tags/new/: Form for creating a new tag./tags/tag/<uuid:id>/: View for a specific tag./tags/tag/<uuid:id>/delete/: Route for deleting a specific tag.
Backend: Django (Python 3.11+) Frontend: Django templates with Bootstrap for styling Database: SQLite Editor: Editor.js for WYSIWYG editing capabilities Rendering: Content stored as JSON and rendered using the Editor.js Renderer library
-
Clone the repository:
git clone https://github.com/bobur-yusupov/daylog.git cd daylog -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run migrations:
python manage.py makemigrations python manage.py migrate
-
Create a superuser (optional):
python manage.py createsuperuser
-
Start the development server:
python manage.py runserver
-
User Registration/Login: Navigate to
/register/or/login/to create an account or sign in. -
Creating Entries: Use the "New Entry" button to create journal entries with the WYSIWYG editor.
-
Managing Tags: Create and assign tags to categorize your entries for better organization.
-
Filtering Entries: Use the dashboard filters to view entries by date range, tags, or privacy status.
-
Public/Private Entries: Toggle entry visibility to share publicly or keep private.
POST /api/auth/register/- User registrationPOST /api/auth/login/- User loginPOST /api/auth/logout/- User logoutGET /api/auth/profile/- Get user profile information
GET /api/entries/- List all entries (with filtering)POST /api/entries/- Create new entryGET /api/entries/{id}/- Get specific entryPUT /api/entries/{id}/- Update entryDELETE /api/entries/{id}/- Delete entry
GET /api/tags/- List user's tagsPOST /api/tags/- Create new tagDELETE /api/tags/{id}/- Delete tag
DRF's token authentication is used for API endpoints. Include the token in the Authorization header as follows:
Authorization: Token <your_token>
The dashboard and API responses paginate journal entries with a default page size of 10 entries. Use the page query parameter to navigate between pages.
Journal entries store content as JSON generated by Editor.js. On the frontend, this JSON is parsed and rendered using the Editor.js Renderer library, which reconstructs the rich text layout in HTML.
Use Django's built-in testing framework for testing the application. Run tests using:
python manage.py test- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.