Skip to content

Commit

Permalink
Run manage.py directly instead of as a argument to python
Browse files Browse the repository at this point in the history
This allow us to switch to python 3 by modifying the #! line
in manage.py instead of having to change python to python3
in several places.

Replated to issue Frikanalen#138.
  • Loading branch information
petterreinholdtsen committed Jan 1, 2019
1 parent 60f22e8 commit b1e8049
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ WORKDIR /srv/frikanalen
RUN pip install -r requirements-dev.txt

WORKDIR /srv/frikanalen/fkbeta
RUN python manage.py migrate
RUN python manage.py loaddata frikanalen
RUN ./manage.py migrate
RUN ./manage.py loaddata frikanalen

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
CMD ["./manage.py", "runserver", "0.0.0.0:8000"]

EXPOSE 8000
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ docker_run: docker
docker_push:
docker push ${project}
test:
python fkbeta/manage.py test fkbeta
fkbeta/manage.py test fkbeta
python utils/test_*.py
4 changes: 2 additions & 2 deletions infra/roles/web/templates/update.githook.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export DATABASE_NAME={{app_db_name}}

# should only do these when required
pip install -qr "$dir/requirements.txt"
python fkbeta/manage.py collectstatic --noinput
python fkbeta/manage.py migrate --noinput
fkbeta/manage.py collectstatic --noinput
fkbeta/manage.py migrate --noinput

sudo systemctl restart fkweb

Expand Down

0 comments on commit b1e8049

Please sign in to comment.