fix env file usage
This commit is contained in:
@@ -3,3 +3,4 @@
|
|||||||
/files
|
/files
|
||||||
/subdomain_files
|
/subdomain_files
|
||||||
/logs
|
/logs
|
||||||
|
/.env
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from sanic.exceptions import NotFound, MethodNotAllowed
|
|||||||
from sanic_cors import CORS
|
from sanic_cors import CORS
|
||||||
from sanic_ext import Extend
|
from sanic_ext import Extend
|
||||||
|
|
||||||
from conf import STATIC_DIR
|
from conf import STATIC_DIR, BASE_HOSTS
|
||||||
from utils import get_j2env, get_sort_icon, get_sort_link, resolve_path, list_dir
|
from utils import get_j2env, get_sort_icon, get_sort_link, resolve_path, list_dir
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +17,6 @@ app = Sanic('autoindex', strict_slashes=True)
|
|||||||
Extend(app)
|
Extend(app)
|
||||||
cors = CORS(app)
|
cors = CORS(app)
|
||||||
app.static('/~static/', STATIC_DIR, use_content_range=True, stream_large_files=True)
|
app.static('/~static/', STATIC_DIR, use_content_range=True, stream_large_files=True)
|
||||||
print(STATIC_DIR)
|
|
||||||
j2env = get_j2env(DEBUG)
|
j2env = get_j2env(DEBUG)
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +62,7 @@ async def index(request: Request, path=''):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
print(f'{BASE_HOSTS=}')
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
app.run(host='0.0.0.0', port=8000, debug=True, auto_reload=True)
|
app.run(host='0.0.0.0', port=8000, debug=True, auto_reload=True)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ services:
|
|||||||
- "./subdomain_files:/src/subdomain_files"
|
- "./subdomain_files:/src/subdomain_files"
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
develop:
|
develop:
|
||||||
watch:
|
watch:
|
||||||
- action: sync+restart
|
- action: sync+restart
|
||||||
|
|||||||
Reference in New Issue
Block a user