{"id":24829809,"url":"https://github.com/jbkahn/django-sass-template-example","last_synced_at":"2025-03-26T02:22:32.208Z","repository":{"id":21296593,"uuid":"24612792","full_name":"JBKahn/Django-sass-template-example","owner":"JBKahn","description":"Django-sass-template-example for Nick","archived":false,"fork":false,"pushed_at":"2014-10-17T02:22:01.000Z","size":2264,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T00:28:27.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JBKahn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-29T20:59:16.000Z","updated_at":"2015-03-20T14:25:52.000Z","dependencies_parsed_at":"2022-08-20T16:40:40.719Z","dependency_job_id":null,"html_url":"https://github.com/JBKahn/Django-sass-template-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBKahn%2FDjango-sass-template-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBKahn%2FDjango-sass-template-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBKahn%2FDjango-sass-template-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBKahn%2FDjango-sass-template-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JBKahn","download_url":"https://codeload.github.com/JBKahn/Django-sass-template-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245574189,"owners_count":20637737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T23:39:02.971Z","updated_at":"2025-03-26T02:22:32.190Z","avatar_url":"https://github.com/JBKahn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Django Sass Template [![Build Status](https://travis-ci.org/JBKahn/Django-sass-template-example.svg?branch=master)](https://travis-ci.org/JBKahn/Django-sass-template-example)\n====================\n\nSetup\n-----\n\n1. Install Ruby (I use [RVM](http://rvm.io/rvm/install))\n2. Install Sass Ruby gem\n\n    `gem install sass`\n\n3. Install [NodeJs](http://nodejs.org/)\n4. Checkout this project and change into the directory.\n5. Change into the home directory to install the frontend dependencies.\n\n    `cd home`\n\n6. Install first set of dependencies\n\n    `npm install`\n\n7. Install bower globally.\n\n    `sudo npm install -g bower`\n\n8. Install second set of dependancies using bower\n\n    `bower install`\n\n9. Install grunt for building frontend files\n\n    `sudo npm install -g grunt-cli`\n\n10. Build frontend files\n\n    `grunt`\n\n11. Download python (~2.7) if you don't have it.\n12. Download [pip](https://pip.readthedocs.org/en/latest/installing.html)\n13. Download virtualenv\n\n    `pip install virtualenv`\n\n14. Download virtualenvwrapper\n\n    `pip install virtualenvwrapper`\n\n15. Set [required variables](http://virtualenvwrapper.readthedocs.org/en/latest/install.html)\n\n    I have the following in my `$HOME/.bashrc` file:\n    ```sh\n    export WORKON_HOME=$HOME/.virtualenvs\n    export PROJECT_HOME=$HOME/virtualenvProject\n    source /usr/local/bin/virtualenvwrapper.sh\n    ```\n\n16. Change back into the directory root of the application\n\n    `cd ..`\n\n17. Setup python virtual environment in the project directory (assuming you're inside it), replace the project name with one of your choice.\n\n    `mkvirtualenv \u003cproject-name\u003e -a . -r ./requirements.txt`.\n\n    note: (You can use `pip install -r ./requirements.txt` to install/update the python project requirements at any time).\n\n\nStart the app\n-------------\n\n    $ workon \u003cproject-name\u003e\n    $ ./run.sh\n\nNavigate to the website\n-----------------------\n\n    It's located at `http://localhost:8000/`\n\nDefault Admin User\n------------------\n\nUsername and password are `admin`\n\nRequirements\n------------\n\n* python 2.7\n* Ruby and the sass gem\n* pip\n* NodeJs\n\n\nRunning The Tests\n-----------------\n\n`./run_tests.sh`\n\nHow to Deploy using Heroku\n==========================\n\nSetup\n-----\n\n0. Install [Heroku CLI](https://toolbelt.heroku.com/)\n1. `pip install django-toolbelt`\n2. `heroku create`\n3. Heroku will automatically catch the node modules file and think it's a node app. We have to let it know otherwise:\n\n    `heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-python`\n\n4. `git push heroku master`\n5. Setup database\n\n    `heroku addons:add heroku-postgresql`\n\n6. Run Django's syncdb\n\n    `heroku run python manage.py syncdb`\n\n\nDeploy\n------\n\n`git push heroku master`\n\nView\n----\n\n`heroku open`\n\nPre-Commit Hook\n===============\n\ninstallation\n------------\n\n1. Place the following in project_directory/.git/hooks/pre-commit\n2. Make the file executable\n\nPip Installable Requirements\n----------------------------\n```\nflake8==2.2.1\nflake8-print\nflake8-debugger\n```\n\npre-commit\n----------\n\n```bash\n#!/bin/sh\n\n# Allows for colors and such\nexport TERM=xterm-256color\n\n\nFILES=\"git diff --cached --name-only --diff-filter=ACM\"\nROOT=$(git rev-parse --show-toplevel)\nRETVAL=0\n\nPYTHON_FILES=$($FILES | grep -E \".py$\")\n# This is because flake8's --exclude doesn't seem to work properly. Exclude via grep.\nPYTHON_FILES_WITHOUT_MIGRATIONS=$($FILES | grep -E \".py$\" | grep -v \"migrations/\")\nJS_FILES=$($FILES | grep -E \".js$\" | grep -v \"dist\" | grep -v \"/build/\")\n\nif [ -n \"$PYTHON_FILES\" ]; then\n\n    flake8=$(which flake8)\n    has_flake8_print=$(flake8 --version | grep flake8-print | wc -l)\n    has_flake8_debugger=$(flake8 --version | grep flake8-debugger | wc -l)\n\n    if [ -z \"$flake8\" ] || [ $has_flake8_print -lt 1 ] || [ $has_flake8_debugger -lt 1 ]; then\n        printf \"\\033[31mYou must install flake8 to check for python violations; sudo pip install flake8==2.2.1; sudo pip install flake8-print; sudo pip install flake8-debugger;\\n\\033[0m\"\n        RETVAL=1\n    else\n        printf \"\\033[32mChecking python files for flake8 violations\\n\\033[0m\"\n\n        for file in ${PYTHON_FILES_WITHOUT_MIGRATIONS}; do\n            FLAKE8_ERRORS=$(git show :${file} | flake8 --ignore=E501 - | sed -e 's/^stdin\\:/line /g')\n\n            print_allowed=$(echo $file | grep -E \"(management/commands|manage.py|/scripts|settings.py)\" | wc -l)\n\n            if [ \"$print_allowed\" -gt 0 ]; then\n                FLAKE8_ERRORS=$(echo \"$FLAKE8_ERRORS\" | grep -v \"print statement\")\n            fi\n\n            if [ \"$FLAKE8_ERRORS\" != \"\" ]; then\n                printf \"\\033[33mFlake8 errors detected in $file\\n\\033[0m\"\n                printf \"\\033[31m$FLAKE8_ERRORS\\n\\033[0m\"\n                RETVAL=1\n            fi\n        done\n    fi\n    RETVAL=$?\nfi\n\nif [ -n \"$JS_FILES\" ]; then\n\n    jshint=$(which jshint)\n    node=$(which node)\n\n    if [ -z \"$jshint\" ] || [ -z \"$node\" ]; then\n        printf \"\\033[31mYou must install jshint to check for javascript violations; sudo npm install -g jshint\\n\\033[0m\"\n        RETVAL=1\n    else\n        printf \"\\033[32mChecking javascript files for linting errors\\n\\033[0m\"\n\n        for file in ${JS_FILES}; do\n            result=$(git show :${file} | jshint - | sed -e 's/^stdin\\: line/line/g')\n\n            if [ \"$result\" != \"\" ]; then\n                printf \"\\033[33mJSHint errors detected in $file\\n\\033[0m\"\n                printf \"\\033[31m$result\\n\\033[0m\"\n                RETVAL=1\n            fi\n        done\n    fi\nfi\n\nif [ $RETVAL -eq 0 ]; then\n    printf \"\\033[32mNo errors found!\\n\\033[0m\"\nfi\n\nexit $RETVAL\n```\n\nPost-Checkout Hook\n==================\n\ninstallation\n------------\n\n1. Place the following in project_directory/.git/hooks/post-checkout\n2. Make the file executable\n\npost-checkout\n-------------\n\n```bash\n#!/bin/bash\n\nexport TERM=xterm-256color\n\n# Start from the repository root\ncd ./$(git rev-parse --show-cdup)\n\nprintf \"\\e[32mRemoving .pyc and empty directories...\\n\\033[0m\"\nfind . -name \"*.pyc\" -delete\nfind . -type d -empty -delete\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbkahn%2Fdjango-sass-template-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbkahn%2Fdjango-sass-template-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbkahn%2Fdjango-sass-template-example/lists"}