-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
48 lines (34 loc) · 2.04 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Alliance is a Django app, which is different from a Django project.
If you put Alliance in a directory which isn't in your project directory, you
need to show your project where to find it, which means that it must be in
Python's path. You have two options: you can set the environment variable
PYTHONPATH to include the toplevel Alliance directory, whereever it is that
you've installed it, or you can insert the following into the top of the
project's settings.py:
import sys
sys.path.insert(0, '/path/to/Alliance')
Now, python (and therefore your project) know where Alliance is. However, you
need to tell your project that you are in fact using Alliance. In your
project's settings.py, make sure that alliance (note the lower-case) is
included in INSTALLED_APPS.
You also need to edit urls.py so that users can access the views. For example,
if you want http://www.yoursite.com/alliance to go to the front page, you would
add
url(r'^alliance/', include('alliance.urls'))
to your urlpatterns.
Alliance uses Django's default user authentication module, django.contrib.auth.
This means that Alliance requires auth to be properly configured. To do this:
1. Make sure 'django.contrib.auth' appears in your INSTALLED_APPS setting.
2. Make django.contrib.auth.views.login and django.contrib.auth.views.logout
accessible through urls.py.
2(a). Either write your own registration/login.html template or point the
login view to Alliance's one by passing 'login.html' as the template_name
argument of the login view.
2(b). Optionally specify the next_page argument to the logout view.
3. Set LOGIN_URL and LOGOUT_URL. This lets views that require user
authentication to redirect to the login page if necessary.
4. Either set LOGIN_REDIRECT_URL or make sure you have a view in place at its
default values ('/accounts/profile/'). The login view will redirect users
to this location when they successfully log in.
The official Django documentation has more information on the auth module at
<https://docs.djangoproject.com/en/1.3/topics/auth/>.