summaryrefslogtreecommitdiff
path: root/ReadMe.rst
blob: 3a2e8613e16d76befec12fcde8e0821d00f0896e (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
============
FOSSEE Forum 
============

A **WebApp** to provide online discussion, question and answer for professional 
and programmers. 

Clone
-----

- Make sure your Internet is working.
- Clone this repo by typing ::

   git clone -b fossee-forum https://github.com/FOSSEE/spoken-tutorial-forums.git
   

Installation
------------

- Install Virtual Environment using the following command ::

    sudo apt-get install python-virtualenv

- Create a Virtual Environment ::

    virtualenv /path/to/virtualenv

- Activate the virtualenv using the command ::

    source /path/to/virtualenv-name/bin/activate

- Change the directory to the `spoken-tutorial-forums/` project using the command ::

    cd /path/to/spoken-tutorial-forums

- Install pre-requisites using the command (please don't use sudo) ::

    pip install -r requirement.txt

  or you can also type ::

    easy_install `cat requirement.txt`


Usage
-----

- Using MySQL (For development server only). Though, we recommend to use `MySQL` for deployment
  server. See `settings.py` file for usage.

- Create 'forum' database in 'MySQL'.

- Only for Server deployment, open `spoken-tutorial-forums/forums/settings.py` file and make the following changes ::

    DATABASES = {
        'default': {
        'ENGINE': 'django.db.backend.mysql',
        'NAME'  : 'forum', 
        'USER': '', 
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
        }
    }


- For development on your machine, create a file `config.py` in `spoken-tutorial-forums/forums/` and add ::

    db_user='root' #(MySql username)
    
    db_pass = 'root' #(MySql password)
    
- For development on your machine, open `spoken-tutorial-forums/forums/settings.py` file and make the following changes ::

    DATABASES = {
        'default': {
        'ENGINE': 'django.db.backend.mysql',
        'NAME'  : 'forum', 
        'USER': db_user, 
        'PASSWORD': db_pass ,
        'HOST': '',
        'PORT': '',
        }
    }

	
- Populate the database using the following command ::

    cd /path/to/spoken-tutorial-forums
    
    python manage.py syncdb


- Run the script populate_category.py which enters lists of foss categories into the table category from the `category_names.txt` file ::
    
    python populate_category.py

- Start the server using the command ::

    python manage.py runserver


**Not for first time users and only for developers**
Migration (How to add a new model field to an existing table using South without having to drop a table)
---------

- Enter into virual environment

- install south ::
     
    pip install south

- Add south to INSTALLED_APPS in settings.py

- Change the directory to the `spoken-tutorial-forums/` project using the command ::

    cd /path/to/spoken-tutorial-forums

- Run below command to create south_migrationhistory table ::

    python manage.py syncdb

- Create the initial migration with South ::
   
    python manage.py schemamigration --initial website

- Apply it as a fake migration ::

    python manage.py migrate website --fake

- Make the change to the website model, in this case ::
    
    git pull

- Create a migration for your new change ::

    python manage.py schemamigration --auto website

- Apply new migration ::

    python manage.py migrate website

    


Contributing
------------

- Never edit the master and fossee-forum branch.
- Make a branch specific to the feature you wish to contribute on.
- Send me a pull request.
- Please follow `PEP8 <http://legacy.python.org/dev/peps/pep-0008/>`_
  style guide when coding in Python.

License
-------

GNU GPL Version 3, 29 June 2007.

Please refer this `link <http://www.gnu.org/licenses/gpl-3.0.txt>`_
for detailed description.