Loading repository data…
Loading repository data…
christadrian / repository
The alxtravelapp project is a real-world Django application that serves as the foundation for a travel listing platform. This milestone focuses on setting up the initial project structure, configuring a robust database, and integrating tools to ensure API documentation and maintainable configurations.
The ALX Travel App is a Django-based application designed to serve as a robust travel listing platform. The project follows best practices in backend setup, database integration, API documentation, and version control. This project is part of the ALX program and aims to provide hands-on experience in building scalable web applications using Django and MySQL.
alx_travel_app/
├── manage.py
├── env/
├── README.md
├── .env
└── alx_travel_app/
├── __init__.py
├── settings.py
├── urls.py
├── wsgi.py
├── asgi.py
└── listings/
├── __init__.py
├── admin.py
├── apps.py
├── models.py
├── views.py
├── urls.py
└── migrations/
git clone https://github.com/yourusername/alx_travel_app.git
cd alx_travel_app
pip install virtualenv
virtualenv env
source env/bin/activate # On Windows: env\Scripts\activate
pip install -r alx_travel_app/requirement.txt
CREATE DATABASE alxtravelapp;
CREATE USER 'alxuser'@'localhost' IDENTIFIED BY 'securepassword';
GRANT ALL PRIVILEGES ON alxtravelapp.* TO 'alxuser'@'localhost';
FLUSH PRIVILEGES;
touch alx_travel_app/.env
Add the following:
SECRET_KEY=your_secret_key
DEBUG=True
ALLOWED_HOSTS=127.0.0.1,localhost
DATABASE_NAME=your_database_name
DATABASE_USER=your_database_user
DATABASE_PASSWORD=securepassword
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3306
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
Access at: http://127.0.0.1:8000/admin/
Swagger is integrated for automated API documentation. Access it at:
http://127.0.0.1:8000/swagger/
Example Endpoint:
Hello World Endpoint:
/api/listings/hello/{"message": "Hello, ALX Travel App!"}The project is managed using Git.
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/yourusername/alx_travel_app.git
git push -u origin main