Comments (8)
Hello @jymchng you make sure that you set your custom domain in environment variables. or use you public IP
EXT_ENDPOINT1=mycustomwebsite.com so that I can get access with both mycustomwebsite.com or fastapi.mycustomwebsite.com
EXT_ENDPOINT1=172.10.10.10 so that I can get access to 172.10.10.10. Subdomains do not work with IP addresses, so I recommend you get a custom domain on servers.
from fastapi-alembic-sqlmodel-async.
Hello @jymchng this can be helpful. The project uses Caddy as reverse proxy which automatically creates SSL certificates
#59 (comment)
Another option could be using cloudflare and providing a certificate using its free https proxy
from fastapi-alembic-sqlmodel-async.
Thank you for your response @jonra1993, I wish I can give you more stars than what you have now!
from fastapi-alembic-sqlmodel-async.
@jonra1993 Thank you for your reply. Just another follow up question, how can I get from HTTP to HTTPS? Thank you.
from fastapi-alembic-sqlmodel-async.
Hello @jonra1993, thank you for your helpful reply!
I have another question.
Let's say I have a Project
table, shown below:
from sqlmodel import SQLModel
class Project(SQLModel, table=True):
featured: bool = False
If I have an API that sets the Project.featured = True
but I want it to be set to False
3 days later. What suggestions do you have to achieve this?
Thank you.
from fastapi-alembic-sqlmodel-async.
Hello @jymchng I think that is a crontab task you can use celery beats and create a celery task after someone changes featured to True. Something like this
https://github.com/jonra1993/fastapi-alembic-sqlmodel-async/blob/main/backend/app/app/api/v1/endpoints/periodic_tasks.py
on crontab you calculate 3 days after right now
periodic_task.crontab = CrontabSchedule(
hour=22, minute=14, day_of_month=29, month_of_year=3, timezone="UTC"
)
from fastapi-alembic-sqlmodel-async.
Hi @jonra1993, thank you for this awesome template.
After I tried to deploy with your Caddyfile, attempting to enable HTTPS, this is the error I got:
caddy_reverse_proxy | {"level":"error","ts":1680712202.3448455,"logger":"http.acme_client","msg":"validating authorization","identifier":"static.mycustomdomain.com","problem":{"type":"urn:ietf:params:acme:error:dns","title":"","detail":"DNS problem: NXDOMAIN looking up A for static.mycustomdomain.com - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for static.mycustomdomain.com - check that a DNS record
exists for this domain","instance":"","subproblems":[]},"order":"https://acme-staging-v02.api.letsencrypt.org/acme/order/96894614/8124165414","attempt":2,"max_attempts":3}
I am running docker-compose-dev.yml for testing on my local machine. What should I do?
from fastapi-alembic-sqlmodel-async.
Hello @jymchng you can not use SSL perfectly locally because you will require a public static IP also your local router should allow public connections and a DNS server which points A record to your PC public IP.
The error says that mycustomdomain.com is not in your local namespace and Cady can not generate a SSL certificate.
For development, I recommend you use HTTP. If you want to use SSL which is for production better use a remote server and connect a custom domain using a DNS server like Cloudflare which points the custom domain to your remote server. In such a situation, it is going to work perfectly. something like this
I hope it can help.
from fastapi-alembic-sqlmodel-async.
Related Issues (20)
- AuthZ with supertokens HOT 6
- Migration from Sqlmodel to SQLAlchemy 2.0 HOT 3
- Function get_multi_paginated_ordered in base_crud.py HOT 2
- make run-pgadmin fails to run. HOT 1
- How to update many-to-many, and where celery_schedule_jobs table HOT 4
- celery beat is not going in correct table HOT 1
- Mypy Integration HOT 1
- New routes not reflecting in docs
- SQLAlchemy models with circular references update RecursionError
- Many to many data insert HOT 3
- Stuck in filters HOT 2
- How to pass token for protected routes in Swagger? HOT 2
- Task completed but still shows pending HOT 3
- Few issues getting set up (DB, pgadmin, fastAPI reloading, websockets) HOT 4
- Sqlmodel, pydantic update HOT 2
- Where or how to obtain a database session for a task HOT 1
- Exception "got Future <Future pending> attached to a different loop" HOT 2
- Replace Celery to Prefect HOT 1
- joined unique() question HOT 3
- Cannot connect to Redis error HOT 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 fastapi-alembic-sqlmodel-async.