3.2 KiB
URL Manager
A URL management tool that helps you organize and access your links efficiently.
Features
- Create and manage short links
- Template links with dynamic parameters
- Bookmark pages with automatic title and summary extraction
- Advanced search capabilities
- API access
- Asynchronous page processing
Installation
Using Docker (Recommended)
-
Prerequisites:
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/yourusername/url-manager.git cd url-manager -
Build and start services:
./manage-docker.sh build ./manage-docker.sh start
The application will be available at http://localhost:8000
Docker Management Commands
-
Start all services:
./manage-docker.sh start -
Stop all services:
./manage-docker.sh stop -
Restart services:
./manage-docker.sh restart -
View logs:
./manage-docker.sh logs -
Run database migrations:
./manage-docker.sh migrate -
Create new migrations:
./manage-docker.sh makemigrations -
Access Django shell:
./manage-docker.sh shell
Docker Services
The application runs the following services:
web: Django web server (port 8000)celery_worker: Processes background taskscelery_beat: Schedules periodic tasksredis: Message broker and result backend
Manual Installation
If you prefer not to use Docker:
-
Install Python 3.12 and Redis
-
Install dependencies:
pip install -r requirements.txt -
Run migrations:
python manage.py migrate -
Start the development server:
./run_server.sh -
Start Celery worker:
./worker.sh -
Start Celery beat:
./celery_beat.sh
Usage
Managing Links
-
Create a new link:
- Visit
/create/ - Enter the original URL and desired alias
- For template links, use
{param}syntax
- Visit
-
Access a link:
- Use
http://localhost:8000/your-alias - For template links:
http://localhost:8000/your-alias/parameter
- Use
Managing Pages
-
Create a new page:
- Visit
/ui/pages/new/ - Enter the URL
- Title and summary will be automatically extracted
- Visit
-
View all pages:
- Visit
/ui/pages/
- Visit
API Access
The application provides a REST API:
- List pages:
GET /api/pages/ - Create page:
POST /api/pages/
Example:
Monitoring Celery Tasks
The application includes Flower for monitoring Celery tasks. You can access it in two ways:
-
Direct access:
- Visit
http://localhost:5555in your browser
- Visit
-
Using management script:
./manage-docker.sh flower
Flower provides:
- Real-time monitoring of Celery tasks
- Task progress and history
- Worker status and statistics
- Error tracking
- Task graphs and charts
Monitoring Features
-
View all tasks:
- Active tasks
- Scheduled tasks
- Failed tasks
- Success rate
-
Worker information:
- Status
- Resource usage
- Queue length
-
Task details:
- Arguments
- Start time
- Runtime
- Result
- Stack traces for failed tasks