Skip to content

Commit

Permalink
Pipenv instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
fasouto committed Dec 8, 2017
1 parent 647bdb7 commit f28dac0
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,31 @@ An easy to use project template for Django 2.0 that follows best practices.
## Features ##

- [Django compressor](http://django-compressor.readthedocs.org/en/latest/) to compress JS and CSS and compile LESS/SASS files.
- [Pipenv](https://docs.pipenv.org) To manage dependences and virtualenvs.
- [Django debug toolbar](http://django-debug-toolbar.readthedocs.org/) enabled for superusers.
- [Argon2](https://docs.djangoproject.com/en/2.0/topics/auth/passwords/#using-argon2-with-django) to hash the passwords

## Quickstart ##

First create and activate your virtualenv, you can use [virtualenvwrapper](https://virtualenvwrapper.readthedocs.org/en/latest/). Then install Django 2.0 in your virtualenv:
Make sure you have [pipenv installed](https://docs.pipenv.org/install.html). Then install Django 2.0 in your virtualenv:

pip install django==2.0

To create a new Django project (make sure to change `project_name`)

django-admin.py startproject --template=https://github.com/fasouto/django-starter-template/archive/master.zip --extension=py,md,html,txt project_name

cd to your project and install the dependences
cd to your project and install the development dependences

pip install -r requirements.txt
pipenv install --dev

If you need a database, edit the settings and create one with

python manage.py migrate
pipenv run python manage.py migrate

Once everything it's setup you can run the development server: [http://localhost:8000/](http://localhost:8000/)

python manage.py runserver
pipenv run python manage.py runserver

## How to use it ##

Expand All @@ -40,16 +41,10 @@ Settings are divided by environments: production.py, development.py and testing.

or you can use the `settings` param with runserver:

python manage.py runserver --settings=my_project.settings.production
pipenv run python manage.py runserver --settings=my_project.settings.production

If you need to add some settings that are specific for your machine, rename the file `local_example.py` to `local_settings.py`. This file it's in .gitignore so the changes won't be tracked.

### Dependencies ###

We are following [Kenneth Reitz's pip workflow](http://www.kennethreitz.org/essays/a-better-pip-workflow) to handle [requirements files](https://pip.readthedocs.org/en/1.1/requirements.html). The `requirements_to_freeze.txt` contains unpinned requirements and `requirements.txt` contains the pinned versions to use in a deployment.

If you have trouble/can't install a package place it in the `/libs` directory.


### TODO ###
- Add webpack with live SASS reloading.
Expand Down

0 comments on commit f28dac0

Please sign in to comment.