GithubHelp home page GithubHelp logo

noodle-learns-programming / fest-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from the-webops-club/fest-api

0.0 2.0 0.0 11.6 MB

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

Python 15.80% HTML 38.66% CSS 18.72% JavaScript 26.36% PHP 0.46% Shell 0.01%

fest-api's Introduction

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
      • Install
       	python-virtualenv libmysqlclient-dev python-dev mysql-server mysql-client
      
    • Create a virtual env
      • 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 this for a begginer crash course
      • If you do not know what python-virtualenv means read this
    • Install configs/requirements.txt
      • use
         pip install -r configs/requirements.txt (read 8.c if pip is not installed. 
        
      • and then to make sure of all versions
         pip install -r configs/requirements.txt --upgrade
        
  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/
  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')

    • 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 REQUIRED)

    • FACEBOOK

      • Add your facebook credentials (token, key) into settings
    • 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

        • Google Public Key
        • Google oauth configs into configs/docs_oauth2_credentials.json
  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
  6. Common Installation Problems

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

    a. Static files are not loading Or the css files are not showing - set STATIC_URL to '/static/' in settings.py

    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.

     - Google 'install apiclient library' or whatever the module name is and type the command that you find in any of the results in terminal
    

fest-api's People

Contributors

abdealiloko avatar abhishandy avatar akshay-balaji avatar akshayutture avatar arun2596 avatar musafirsafwan avatar phoenix25 avatar saarangwebadmin avatar shahidhk avatar srmanikandasriram avatar varshaan avatar webopsshaastra avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.