1. Quick installation¶
1.1. Install redis server for caching¶
$ sudo apt-get install redis-server
1.2. Install elastic search engine¶
Download and install elastic search engine > 5.5 as per OS.
1.4. Clone a repository¶
$ git clone https://github.com/Pustakalaya/custompustakalaya pustakalaya
1.5. Create a virtual environment¶
To create a virtual environment you can use python virtualenv package, if you haven’t install in your machine, install it
$ sudo pip install virtualenv
1.6. Create and activate virtualenv¶
$ virtualenv venv -p /usr/bin/python3
$ source venv/bin/activate
1.7. Install project dependencies.¶
$ pip install -r pustakalaya/src/requirements/requirements_dev.txt
1.8. Configure project settings¶
Inside src/config directory, copy config.example.json to config.json and configure your project settings accordingly. Sample Configuration of config.json file.
{
"MEDIA_ROOT": "/var/www/html/media_root/",
"STATIC_ROOT": "/var/www/html/static_root/",
"ELASTIC": {
"ES_HOST": "127.0.0.1",
"ES_NUMBER_OF_SHARDS": "1",
"ES_NUMBER_OF_REPLICAS": "0",
"ES_USE_SSL": "False",
"ES_PORT": "9200"
},
"EMAIL": {
"EMAIL_HOST": "smtp.gmail.com",
"EMAIL_PORT": "587",
"EMAIL_HOST_USER": "manoj.example@olenepal.org",
"EMAIL_HOST_PASSWORD": "yourpassword",
"EMAIL_USE_TLS": "True",
"FEEDBACK_MESSAGE_TO": [
"youremail.gautam@gmail.com",
"manoj.gautamexample@olenepal.org"
],
"ADMIN_EMAILS": [
[
"Sys admin 1",
"manoj.gautam@olenepal.org"
],
[
"system admin 2",
"manojit.gautam@olenepal.org"
]
]
},
"REDIS": {
"IP": "127.0.0.1",
"PORT": "6379"
}
}
1.9. Run migrations and create super user¶
$ cd pustakalaya/src
$ ./manage.py migrate --settings=pustakalaya.settings.development
#Create a user for your app
$ ./manage.py createsuperuser --settings=pustakalaya.settings.development
# Start local development server
$ ./manage.py runserver --settings=pustakalaya.settings.development
1.10. Compile frontend assets¶
Gulp and webapack has been used to compile front-end dependencies
- Install all the dependencies packages listed on package.json file.
Compile the sass assets using gulp