Project Management
Rhamaa CLI provides powerful commands for creating and managing Wagtail projects. This section covers all project-related commands and their usage.
Creating New Projects
rhamaa start
Create a new Wagtail project using the RhamaaCMS template.
Example:
What it does:
- Downloads Template: Fetches the latest RhamaaCMS template from GitHub
- Creates Project: Uses Wagtail's
startcommand with the template - Sets Up Structure: Configures the project with RhamaaCMS best practices
- Provides Feedback: Shows progress and success confirmation
Template Features:
The RhamaaCMS template includes:
- Modern Django/Wagtail Setup: Latest versions and best practices
- Organized Structure: Logical app organization and settings management
- Development Tools: Pre-configured development dependencies
- Production Ready: Settings for deployment and scaling
- Documentation: README and setup instructions
Project Structure
When you create a project with rhamaa start, you get:
MyProject/
├── MyProject/
│ ├── __init__.py
│ ├── settings/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── dev.py
│ │ └── production.py
│ ├── urls.py
│ └── wsgi.py
├── apps/ # Directory for custom apps
├── static/ # Static files
├── media/ # Media files
├── templates/ # Template files
├── requirements.txt # Python dependencies
├── manage.py # Django management script
└── README.md # Project documentation
Creating Django Apps
rhamaa startapp
Create a new Django app with RhamaaCMS structure within your project.
Example:
Features:
- Structured Layout: Creates apps in the
apps/directory - RhamaaCMS Standards: Follows RhamaaCMS app conventions
- Ready to Use: Includes basic model, view, and admin setup
- Template Types:
--type wagtail(default) or--type minimal - Prebuilt Apps: Install with
--prebuild <key>and view availability with--list
Project Validation
Rhamaa CLI automatically validates your project environment:
Wagtail Project Detection
Before allowing certain operations, Rhamaa CLI checks if you're in a valid Wagtail project by looking for:
manage.pyfile- Django settings files
- Common project indicators
Error Handling
If you're not in a Wagtail project, you'll see:
Error: This doesn't appear to be a Wagtail project.
Please run this command from the root of your Wagtail project.
Best Practices
Project Naming
- Use PascalCase for project names:
MyBlog,CompanyWebsite - Avoid spaces and special characters
- Keep names descriptive but concise
Directory Structure
- Keep custom apps in the
apps/directory - Use the
static/directory for static files - Store templates in the
templates/directory - Keep media files in
media/(for development)
Settings Management
The RhamaaCMS template uses environment-based settings:
base.py- Common settingsdev.py- Development settingsproduction.py- Production settings
Advanced Usage
Custom Templates
While Rhamaa CLI uses the RhamaaCMS template by default, you can still use Wagtail's native template system:
Environment Variables
Set up environment variables for your project:
Troubleshooting
Template Download Issues
If template download fails:
- Check Internet Connection: Ensure you have a stable connection
- GitHub Access: Verify you can access GitHub
- Wagtail Installation: Make sure Wagtail is installed
Permission Errors
On some systems, you might need elevated permissions:
Or use a virtual environment:
python -m venv myenv
source myenv/bin/activate # Linux/Mac
pip install rhamaa wagtail
rhamaa start MyProject
Project Already Exists
If a directory with the same name exists:
Choose a different name or remove the existing directory.
Integration with Other Tools
Version Control
Initialize Git repository after project creation:
IDE Setup
The RhamaaCMS template works well with:
- VS Code: Includes recommended extensions
- PyCharm: Django project detection
- Sublime Text: Python syntax highlighting
Deployment
The template is ready for deployment to:
- Heroku: Includes Procfile and requirements
- Docker: Dockerfile included
- Traditional Hosting: WSGI configuration ready
Next Steps
After creating your project:
- Set Up Environment: Create virtual environment and install dependencies
- Add Applications: Use
rhamaa startapp <AppName> --prebuild <key>to install prebuilt apps (seerhamaa startapp --list) - Configure Settings: Customize settings for your needs
- Run Migrations: Set up the database
- Create Superuser: Access the admin interface
See the App Management section for adding prebuilt applications to your project.