-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
This is the recommended approach for installing Yarn. The use of virtualenv is optional, but helpful.
- A Python installation (2.5 or greater)
- pip or easy_install
-
If you don't have it already, install virtualenv:
$ pip install virtualenvif you don't have pip, you may be able to:
$ easy_install virtualenv -
Clone the yarn repository
$ git clone git://github.com/vegitron/yarn.gitor if you will be editing files and committing:
$ git clone git@github.com:vegitron/yarn.git -
Turn yarn into a virtualenv:
$ virtualenv yarn -
Activate your virtualenv:
cd yarn source bin/activate -
Install required Python packages with pip:
$ pip install -r requirements.txt -
Create a django project in the yarn dir:
$ django-admin.py startproject project .That '.' at the end is important!
-
Modify at least the following settings in project/settings.py:
- DATABASES
- INSTALLED_APPS (add 'yarn', 'compressor', 'templatetag_handlebars')
-
Map urls to the yarn app by adding the following to urlpatterns in project/urls.py:
url(r'', include('yarn.urls')),
-
Configure authentication
You can use any authentication method here: https://docs.djangoproject.com/en/dev/topics/auth/
I find the remote user middleware the easiest way to get started though. To do that, add this to your project/settings.py file:
In MIDDLEWARE_CLASSES, after 'django.contrib.auth.middleware.AuthenticationMiddleware',:
'django.contrib.auth.middleware.RemoteUserMiddleware',
Add this below MIDDLEWARE_CLASSES:
```python
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.RemoteUserBackend',
)
```
- Create your database:
```
$ python manage.py syncdb
```
- You should now be able to run your development server:
```
$ python manage.py runserver
```
If you're using the remote user middleware, run your development server like this:
```
$ REMOTE_USER=vegitron python manage.py runserver
```
Replacing vegitron with your desired username.