-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3607d2
commit d41edf2
Showing
7 changed files
with
127 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.PHONY: all help translate test clean update compass collect rebuild | ||
|
||
SETTINGS={{ project_name }}.settings | ||
TEST_SETTINGS={{ project_name }}.test_settings | ||
|
||
# target: all - Default target. Does nothing. | ||
all: | ||
@echo "Hello $(LOGNAME), nothing to do by default" | ||
@echo "Try 'make help'" | ||
|
||
# target: help - Display callable targets. | ||
help: | ||
@egrep "^# target:" [Mm]akefile | ||
|
||
# target: translate - calls the "makemessages" django command | ||
translate: | ||
cd {{ project_name }} && django-admin.py makemessages --settings=$(SETTINGS) -i "site-static/*" -a --no-location | ||
|
||
# target: test - calls the "test" django command | ||
test: | ||
django-admin.py test --settings=$(TEST_SETTINGS) | ||
|
||
# target: clean - remove all ".pyc" files | ||
clean: | ||
django-admin.py clean_pyc --settings=$(SETTINGS) | ||
|
||
# target: update - install (and update) pip requirements | ||
update: | ||
pip install -U -r requirements.pip | ||
|
||
# target: compass - compass compile all scss files | ||
compass: | ||
cd {{ project_name }}/compass && compass compile | ||
|
||
# target: collect - calls the "collectstatic" django command | ||
collect: | ||
django-admin.py collectstatic --settings=$(SETTINGS) --noinput | ||
|
||
# target: rebuild - clean, update, compass, collect, then rebuild all data | ||
rebuild: clean update compass collect | ||
django-admin.py reset_db --settings=$(SETTINGS) --router=default --noinput | ||
django-admin.py syncdb --settings=$(SETTINGS) --noinput | ||
django-admin.py migrate --settings=$(SETTINGS) | ||
#django-admin.py loaddata --settings=$(SETTINGS) <your fixtures here> | ||
|
||
run: | ||
python manage.py runserver | ||
|
||
startenv: | ||
pipenv shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Run Task</title> | ||
<style type="text/css"> | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
.imgbox { | ||
display: grid; | ||
height: 100%; | ||
} | ||
.center-fit { | ||
max-width: 100%; | ||
max-height: 100vh; | ||
margin: auto; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<img class="center-fit" src="{{ task.image.url }}" alt="Image not found" /> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pipenv shell | ||
python manage.py runserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
from datetime import datetime | ||
|
||
from django.http import HttpResponseRedirect | ||
from django.views.generic import TemplateView | ||
|
||
from experiments.models import Task | ||
from experiments.services.next_task_service import NextTaskService | ||
|
||
|
||
class ViewTask(TemplateView): | ||
template_name = 'view_task.html' | ||
|
||
def get_context_data(self, **kwargs): | ||
# Call the base implementation first to get a context | ||
context = super(ViewTask, self).get_context_data(**kwargs) | ||
|
||
task = Task.objects.get(pk=self.kwargs['task_id']) | ||
context['task'] = task | ||
|
||
return context |