|
1 | 1 | # Confluence
|
2 | 2 | This is Confluence of Conference.
|
| 3 | + |
| 4 | +# Setup Guide |
| 5 | + |
| 6 | +### Creating a Virtual Environment |
| 7 | +Virtual Environment allows us to have requirements installed specifically to our project instead of complete system. To create a virtual environment goto any directory where you will store your code and run the following command on terminal (linux) or Windows PowerShell (Windows)(For windows, run Windows Powershell as Administrator before running below commands) |
| 8 | +``` |
| 9 | +python -m venv venvconf |
| 10 | +``` |
| 11 | +#### Activating the Virtual Environment |
| 12 | +Run the following command to activate your virtual environment: |
| 13 | +##### Windows |
| 14 | +``` |
| 15 | +./venvconf/Scripts/activate |
| 16 | +``` |
| 17 | +##### Linux |
| 18 | +``` |
| 19 | +source venvconf/bin/activate |
| 20 | +``` |
| 21 | +**Note:** To deactivate the Virtual Environment, type deactivate in the shell to deactivate. |
| 22 | +#### Clone your forked repo |
| 23 | +``` |
| 24 | +git clone https://github.com/your_username/Confluence |
| 25 | +``` |
| 26 | +##### Change to develop branch |
| 27 | +Code development should happed in 'develop' branch and not in 'master' branch |
| 28 | +``` |
| 29 | +git checkout develop |
| 30 | +``` |
| 31 | + |
| 32 | +#### Installing Project Requirements (First Time Only or on Requirement changes) |
| 33 | +Change directory to cloned directory |
| 34 | +``` |
| 35 | +cd confluence |
| 36 | +``` |
| 37 | +Use pip to install missing requirements: (if you don't have pip installed on your system, google how to install) (Windows Users should run this command Adminsitrator Shell or will get error) |
| 38 | +``` |
| 39 | +pip install -r .\requirements.txt |
| 40 | +``` |
| 41 | +#### Creating Environment Variables File |
| 42 | +Change directory to src/confluence to create a ".env" file that will contain your enviroment variables. **Note:** This file will not ignored by git and will be available automatically on production environment. |
| 43 | +``` |
| 44 | +cd src\confluence |
| 45 | +``` |
| 46 | +Create file ".env" with following data: |
| 47 | +``` |
| 48 | +EXPLARA_API_KEY=YOUR_EXPLARA_KEY_HERE |
| 49 | +FACEBOOK_PAGE_ACCESS_TOKEN=YOUR_PAGE_ACCESS_TOKEN_HERE |
| 50 | +TWITTER_CONSUMER_KEY=YOUR_TWITTER_CONSUMER_KEy_HERE |
| 51 | +TWITTER_CONSUMER_SECRET=YOUR_CONSUMER_SECRET_HERE |
| 52 | +TWITTER_ACCESS_KEY=YOUR_ACCESS_KEY_HERE |
| 53 | +TWITTER_ACCESS_SECRET=YOUR_ACCESS_SECRET_HERE |
| 54 | +``` |
| 55 | +**Note:** Create your own apps to retrieve these keys for testing. |
| 56 | + |
| 57 | +#### Create Database Migrations |
| 58 | + |
| 59 | +Navigate to root of /src and run the following commands to make database tables. |
| 60 | +``` |
| 61 | +python manage.py makemigrations |
| 62 | +python manage.py migrate |
| 63 | +``` |
| 64 | + |
| 65 | +#### Run Server |
| 66 | +Once all above setup is done, run the following code to start your development server, |
| 67 | +``` |
| 68 | +python manage.py runserver |
| 69 | +``` |
| 70 | +You will see something like |
| 71 | +``` |
| 72 | +Performing system checks... |
| 73 | +
|
| 74 | +System check identified no issues (0 silenced). |
| 75 | +June 16, 2017 - 23:46:33 |
| 76 | +Django version 1.9, using settings 'confluence.settings' |
| 77 | +Starting development server at http://127.0.0.1:8000/ |
| 78 | +Quit the server with CTRL-BREAK. |
| 79 | +``` |
| 80 | +On successful setup you will see the second last line i.e. ' Starting Development Server at http://127.0.0.1:8000/ '. Visit this url on your web browser to see if server is started successfully. On failed startup, you will see a 'Refused to connect' error. |
| 81 | + |
0 commit comments