Introduction
This guide covers deploying Django applications on Shard Cloud. Django is a high-level Python web framework for rapid development.Creating Your Project
Ensure you have Python and pip installed.Installing Django
Creating a New Project
Basic Django Application
Create a simple view inmyproject/views.py:
myproject/views.py
myproject/urls.py:
myproject/urls.py
Settings Configuration
Updatemyproject/settings.py:
Requirements File
Create arequirements.txt:
requirements.txt
Production Server with Gunicorn
Shard Cloud Configuration
Create a.shardcloud file:
.shardcloud
Run migrations locally before deploying:
python manage.py migrateDeploying
1
Run Migrations Locally
python manage.py migrate python manage.py collectstatic --noinput
2
Prepare Your Files
Ensure you have: - Your Django project folder -
requirements.txt -
.shardcloud - db.sqlite3 (if using SQLite)3
Exclude Unnecessary Files
Remove:
__pycache__/, venv/, *.pyc4
Create ZIP Archive
Compress your project folder.
5
Upload to Shard Cloud
Go to Shard Cloud Dashboard and
upload.
Additional Resources
Visit the official Django documentation for more information.Troubleshooting
DisallowedHost error
DisallowedHost error
Add your domain to
ALLOWED_HOSTS in settings.py or use ['*'].Static files not loading
Static files not loading
Run
python manage.py collectstatic before deploying.