Comments (14)
from hero-app.
Hi!
It seems you have generated some new migration file, because I don't have any with such name - "abf1ce0bccc0". I believe it is located by this path "migrations/versions/abf1ce0bccc0.py".
So If you want me to help you, you need:
- to provide the content of your migration file "migrations/versions/abf1ce0bccc0.py";
- give me the whole log of the error.
Waiting for your response)
from hero-app.
from hero-app.
You have forgot to add .env file to the root of your repository, the content of the .env file should be like this:
# BASE
API_V1_PREFIX="/api/v1"
DEBUG=True
PROJECT_NAME="Heroes App (local)"
VERSION="0.1.0"
DESCRIPTION="The API for Heroes app."
# DATABASE
DB_ASYNC_CONNECTION_STR="postgresql+asyncpg://hero:[email protected]:5436/heroes_db"
DB_ASYNC_TEST_CONNECTION_STR="postgresql+asyncpg://hero:[email protected]:5436/heroes_db_tests"
DB_EXCLUDE_TABLES="[]"
Pay attention to the connection string it should comply with your database settings
from hero-app.
from hero-app.
Well, .env file looks fine.
The error related to the failure of reading environment variables by pydantic Settings. Do you run alembic upgrade head
command from the project root directory?
from hero-app.
from hero-app.
Ok, I see the problem.
Use this command to build Docker container: docker build --build-arg ENV_FILE=".env" -t hero-app -f Dockerfile .
And this command to start container: docker run -d -p "8080:80" --name hero-app hero-app
Also pay attention to connection strings, i.e. on Mac OSX database on localhost would look like this: postgresql+asyncpg://hero:[email protected]:5436/heroes_db
from hero-app.
from hero-app.
from hero-app.
Please tell me what OS do you use, and where is your database located (local, docker, external)?
from hero-app.
from hero-app.
- You have opened port 5432 in docker for your database, and 5436 in your
.env
file, so you need 5432 in your.env
file. So the lines should look like this:DB_ASYNC_CONNECTION_STR="postgresql+asyncpg://{your_user}:{your_password}@localhost:5432/heroes_db"
- As I understand your issue - you have another app with tables and data in it and you want to migrate the service to fastapi. So you need to create app with fastapi with all tables and then migrate your data from Django database to a new one with.
from hero-app.
from hero-app.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hero-app.