This installation guide assumes that the application is being installed on the latest version of Ubuntu.
- Install Python development packages using,
sudo apt-get install python-dev
- Install Python pip using
sudo apt-get install python-pip
- Install Python MySQLDB package using,
sudo apt-get install python-mysqldb
- Install virtualenv using
sudo pip install virtualenv
- In the project root, run
virtualenv venv
- Activate the virtual environment using
. venv/bin/activate
- Once the virtual environment is active, run
pip install -r src/requirements.txt
- To deactivate the virtual environment, type
deactivate
and hit ENTER.
All the project configurations are done in the file settings.py
located at src/core/settings.py.sample
. Rename it to settings.py
before adding any configurations or modifying them.
Some Ideal configurations for development are listed below.
DEVELOPMENT = True
DEBUG = True
- Create a database with any name you wish.
- Then change directory to
src/core
usingcd src/core
- Update the schema from alembic version files using the command,
alembic upgrade head
- When you edit the schema and want to sync it to the database, go to
src/core
and run the commandalembic revision --autogenerate -m "<revision_message_here>"
. Here the revision message is a simple short line telling what was changed just like a git commit message. Then run,alembic upgrade head
- Rename the
settings.py.sample
using the command,mv settings.py.sample setting.py
- Make appropriate settings in
settings.py
- Go to
src/scripts
and runsource dev.sh
. - Run the migrations as mentioned in the previous section.
- Go to
src/
and run the application using,python run.py
and point your browser to the url that gets displayed.
We follow the official Python coding standards (PEP8) where ever possible. As a quick round up of it,
- Use 4 spaces for indentation and not tabs.
- Make sure you maintain maximum around 80 characters per line of code.
- Variable & Class names follow
CamelCase
notation with the exceptions of function names / model's datamembers which followunder_score
notation. - Finally, make sure the code you write is readable and maintainable with a fair amount of relevant comments.
We love contributors! Fork the repository and start sending us pull requests...
For a list of things that we'd need help check out the issues section. That would be your starting point if you are looking to contribute to this project! If you need help in getting started, ping us on #pes-os on IRC (freenode). Look at the Getting Started section for some tutorials and resources to get you started quickly.
Happy hacking!
If you find any bugs, feel free to report it by raising an issue here.
The PES OpenSource Team.
List of Contributors (In alphabetical order)
This project is licensed under the MIT License.
- Flask Tutorial - http://flask.pocoo.org/docs/quickstart/
- Flask Mega Tutorial - http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world