I am working on a Python/ Django project, using Git to manage the version control.
I'm currently having an issue with some inconsistency between the master
branch on my local machine and the live master
branch on the server...
I fixed a bug on my local machine earlier, and pushed the changes to the server, however, a link on one of the pages on the live version on the server is now no longer working, even though it is on my local version...
The link is at: www.mysite.co.uk/costing/id/ - when I click on the link 'Reports', I get an error page that says:
TemplateSyntaxError at /costing/6108/payment-report/overview/
Invalid block tag on line 87: 'date_to_display', expected 'elif', 'else' or 'endif'. Did you forget to register or load this tag?
But on my local machine, on the master
branch, this link works correctly.
Having looked at the template where the live version is complaining about the the invalid block tag
, I can see that it is in the block:
{% block content_payment_schedule %}
{% if not webview %}
<div>
<table>
<tr>
...
</tr>
<tr>
<td>
<span class="project-name">{{project.project_name|upper}}</span>
</td>
<!-- Display today's date in the header -->
<td> {{ date_to_display }}</td>
</tr>
</table>
</div>
{% endif %}
...
{% endblock content_payment_schedule %}
This was something that I had previously added to the code (to display the date in the header of a PDF generated by clicking a link), and has been working up until now...
When I browse to: localhost:8000/costing/id/ and click on the same 'Reports' link, I am taken to the reports page at: localhost:8000/costing/id/payment-report/overview/ (which displays a 'tabbed content' area, with tabs for various reports, with the 'overview' tab automatically selected).
From local machine, while on master
branch, if I try running
git commit -m 'message about commit'
, & then
git push origin master
Git displays a message telling me that:
Everything up-to-date
git status
displays a message saying:
On branch master
nothing to commit, working directory clean
So why is it that I am getting this TemplateSyntaxError
on the live version, when my local version works correctly, and the version on the server is up-to-date with my local version?
Now for your local repo, git status says:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Then you can fetch from remote repo by git fetch origin
, and use git status
to show the local master branch. If it says,
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
that means, your local master branch is not the newest version. If you want the live version (remote master branch) stay same with local master branch, you can use git push -f origin master
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.