-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from NathanWorkman/release/v0.2.0
Release/v0.2.0
- Loading branch information
Showing
13 changed files
with
238 additions
and
46 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,128 @@ | ||
PROJECT_NAME = seeker | ||
SHELL := /bin/sh | ||
help: | ||
@echo "Please use 'make <target>' where <target> is one of" | ||
@echo "virtualenv Create virtual enviroment" | ||
@echo "requirements Install requirements.txt" | ||
@echo "migrate Run Django migrations" | ||
@echo "user Create user account" | ||
@echo "test Run tests" | ||
@echo "clean Remove all *.pyc, .DS_Store and temp files from the project" | ||
@echo "shell Open Django shell" | ||
@echo "migrations Create database migrations" | ||
@echo "collectstatic Collect static assets" | ||
@echo "run Run Django Server" | ||
@echo "crawl <spidername> Run Scrapy Spider" | ||
|
||
.PHONY: requirements | ||
|
||
|
||
# Command variables | ||
MANAGE_CMD = python manage.py | ||
PIP_INSTALL_CMD = pip install | ||
PLAYBOOK = ansible-playbook | ||
VIRTUALENV_NAME = venv | ||
|
||
# Helper functions to display messagse | ||
ECHO_BLUE = @echo "\033[33;34m $1\033[0m" | ||
ECHO_RED = @echo "\033[33;31m $1\033[0m" | ||
ECHO_GREEN = @echo "\033[33;32m $1\033[0m" | ||
|
||
# The default server host local development | ||
HOST ?= localhost:8000 | ||
|
||
reset: delete_sqlite migrate user run | ||
|
||
virtualenv: | ||
# Create virtualenv | ||
virtualenv -p python3 $(VIRTUALENV_NAME) | ||
|
||
requirements: | ||
# Install project requirements | ||
( \ | ||
source venv/bin/activate;\ | ||
$(PIP_INSTALL_CMD) -r requirements.txt; \ | ||
) | ||
|
||
migrate: | ||
# Run django migrations | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) migrate; \ | ||
) | ||
|
||
user: | ||
# Create user account | ||
( \ | ||
cd seeker; \ | ||
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@email.com', 'pass')" | ./manage.py shell; \ | ||
) | ||
|
||
test: | ||
# Run the test cases | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) test; \ | ||
) | ||
|
||
clean: | ||
# Remove all *.pyc, .DS_Store and temp files from the project | ||
$(call ECHO_BLUE,removing .pyc files...) | ||
@find . -name '*.pyc' -exec rm -f {} \; | ||
$(call ECHO_BLUE,removing static files...) | ||
@rm -rf $(PROJECT_NAME)/_static/ | ||
$(call ECHO_BLUE,removing temp files...) | ||
@rm -rf $(PROJECT_NAME)/_tmp/ | ||
$(call ECHO_BLUE,removing .DS_Store files...) | ||
@find . -name '.DS_Store' -exec rm {} \; | ||
|
||
shell: | ||
# Run a local shell for debugging | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) shell; \ | ||
) | ||
|
||
migrations: | ||
# Create database migrations | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) makemigrations; \ | ||
) | ||
|
||
migrate: | ||
# Run database migrations | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) migrate; \ | ||
) | ||
|
||
collectstatic: | ||
# Collect static assets | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) collectstatic; \ | ||
) | ||
|
||
run: | ||
# run django server | ||
$(call ECHO_GREEN, Starting Django Server...) | ||
( \ | ||
cd seeker; \ | ||
$(MANAGE_CMD) runserver; \ | ||
) | ||
|
||
crawl: | ||
# Run scrapy spider | ||
$(call ECHO_GREEN, Running $(spider) spider... ) | ||
(\ | ||
cd seeker; \ | ||
scrapy crawl $(spider); \ | ||
) | ||
|
||
delete_sqlite: | ||
# delete project db | ||
( \ | ||
cd seeker; \ | ||
rm -rf db.sqlite3;\ | ||
) |
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
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
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
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
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,24 @@ | ||
{% if is_paginated %} | ||
<nav class="m-4"> | ||
<ul class="pagination justify-content-center"> | ||
{% if page_obj.has_previous %} | ||
<li class="page-item"><a href="?page={{ page_obj.previous_page_number }}" class="page-link">Previous</a></li> | ||
{% else %} | ||
<li class="page-item disabled"><a href="" class="page-link disabled">Previous</a></li> | ||
{% endif %} | ||
{% for i in paginator.page_range %} | ||
{% if page_obj.number == i %} | ||
<li class="page-item active"><span class="page-link">{{ i }} <span class="sr-only">(current)</span></span> | ||
</li> | ||
{% else %} | ||
<li class="page-item"><a href="?page={{ i }}" class="page-link">{{ i }}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
{% if page_obj.has_next %} | ||
<li class="page-item"><a href="?page={{ page_obj.next_page_number }}" class="page-link">Next</a></li> | ||
{% else %} | ||
<li class="page-item disabled"><span class="page-link">Next</span></li> | ||
{% endif %} | ||
</ul> | ||
</nav> | ||
{% endif %} |
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
Oops, something went wrong.