Skip to content

CapituloJaverianoACM/WebSiteAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACMWebSite

WebSite 2.0 for ACM develop by the Javerian Chapter

Contributors

Name GitHub Rol
Johan Sebastian Murillo Castillo johan-smc Backend developer
Juan Pablo Rodríguez Navarro JuanPabloRN30 Backend developer
Dorian René Moreno Vega DorianMoreno Backend developer
Daniel Beltrán Huertas DanielBeltran2 Backend developer
Camilo Serrano Reyes camiloserr Backend developer

Prerequisites

We recommend work on Linux, because it is easier install packages and frameworks; but, if you want to work on Windows you can do it.

PyEnv

Install:

$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

Install dependencies:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev git

add this lines in .bashrc:

export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

and then Update:

$ pyenv update

Python

Install on pyenv

$ pyenv install 3.6.0

Set Python 3.6.0 as global env

$ pyenv global 3.6.0

Direnv

For handle the environments variables

$ sudo apt install direnv

And add the following line to .bashrc

eval "$(direnv hook bash)"

.envrc file

Create a file in the root of the project called .envrc this file contains the environment variables. Add this lines to the file and replace the dummy values with real values.

export DATABASE_NAME=yourDatabaseName
export DATABASE_USER=yourDatabaseUser
export DATABASE_PASSWORD=YourDatabasePassword

this values should coincide with the credentials for the postgreSQL server in which you are running the database

.envrc file is blocked by default, run this command to enable it.

$ direnv allow

Installation

Clone the repository

$ git clone https://github.com/CapituloJaverianoACM/WebSiteAPI.git
$ cd WebSiteApi 

Create a virtual environment

If you don't want to install the project's requirements on your computer, we are going to create a virtual environment to install them there.

Creating the virtual environment

We gonna use myvenv as the name of the virtual environment, but you can use the name that you prefer.

$ pyenv virtualenv <myvenv>

Activating the virtual environment

$ pyenv local <myvenv>

After activate your virtual environment your command line prompt should look like this

(myvenv) $

If you want to exit from your virtual environment just get out of the project folder

Install the requirements

Install the python packages described in the requirements.txt

$ pip install -r requirements/developement.txt

Migrate the database

$ python manage.py migrate --settings=acm_web_site.settings.development

Deployment

1. Running django server

$ python manage.py runserver --settings=acm_web_site.settings.development

After starting your local server you can test the webpage on http://127.0.0.1:8000/

Licence

This project is licensed under the GNU License - see the LICENSE.md file for details