make some changes to environment variable handling
This commit is contained in:
parent
1471dab714
commit
f415713bdb
|
@ -1,2 +1,2 @@
|
||||||
SECRET_KEY=change_me
|
SECRET_KEY=834701
|
||||||
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
|
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
prod: # execute this target on the production server in the nix-shell
|
||||||
|
rm -r franklincce/staticfiles
|
||||||
|
cd franklincce; python3 manage.py collectstatic
|
||||||
|
sed -i "s/change_me/$(shell shuf -i1-1000000 -n1)/g" .env.prod
|
||||||
|
docker-compose -f docker-compose.prod.yml up -d --build
|
|
@ -19,14 +19,14 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
SECRET_KEY = os.environ.get("SECRET_KEY")
|
SECRET_KEY = os.environ.get("SECRET_KEY")
|
||||||
|
|
||||||
DEBUG = os.environ.get("DEBUG", default=0)
|
DEBUG = bool(os.environ.get("DEBUG", default=0))
|
||||||
print(DEBUG)
|
|
||||||
DEBUG = bool(DEBUG)
|
|
||||||
print(DEBUG)
|
|
||||||
|
|
||||||
# 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each.
|
# 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each.
|
||||||
# For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]'
|
# For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]'
|
||||||
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
|
try:
|
||||||
|
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
|
||||||
|
except:
|
||||||
|
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'explorer.apps.ExplorerConfig',
|
'explorer.apps.ExplorerConfig',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs.python311Packages; [ django pymupdf ] ++ [pkgs.docker-compose] ;
|
nativeBuildInputs = with pkgs.python311Packages; [ django pymupdf ] ++ [pkgs.docker-compose pkgs.gnumake] ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue