Backend Deployment
Backend Deployment
1. Install Flutter:
○ Follow the instructions on the Flutter install page to install Flutter on your
machine.
2. Set Up Android Studio/Xcode:
○ Android Studio: Install and configure Android Studio. Ensure you have the
Android SDK installed.
○ Xcode: Install Xcode from the App Store if you are targeting iOS.
3. Prepare the Mobile App:
○ Open a terminal and navigate to the Sema-mobile-main directory:
cd path/to/Sema-mobile-main
○ Fetch the dependencies:
flutter pub get
○ Run the app on an emulator or connected device:
flutter run
○ If you encounter issues, ensure you have the necessary Flutter and Dart SDK
paths set in your environment variables.
Android:
flutter build apk
iOS:
flutter build ios
● Follow the instructions in the Flutter iOS deployment guide for additional steps like
setting up provisioning profiles and signing certificates.
○
2. Navigate to Backend Directory:
cd path/to/sema-top-backend-main
○
3. Install Dependencies:
○
4. Configure the Application:
Open the settings.py file in the Django project and configure your database settings. For
example, if you are using PostgreSQL:
python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_db_password',
'HOST': 'localhost',
'PORT': '5432',
}
}
○
○ Set up environment variables as needed.
5. Apply Database Migrations:
○
○ Access the server at http://127.0.0.1:8000/.
heroku login
○
2. Create a New Heroku App:
heroku create
○
3. Set Up Database:
○
4. Set Up Environment Variables:
○ Configure your environment variables on Heroku (e.g., SECRET_KEY, DEBUG,
DATABASE_URL).
5. Deploy to Heroku:
Ensure you have a Procfile in your project directory with the following content:
c
git init
git add .
git commit -m "Initial commit"
○
6. Run Database Migrations on Heroku: