Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
340 commits
Select commit Hold shift + click to select a range
55e1383
Update README.md
shahidhk Sep 1, 2014
9c348db
Fixed some permission and finace portal not visible to non cores issue
shahidhk Sep 2, 2014
af9a6b1
Changed readme and some settings
AbdealiLoKo Sep 3, 2014
7e77009
Merge branch 'master' of github.com:The-WebOps-Club/fest-api
AbdealiLoKo Sep 3, 2014
c27d236
Edited readme
AbdealiLoKo Sep 3, 2014
8946792
Added the new requirements ...
AbdealiLoKo Sep 3, 2014
bfa567b
requirements update
AbdealiLoKo Sep 3, 2014
fdf23d0
Merge branch 'master' of github.com:The-WebOps-Club/fest-api
shahidhk Sep 3, 2014
93e5f84
Merge branch 'participant_registration' of github.com:The-WebOps-Club…
AbdealiLoKo Sep 3, 2014
d87d59c
i
AbdealiLoKo Sep 3, 2014
250c595
events branch working fine now.Actually last commit is a mistake. Add…
akshayutture Jul 8, 2014
fe74b92
Permissions added (user has to be a events/qms core to access the edi…
akshayutture Jul 8, 2014
1413a51
proper commit
akshayutture Jul 18, 2014
ae7e1f7
initial commit on this branch
akshayutture Jul 18, 2014
a412934
Participant event registration added. Event model modified to include…
akshayutture Jul 18, 2014
8c62c23
tdp option added
akshayutture Jul 18, 2014
53fef45
tdp option addedd
akshayutture Jul 18, 2014
4c1402f
Some minor changes made to the display of event tabs
akshayutture Jul 20, 2014
3f11b01
Delete button made with dajaxice. Had made it with views.py earlier
akshayutture Jul 20, 2014
5e3f055
Add tab and Edit Tab button implemented using dajaxice instead of vie…
akshayutture Aug 7, 2014
68ed5b7
facebook, twitter google login for participants added at localhost:80…
akshayutture Aug 9, 2014
583875a
added the update view to the user profile api
Phoenix25 Aug 16, 2014
19fbc96
Merge branch 'participant_registration' of github.com:The-WebOps-Club…
AbdealiLoKo Sep 3, 2014
13bd08e
Removed some merge conflict and some minor changes
AbdealiLoKo Sep 3, 2014
d0b333c
Added serializers and conditions to disable CORS and fixed up registr…
AbdealiLoKo Sep 4, 2014
a1e76c0
Removed specific settings from global, removed hardcoding of cultural…
shahidhk Sep 4, 2014
698cf4e
Fixed conflicts in settings
shahidhk Sep 4, 2014
dd7fd98
Added cors to requirements
AbdealiLoKo Sep 4, 2014
9dd5513
Added code for participant login
AbdealiLoKo Sep 6, 2014
52588ee
Edited requirements to remove duplicate haystack entry
shahidhk Sep 6, 2014
aa42d5a
Merge branch 'master' of github.com:The-WebOps-Club/fest-api
shahidhk Sep 6, 2014
a333913
Some more changed for userprofile
AbdealiLoKo Sep 6, 2014
36e7d11
Merge branch 'master' of github.com:The-WebOps-Club/fest-api
AbdealiLoKo Sep 6, 2014
b40df31
Migration needed. Have made up the whole api for Teams
AbdealiLoKo Sep 7, 2014
9bad460
Fixed merge conflicts
shahidhk Sep 13, 2014
b22de38
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Sep 13, 2014
5e467c9
Arun has to fix datatables and put UI
akshayutture Sep 15, 2014
0a66204
Merge branch 'shaastra_production' of github.com:The-WebOps-Club/fest…
AbdealiLoKo Sep 15, 2014
55b2331
initial commit on this branch
akshayutture Jul 18, 2014
9678cc7
Participant event registration added. Event model modified to include…
akshayutture Jul 18, 2014
767faa6
Add tab and Edit Tab button implemented using dajaxice instead of vie…
akshayutture Aug 7, 2014
a82e3dc
facebook, twitter google login for participants added at localhost:80…
akshayutture Aug 9, 2014
85202d9
added the update view to the user profile api
Phoenix25 Aug 16, 2014
889d054
Sometjing
AbdealiLoKo Sep 15, 2014
95c6e15
Merge branch 'shaastra_production' of github.com:The-WebOps-Club/fest…
AbdealiLoKo Sep 15, 2014
3496f62
Minor changes
AbdealiLoKo Sep 15, 2014
76fedcc
Stuff
AbdealiLoKo Sep 15, 2014
3bd7b5e
fixed cups in social login
Phoenix25 Sep 15, 2014
7cd588c
Merge branch 'shaastra_production' of https://github.com/The-WebOps-C…
Phoenix25 Sep 16, 2014
6ea9318
Added events portal api
AbdealiLoKo Sep 18, 2014
db91beb
Merge branch 'shaastra_production' of github.com:The-WebOps-Club/fest…
AbdealiLoKo Sep 18, 2014
5831401
csrferror
AbdealiLoKo Sep 18, 2014
ac6a305
Tried using deprecated api for psa
webopsShaastra Sep 18, 2014
93d846b
I am done with my part. Arun has to add UI, fix datatables and fix th…
akshayutture Sep 18, 2014
c58bab8
I am done with my part. Arun has to add UI, fix datatables and fix th…
akshayutture Sep 18, 2014
1646389
revealed the attach buttons.
Phoenix25 Sep 20, 2014
8a778ec
fixed cups in comment textarea
Phoenix25 Sep 21, 2014
1da9b32
disabled other panel buttons/
Phoenix25 Sep 21, 2014
716f696
Fixed static root error
shahidhk Sep 21, 2014
e5fcd35
Added blog
shahidhk Sep 21, 2014
87d4af9
Migration needed, added BlogFeed app
shahidhk Sep 21, 2014
501fc58
Added mobile_auth
shahidhk Sep 22, 2014
45b7ef7
Added a bunch of stuff for shaastra event portal
AbdealiLoKo Sep 28, 2014
e61511b
Merge branch 'shaastra_production'
AbdealiLoKo Sep 28, 2014
7e77467
added UI
arun2596 Sep 28, 2014
31f7e5d
added delete confirmation and toastr
arun2596 Sep 28, 2014
ba663ff
intermediate commit. events html missing.
akshayutture Sep 28, 2014
50a2f8b
some small bugs fixed. Edit events tab still to be fixed
akshayutture Sep 28, 2014
928029b
small database breaking changes fixed
akshayutture Sep 28, 2014
4b7e09a
fixed initial values for edit event
arun2596 Sep 28, 2014
893f139
Events portal ready functionally. Small bug fixes left
akshayutture Sep 28, 2014
4f52f8c
small bugs fixed. I think it is ready for upload. Arun just test it a…
akshayutture Sep 30, 2014
8187b64
event_name made unique. just add the date widget for both event forms…
akshayutture Sep 30, 2014
4a21f2b
very minor fix to the add tab form
akshayutture Oct 1, 2014
75e89a5
Some issues with error messages + Added a field for age ...
AbdealiLoKo Oct 4, 2014
67992ac
Minor fixes
AbdealiLoKo Oct 4, 2014
86a193d
Fixed the typo for userprofile
AbdealiLoKo Oct 9, 2014
6885ec8
Blog app changes
shahidhk Oct 15, 2014
a05468b
Merge branch 'master' of github.com:The-WebOps-Club/fest-api
shahidhk Oct 15, 2014
e5f39e7
Merge branch 'master' into events_portal
shahidhk Oct 15, 2014
6d18458
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 15, 2014
cabd4b0
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 15, 2014
e6c3d11
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 15, 2014
f0a1b9a
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 15, 2014
597ecac
Intial commit, rendering hospi_home using dajaxice
akshay-balaji Oct 15, 2014
d97899d
Fixed edit event error
shahidhk Oct 15, 2014
45fa7e7
Removed redundant code
shahidhk Oct 15, 2014
a3b9771
Made visible available in ERP
shahidhk Oct 15, 2014
ae8464f
Added django select forms
shahidhk Oct 15, 2014
3aba38d
Added depth
shahidhk Oct 15, 2014
1aaa2a2
Edited structure of blogs
shahidhk Oct 15, 2014
2377684
Added files and scripts for blogs. Updated requirements
shahidhk Oct 15, 2014
e83db45
Merge branch 'master' into saarang_production
shahidhk Oct 15, 2014
f240012
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 15, 2014
8a5d858
Added requirements properly
shahidhk Oct 15, 2014
3c4c24f
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 15, 2014
e9086a4
Changed migration in events, dont know how it will affect shaastra pr…
shahidhk Oct 15, 2014
af92e53
Merged shaastra production into events_portal. All conflicts fixed. h…
akshayutture Oct 16, 2014
922bce4
Some a tag was unclosed in sidebar. fixed it.
akshayutture Oct 16, 2014
8bfde0d
Permission for add event changed to user.is_superuser instead of user…
akshayutture Oct 16, 2014
8fd9bc6
Event categories will now be displayed differently depending on if it…
akshayutture Oct 16, 2014
1176824
very small fixing change
akshayutture Oct 16, 2014
8006520
very small fixing change
akshayutture Oct 16, 2014
d27973c
the models in portals was deleted and remanants relying on it were sh…
akshayutture Oct 16, 2014
b49149e
some permissions changed to allow all cores to edit events
akshayutture Oct 16, 2014
efbe87a
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 15, 2014
fcce9e3
appearance of add event improved
akshayutture Oct 16, 2014
44dbda9
Merge branch 'events_portal' of https://github.com/The-WebOps-Club/fe…
akshayutture Oct 16, 2014
decfc54
events coords now allowed to access the edit events tab
akshayutture Oct 16, 2014
b21937f
Merge branch 'events_portal' of https://github.com/The-WebOps-Club/fe…
akshayutture Oct 16, 2014
8cda584
Revert "events coords now allowed to access the edit events tab"
akshayutture Oct 18, 2014
09a2381
Date picker and coords multiselect added. pre tag used to display eve…
akshayutture Oct 18, 2014
a278838
events portal fully functional. only problem is that edit event canno…
akshayutture Oct 19, 2014
23a40ee
minor bug fix
akshayutture Oct 19, 2014
34d5cb9
merged events portal
arun2596 Oct 20, 2014
36d3097
Merge branch 'events_portal' of https://github.com/The-WebOps-Club/fe…
arun2596 Oct 20, 2014
a20c639
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 20, 2014
9b2b239
Merge branch 'events_portal' into saarang_production
shahidhk Oct 20, 2014
dfe8f9a
Revert "minor bug fix"
akshayutture Oct 21, 2014
ac42f4b
3 new models and delete event feature added
akshayutture Oct 21, 2014
f505e35
events_portal 100% functional finally. events_description, etc fixed
akshayutture Oct 21, 2014
62eab8e
small bug fix. events_portal is fixed
akshayutture Oct 21, 2014
82d4ad7
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 21, 2014
a449371
Merge branch 'events_portal' of https://github.com/The-WebOps-Club/fe…
arun2596 Oct 21, 2014
7573185
Added short name for categories
shahidhk Oct 22, 2014
296da79
added event api
arun2596 Oct 22, 2014
84506f1
Fixed conflicts
shahidhk Oct 22, 2014
5c561e9
fixed conflicts in requirements
shahidhk Oct 22, 2014
274cd88
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 22, 2014
d02b560
Removed path to static
shahidhk Oct 22, 2014
618e1fd
Fixed conflict in sidebar.html
shahidhk Oct 22, 2014
f4d7caa
Edited blog list
shahidhk Oct 22, 2014
dcbd0d9
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 23, 2014
91c3c48
Fixed permission issue on events portal
shahidhk Oct 23, 2014
2bb2f34
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 23, 2014
55ed00b
added file upload for event(tdp)
arun2596 Oct 23, 2014
01cd893
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 23, 2014
392ee70
added event image
arun2596 Oct 23, 2014
7a5ae50
added images for event
arun2596 Oct 23, 2014
2b4021c
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 23, 2014
20b1361
Merge branch 'events_portal' into saarang_production
shahidhk Oct 23, 2014
75c0f31
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 23, 2014
71baf2e
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 23, 2014
e25e7ce
HTML editor added.stil 2 fixes left - image model + write event categ…
akshayutture Oct 24, 2014
946d479
event category added to the main table
akshayutture Oct 24, 2014
6565374
event_image model changed to url field. In my opinion events portal i…
akshayutture Oct 24, 2014
decd578
Merge branch 'events_portal' of https://github.com/The-WebOps-Club/fe…
arun2596 Oct 23, 2014
74d1b59
made spons portal and api
arun2596 Oct 24, 2014
4a8722c
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 24, 2014
ec743aa
Fixed conflict
shahidhk Oct 24, 2014
f0742ef
Fixed some bugs
shahidhk Oct 24, 2014
bff2556
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 24, 2014
798af68
added user profile edit API
arun2596 Oct 24, 2014
26f9815
Fixed google facebook logins
shahidhk Oct 24, 2014
d54a0d7
Deleted a random file
shahidhk Oct 24, 2014
000579e
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 24, 2014
23a1fcc
Fixed conflict
shahidhk Oct 24, 2014
4f1301e
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 24, 2014
90b59ae
Fixed select box in add new event
shahidhk Oct 25, 2014
b8bfef2
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 25, 2014
ce094ef
merge from shaastra removed certain code
shahidhk Oct 25, 2014
17c1e53
Moved event categories to settings
shahidhk Oct 25, 2014
a7f23f6
Addng emails
shahidhk Oct 25, 2014
93e33d6
Fixed conflict
shahidhk Oct 25, 2014
73ea992
Added email validation stuff
shahidhk Oct 26, 2014
f55c89d
Added email templates
shahidhk Oct 26, 2014
88dea77
Added email changes
shahidhk Oct 26, 2014
021d40e
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 27, 2014
003a302
Fixed conflicts
shahidhk Oct 27, 2014
273499c
SEnding registration emails done, migrate, update templates
shahidhk Oct 27, 2014
0e49445
Permissions changed to allow staff instead of superuser all permissio…
akshayutture Oct 28, 2014
c546308
Saarang id
shahidhk Oct 28, 2014
eb03dd9
Fixed bugs
shahidhk Oct 28, 2014
96720f8
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 28, 2014
8e383d9
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 29, 2014
df12507
Immediate server edits
shahidhk Oct 29, 2014
4da31f9
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Oct 29, 2014
892745e
the small bug in long description regarding the long description not …
akshayutture Oct 29, 2014
e61de5d
Merge branch 'events_portal' of github.com:The-WebOps-Club/fest-api i…
shahidhk Oct 29, 2014
afcd061
fixed bugs
shahidhk Oct 29, 2014
bd8a334
Fixeed conflict
shahidhk Oct 29, 2014
46f7465
Trimmed finance portal
shahidhk Oct 30, 2014
140ea1d
edited events
shahidhk Oct 30, 2014
f99f929
Changed event type
shahidhk Nov 2, 2014
4b3d49e
Added admin
shahidhk Nov 2, 2014
d0c72c5
Fixed a few bugs, changed scopes
shahidhk Nov 6, 2014
d6ac8fa
Created Initital Setup for Hospi Portal
akshay-balaji Nov 7, 2014
e38bda1
Add room/hostel done (bugs present)
akshay-balaji Nov 7, 2014
991e8fc
Fixed add hostel/room, added roomMap Modal
akshay-balaji Nov 9, 2014
f7a68bb
Lots of modifications for events
shahidhk Nov 9, 2014
fe0e767
Added 1.delete hostel/room. 2.Add a team
akshay-balaji Nov 11, 2014
b883d2b
added event_registration_list for every event
akshayutture Nov 15, 2014
dd6236c
Small bug in individual user registration display fixed
akshayutture Nov 15, 2014
330cc31
Merge branch 'saarang_production' into hospi_portal
shahidhk Nov 17, 2014
4a2a0ff
Working Hospi v1
shahidhk Nov 17, 2014
754f38d
Need to migrate update email templates
shahidhk Nov 17, 2014
9dcf76a
Added hospi portal
shahidhk Nov 17, 2014
327df77
bugs
shahidhk Nov 17, 2014
489048f
Merge branch 'saarang_production' into events_portal
shahidhk Nov 17, 2014
9cee3d4
conflict
shahidhk Nov 17, 2014
0b00aa7
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Nov 17, 2014
788763f
Edits
shahidhk Nov 18, 2014
e88c9f0
Saarang id cup
shahidhk Nov 18, 2014
d20e1f7
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Nov 18, 2014
57517ee
Logout added
shahidhk Nov 19, 2014
8b1fbe7
Logout bug
shahidhk Nov 19, 2014
b96f0cc
Post profile
shahidhk Nov 19, 2014
f53d6c6
Ecents portal fix
shahidhk Nov 20, 2014
d1723da
Hospi final
shahidhk Nov 20, 2014
2697914
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Nov 20, 2014
38a468b
Small fix
shahidhk Nov 20, 2014
b6b1478
Redirect fi
shahidhk Nov 20, 2014
9154fb4
Login fix
shahidhk Nov 20, 2014
fcbc5a7
corrected price calculation
shahidhk Nov 20, 2014
2d523d0
team id fix
shahidhk Nov 20, 2014
026217e
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Nov 20, 2014
dee16f5
Hspi time edit
shahidhk Nov 21, 2014
a42c1b5
Ters update
shahidhk Nov 21, 2014
e9406fd
Profile incomplete
shahidhk Nov 21, 2014
12e9812
login with saarang id
shahidhk Nov 21, 2014
dfa93b2
Team city fix
shahidhk Nov 21, 2014
31d87f4
Added null team exception
shahidhk Nov 22, 2014
965169b
Fixed user registration
shahidhk Dec 5, 2014
a59c687
Fixed user reistration
shahidhk Dec 5, 2014
6f3c933
Added DataTable and non-functional team details
akshay-balaji Dec 7, 2014
a6c660e
Fixed conflicts
shahidhk Dec 7, 2014
83c8a98
Modified hospi portal
shahidhk Dec 8, 2014
b97e917
added feature to check more details aboout participant
arun2596 Dec 8, 2014
0feed1a
fixed conflicts
arun2596 Dec 8, 2014
1b8caab
Added Pending For approval
akshay-balaji Dec 9, 2014
015c1bb
Hospi acco confirmation done
shahidhk Dec 9, 2014
b00c88d
Merge branch 'saarang_production' into hospi_portal
shahidhk Dec 9, 2014
8fbc482
Admin edit
shahidhk Dec 9, 2014
3ec990d
Merge branch 'saarang_production' of github.com:The-WebOps-Club/fest-…
shahidhk Dec 9, 2014
6bcb1ac
Server edits
shahidhk Dec 9, 2014
bbf3d71
Updated hospi footer
shahidhk Dec 9, 2014
c333c57
added slots tab to events portal
arun2596 Dec 11, 2014
09af689
added venue to slot
arun2596 Dec 11, 2014
2f911ef
added delete slots in edit event
arun2596 Dec 12, 2014
e8e1d15
added pytz and timezones fixed
arun2596 Dec 14, 2014
67ed3ee
updated requirements
arun2596 Dec 14, 2014
c543fb7
added winnertable , edit and ad winner forms
arun2596 Dec 16, 2014
b7ec0d9
chnaged look to bootstrap
arun2596 Dec 31, 2014
b7018d7
added winner table under form
arun2596 Jan 1, 2015
28251b6
added certificates
arun2596 Jan 1, 2015
8f0b4cb
changed ui
arun2596 Jan 1, 2015
96b5bca
added no of members
arun2596 Jan 1, 2015
2d32048
added delet and print all to winner
arun2596 Jan 2, 2015
7afe378
small fix
arun2596 Jan 4, 2015
9f78da8
added winner by team
arun2596 Jan 5, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.AppleDouble
.DS_Store
.c9revisions

*.kate-swp
# Server config files
restart-project.sh

Expand All @@ -34,6 +34,7 @@ files/media/*
files/static-collected/*
files/static/img/fest_pics/*
files/static/json/*
files/static-root/*
files/templates/base/meta.html
static-permission.sh
runscript.c
Expand Down
227 changes: 74 additions & 153 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
fest-api
Fest-API
========

An API implementation for Saarang Shaastra like fests, including ERP and Mainsite and Mobile interface

1. Setup :
- Check your dependencies
- You need python 2.7.x+ and django 1.6.5 to use this. You can check it with :
```
# python -c "import django; print(django.get_version())"
```
If it gives `1.6.5` Then continue. Else, uninstall and reinstall django
- Install pip using [this](http://pip.readthedocs.org/en/latest/installing.html)
- Install
```
python-virtualenv libmysqlclient-dev python-dev mysql-server mysql-client
```
- Create a virtual env
- install `python-virtualenv`
- Go into the folder of the git repository and use `virtualenv --no-site-packages venv`
- ##If you do not know what git repository means read 'http://rogerdudler.github.io/git-guide/' for a begginer crash course
- ##If you do not know what python-virtualenv means read 'http://www.pythonforbeginners.com/basics/python-virtualenv-usage'
- If you do not know what git repository means read [this](http://rogerdudler.github.io/git-guide/) for a begginer crash course
- If you do not know what python-virtualenv means read [this](http://www.pythonforbeginners.com/basics/python-virtualenv-usage)
- Install configs/requirements.txt
- - Install `libmysqlclient-dev python-dev` using 'apt-get install libmysqlclient-dev python-dev'
- use
```
pip install -r configs/requirements.txt (read 8.c if pip is not installed.
Expand All @@ -19,174 +28,86 @@ An API implementation for Saarang Shaastra like fests, including ERP and Mainsit
```
pip install -r configs/requirements.txt --upgrade
```
- Install `libmysqlclient-dev python-dev` if not already installed
- (If a previous version of django is already installed or if you are not sure if you have a previous version read 8.d)

2. Change the following in the fest-api/configs/sample.setting.py
2. Changes required - which are in gitignore
- Create a file named conigs/settings.py anf copy everything from config/settings.sample.py. Change the following in the fest-api/configs/settings.py
- Set the database settings. Use the following to create a database :
```
# mysql -u root -p
mysql> CREATE DATABASE fest_api_db;
```
Change the DATABASE lines in settings.py to :
```
'ENGINE':'django.db.backends.mysql',
'NAME': 'fest_api_db',
'USER': 'root',
'PASSWORD': '<YOUR_PASSWORD>',
'HOST': '',
'PORT': '',
```
- In globalsettings.py set 'USE_EXTERNAL_SITES' to False - This will disable google docs for now
- In terminal type 'python manage.py syncdb' followed by 'python manage.py migrate'.
- Create a blank document called meta.html in files/templates/base/

- Change the filename to setings.py
- Set the database settings (If you need details on how to do this read 8.a. If you are having problems with mysql installation follow 8.b)
- (specific to ERP) In globalsettings.py set 'USE_EXTERNAL_SITES' to False
- In terminal type 'python manage.py syncdb' followed by 'python manage.py migrate'. If these 2 worked your database settings worked fine

3. Setup Database :

- Management command `populate_db` can be used to get dummy data (IMPORTANT)

- Management command `add_colleges` is used to populate some data - Colleges from Shaastra 2014 (optional) (In other words type 'python manage.py add_colleges')

4. Tastypie (NOT NEEDED for ERP)
- Till now, tastypie(v1.11) has some issues with through tables.
- Need to replace (in the save_m2m function ~line 2300):

```
related_mngr.add(*related_objs)
```
with :
```
if hasattr(related_mngr, 'add'):
related_mngr.add(*related_objs)
else:
# handle m2m with a "through" class
for other_obj in related_objs:
related_mngr.through.objects.get_or_create(**{
related_mngr.source_field_name: bundle.obj,
related_mngr.target_field_name: other_obj
})
```
- Management command `update_email_templates` is used to update email templates and store onto the database for Django Post office (optional)

- Management command `jsonify_data` is used by atwho for data. Autogenerates some json objects which are easy to use

- Management command `fix_permissions` is used to fix all permissions for the users in the beginning

4. Setup Social Accounts : (NOT NEEDED for ERP)
4. Setup Social Accounts : (NOT REQUIRED)

. FACEBOOK
- FACEBOOK
- Add your facebook credentials (token, key) into settings

. GOOGLE
- GOOGLE
- Go to `{{SITE_URL}}/docs/refresh_token` to create a new refresh token.
- This will ask access to a Google account - use the account on which to store Docs and accept.
- Now this will store the refresh_token in a configs file and ask you to restrat server.
- Restart Server to refetch all settings.
- Now you can access Google Drive and Google Picker API

- Also, add google credentials into settings
- Gogole Public Key
- Google Public Key
- Google oauth configs into configs/docs_oauth2_credentials.json

. GITHUB
- Add your github credentials (token, key) into settings


5. Setup Database Appropriately :

. Management command `add_colleges` is used to populate some data - Colleges from Shaastra 2014 (optional) (In other words type 'python manage.py add_colleges')

. Management command `update_email_templates` is used to update email templates and store onto the database for Django Post office (optional)

. Management command `populate_db` can be used to get dummy data (IMPORTANT)

. Management command `jsonify_data` is used by atwho for data. Autogenerates some json objects which are easy to use

. Management command `jsonify_data` is used to fix all permissions for the users in the beginning

6. Haystack and Solr
. Commands to install Solr:
```curl -O https://archive.apache.org/dist/lucene/solr/3.5.0/apache-solr-3.5.0.tgz
tar xvzf apache-solr-3.5.0.tgz
cd apache-solr-3.5.0
cd example
java -jar start.jar```
. Next, generate schema from ```python manage.py build_solr_schema```. Take the output from that command and place it in ```apache-solr-3.5.0/example/solr/conf/schema.xml```. Then restart Solr
. Solr needs to be run continuously on server
. Ref: http://django-haystack.readthedocs.org/en/latest/installing_search_engines.html


7. (specific to ERP)(Create a blank document called meta.html in files/templates/base/
5. Search using Solr (NOT REQUIRED)

- Commands to install Solr:
```
curl -O https://archive.apache.org/dist/lucene/solr/3.5.0/apache-solr-3.5.0.tgz
tar xvzf apache-solr-3.5.0.tgz
cd apache-solr-3.5.0
cd example
java -jar start.jar
```
- Next, generate schema from
```
python manage.py build_solr_schema
```
- Take the output from that command and place it in
```
apache-solr-3.5.0/example/solr/conf/schema.xml
```
- Then restart Solr : Solr will be continuously running on server, like Apache
- [Reference](http://django-haystack.readthedocs.org/en/latest/installing_search_engines.html)

8. Common Installation Problems

- At any point if you get permission denied type 'sudo' followed by the required command

8.a. - Details on how to set up MySQL Server.

To run the mysql prompt and create a database in the terminal type

mysql -u root -p
##Then type the root user password or set the password if it asks you to
## The MySQL shell should open. type- CREATE DATABASE django_db;
## In settings.py under the database settings add

'ENGINE':'django.db.backends.mysql',
'NAME': 'django_db',
'USER': 'root',
'PASSWORD': whatever you set while creating the database,
'HOST': '',
'PORT': '',
- In terminal type 'python manage.py syncdb' followed by 'python manage.py migrate'. If these 2 worked your database settings worked fine



8.b. For mysql installation problems

- Type the all of the following commands to delete any version of mysql that you have

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
- To install mysql

sudo apt-get install mysql-server mysql-client
sudo apt-get install python-mysqldb
- To run the mysql prompt and create a database

mysql -u root -p
##Then type the root user password or set the password if it asks you to
## The MySQL shell should open. type- CREATE DATABASE django_db;
## In settings.py under the database settings add

'ENGINE':'django.db.backends.mysql',
'NAME': 'django_db',
'USER': 'root',
'PASSWORD': whatever you set,
'HOST': '',
'PORT': '',
- In terminal type 'python manage.py syncdb' followed by 'python manage.py migrate'. If these 2 worked your database settings worked fine

8.c. If pip is not installed check the following link

http://pip.readthedocs.org/en/latest/installing.html


8.d. If an older version of django is installed or you are unsure of the version. Type the following in terminal

- python #(to enter python shell)
- import django #(if youn get an error here, django is not installed)
- print(django.get_version())

if the version is 1.6.5 you are fine. If not then read on - you will have to delete and reinstall django. Tpe the following

- python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
- cd <type the output from the above command until the site-packages file only. e.g /....../sitepackages>
- sudo rm -rf django
- pip install Django==1.6.5
Now repeat the steps till 'print(django.get_version())' to check your django version


8.e. static files are not loading Or the css files are not showing

- set STATIC_URL to '/static/' in settings.py

8.f. Static(css/js) files are loading but not getting the shaastra/saarang logo on the login page

- go to files/static/img/shaastra_pics Copy login_page_logo.jpg
- go to files/static/img/ . Create a folder called fest_pics and paste the photo there (since the src attribute for that photo is files/static/img/fest_pics)


8.g. The following error is showing on the browser - The storage backend of the staticfiles finder <class 'django.contrib.staticfiles.finders.DefaultStorageFinder'> doesn't have a valid location.

- In global_settings.py remove the following line in Staic_file_finders 'django.contrib.staticfiles.finders.DefaultStorageFinder',

6. Common Installation Problems
- At any point if you get permission denied type 'sudo' followed by the required command

8.h. Some Module like apiclient, south or any app mentioned in the Third-Party-Apps in globalsetings.py is not installed.
a. Static files are not loading Or the css files are not showing - set STATIC_URL to '/static/' in settings.py

- Google 'install apiclient library' or whatever the module name is and type the command that you find in any of the results in terminal
b. If you get the error meta.html not found - set STATIC_URL to '/static/' in settings.py

c. Static(css/js) files are loading but not getting the shaastra/saarang logo on the login page
- copy `files/static/img/shaastra_pics` to `files/static/img/fest_pics` or `files/static/img/saarang_pics` to `files/static/img/fest_pics`

------------------------------------------------------------------------------------------------------
d. Some Module like apiclient, south or any app mentioned in the Third-Party-Apps in globalsetings.py is not installed.

Experimental Features :
- Content Editable divs
- Google 'install apiclient library' or whatever the module name is and type the command that you find in any of the results in terminal
40 changes: 40 additions & 0 deletions apps/api/gcm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from django.db.models.query import QuerySet
from push_notifications.models import GCMDevice
#serializers

from django.http import Http404
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework import status

def send_push(object, message):
# imported inside function due to circular import
from push_notifications.models import GCMDevice
from django.contrib.auth.models import User
from apps.users.models import Dept, Subdept, Page
if isinstance(object, User):
devices = GCMDevice.objects.filter(user=object)
if isinstance(object, Dept) or isinstance(object,Subdept) or isinstance(object, Page):
users= object.related_users()
devices = GCMDevice.objects.filter(user__in=users)

if isinstance(object, list):
object=list(object)
if isinstance(object[0],User):
devices=GCMDevice.objects.filter(user__in=object)

devices.send_message(message)

class GCMViewSet(viewsets.ModelViewSet):
"""
Used for associating users and their phones the first time the login
to send push push notifications
"""
model=GCMDevice
# def post(self, request, format=None):
# from apps.api.serializers import GCMDeviceSerializer
# serializer = GCMDeviceSerializer(data=request.DATA)
# if serializer.is_valid():
# serializer.save()
# return Response(serializer.data, status=status.HTTP_201_CREATED)
# return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
Loading