Fixed static files for admin
This commit is contained in:
parent
8e9d185293
commit
4bf2eb6389
4 changed files with 28 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
|||
/static/
|
||||
!/static/.gitkeep
|
||||
|
||||
### OSX ###
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
|
|
|
@ -40,6 +40,8 @@ COPY . /home/app/code/
|
|||
|
||||
RUN chown -R app: /home/app
|
||||
|
||||
RUN python3 /home/app/code/manage.py collectstatic --no-input
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["/usr/sbin/uwsgi", "--ini", "/home/app/code/uwsgi.ini", "--plugin", "python3"]
|
||||
USER app
|
||||
|
|
|
@ -37,6 +37,8 @@ LOGOUT_REDIRECT_URL = "/"
|
|||
|
||||
ITEMS_PER_PAGE = 30
|
||||
|
||||
STATIC_ROOT = "static/"
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
|
|
12
manage.py
12
manage.py
|
@ -6,10 +6,20 @@ from os import path
|
|||
|
||||
if __name__ == '__main__':
|
||||
env_path = path.join(path.dirname(path.realpath(__file__)), '.env')
|
||||
if not os.path.exists(env_path) and len(sys.argv) >= 2 and len(sys.argv) <= 3 \
|
||||
and sys.argv[1] == 'collectstatic':
|
||||
os.environ['POSTGRES_DB'] = ''
|
||||
os.environ['POSTGRES_HOST'] = ''
|
||||
os.environ['POSTGRES_USER'] = ''
|
||||
os.environ['POSTGRES_PASSWORD'] = ''
|
||||
os.environ['DEBUG'] = 'false'
|
||||
os.environ['ALLOWED_HOSTS'] = ''
|
||||
os.environ['SECURITY_KEY'] = 'dummy-value'
|
||||
else:
|
||||
load_dotenv(verbose=True,dotenv_path=env_path)
|
||||
|
||||
check_env_vars = ['POSTGRES_DB', 'POSTGRES_HOST', 'POSTGRES_PASSWORD',
|
||||
'POSTGRES_USER', 'DEBUG', 'ALLOWED_HOSTS']
|
||||
'POSTGRES_USER', 'DEBUG', 'ALLOWED_HOSTS', 'SECURITY_KEY']
|
||||
|
||||
for key in check_env_vars:
|
||||
if key not in os.environ:
|
||||
|
|
Loading…
Reference in a new issue