from django.db import models
class Vocabulary(models.Model):
word = models.CharField(max_length=100)
meaning = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
from rest_framework import viewsets
from .models import Vocabulary
from .serializers import VocabularySerializer
class VocabularyViewSet(viewsets.ModelViewSet):
queryset = Vocabulary.objects.all()
serializer_class = VocabularySerializer
vocab/serializers.py
from rest_framework import serializers
from .models import Vocabulary
class VocabularySerializer(serializers.ModelSerializer):
class Meta:
model = Vocabulary
fields = '__all__'
config/urls.py
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from vocab.views import VocabularyViewSet
from django.http import JsonResponse
router = DefaultRouter()
router.register(r'vocab', VocabularyViewSet)
def root_view(request):
return JsonResponse({"message": "Vocab API is running!"})
urlpatterns = [
path('', root_view),
path('api/', include(router.urls)),
path('admin/', include('django.contrib.admin.urls')),
]
IAM is required as an auth provider to use content management capabilities. To automatically add IAM and enable content management, navigate to 'Data' and select 'Save and Deploy'.
と表示されました。
この画面で Go to Data Model をクリックして遷移した先で, Save and Deploy をしたところ、
An error occurred while processing your request: Deployment failed because your app backend contains hosting. Amplify Studio only supports API, Auth, and Storage deployments. Please use the Amplify CLI to deploy updates.
となってしまいました。
解決方法
私の場合 hosting を試しに使用していたのが問題でした。
amplify remove hosting
再度バックエンドをプッシュ
amplify push
その後 Amplify Studio の Data に移動し、 Save and Deploy をしたところ、deployが成功しました!
この後 content / Data Manager に戻って無事amplify studio からデータの操作ができるのを確認できました!
TypeError: Cannot destructure property 'ReactCurrentDispatcher' of 'react__WEBPACK_IMPORTED_MODULE_0___default(...).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' as it is undefined.
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart' show defaultTargetPlatform, kIsWeb, TargetPlatform;
import 'package:flutter_dotenv/flutter_dotenv.dart';
/// Default [FirebaseOptions] for use with your Firebase apps.
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
throw UnsupportedError('DefaultFirebaseOptions have not been configured for android.');
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError('DefaultFirebaseOptions have not been configured for macos.');
case TargetPlatform.windows:
throw UnsupportedError('DefaultFirebaseOptions have not been configured for windows.');
case TargetPlatform.linux:
throw UnsupportedError('DefaultFirebaseOptions have not been configured for linux.');
default:
throw UnsupportedError('DefaultFirebaseOptions are not supported for this platform.');
}
}
static final FirebaseOptions ios = FirebaseOptions(
apiKey: dotenv.env['FIREBASE_IOS_API_KEY']!,
appId: dotenv.env['FIREBASE_IOS_APP_ID']!,
messagingSenderId: dotenv.env['FIREBASE_IOS_MESSAGING_SENDER_ID']!,
projectId: dotenv.env['FIREBASE_IOS_PROJECT_ID']!,
storageBucket: dotenv.env['FIREBASE_IOS_STORAGE_BUCKET']!,
iosBundleId: dotenv.env['FIREBASE_IOS_BUNDLE_ID']!,
);
static final FirebaseOptions web = FirebaseOptions(
apiKey: dotenv.env['FIREBASE_WEB_API_KEY']!,
authDomain: dotenv.env['FIREBASE_WEB_AUTH_DOMAIN']!,
projectId: dotenv.env['FIREBASE_WEB_PROJECT_ID']!,
storageBucket: dotenv.env['FIREBASE_WEB_STORAGE_BUCKET']!,
messagingSenderId: dotenv.env['FIREBASE_WEB_MESSAGING_SENDER_ID']!,
appId: dotenv.env['FIREBASE_WEB_APP_ID']!,
measurementId: dotenv.env['FIREBASE_WEB_MEASUREMENT_ID'],
);
}
══════════
No valid code signing certificates were found
You can connect to your Apple Developer account by signing in with
your Apple ID
in Xcode and create an iOS Development Certificate as well as a
Provisioning
Profile for your project by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner'
target
in the project settings
3- Make sure a 'Development Team' is selected under Signing &
Capabilities > Team.
You may need to:
- Log in with your Apple ID in Xcode first
- Ensure you have a valid unique Bundle ID
- Register your device with your Apple Developer Account
- Let Xcode automatically provision a profile for your app
4- Build or run your project again
5- Trust your newly created Development Certificate on your iOS
device
via Settings > General > Device Management > [your new
certificate] > Trust
For more information, please visit:
https://developer.apple.com/library/content/documentation/IDEs/Conce
ptual/
AppDistributionGuide/MaintainingCertificates/MaintainingCertificates
.html
Or run on an iOS simulator without code signing
══════════════════════════════════════════════════════════════════════
══════════
No development certificates available to code sign app for device
deployment
解決法
terminal で ios/Runner.xcworkspace ファイルを開く
open ios/Runner.xcworkspace
こんな感じで xcode が立ち上がる。
Xcodeで「Runner」プロジェクトを選択
「Signing & Capabilities」タブを開く
私の場合、久しぶりのストアアップロードで規約に同意していないのが原因でした。
Unable to process request – PLA Update available You currently don’t have access to this membership resource. To resolve this issue, agree to the latest Program License Agreement in your developer account.
import React from 'react';
import ReactDOM from 'react-dom/client'
import './styles/index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
// helmet
import { HelmetProvider } from 'react-helmet-async';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<HelmetProvider>
<App />
</HelmetProvider>
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();