Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for setting up project #13

Open
gbozee opened this issue Dec 29, 2017 · 9 comments
Open

Documentation for setting up project #13

gbozee opened this issue Dec 29, 2017 · 9 comments
Assignees

Comments

@gbozee
Copy link

gbozee commented Dec 29, 2017

Right now, there is a project setup for the community site located on the develop branch. What is remaining is providing a documentation on how to get the project up and running based on the different teams members are working on

Backend Team:

The documentation team is responsible for documenting the steps involved in setting up the project to run in the backend.
You would need to account for the different operating systems the users might use when trying to setup the project.

Here are the steps to replicate the setup locally

  1. User must have postgres installed on their systems
  2. Users must have python 3.6 installed on their systems.
  3. It would be nice if users are familar with docker and its ecosystem but it isn't necessary. It just makes the setup a lot easier.
  • Create a virtual environment in the same directory as the root of the project
$ virtualenv -p `which python3.6` venv
$ source venv/Scripts/activate # on linux or mac source venv/bin/activate
$ pip install -r requirements/local.txt
  • Creating a database for the application
# assuming the user has docker and docker-compose installed
$ docker-compose -f local.yml  up -d postgres mailhog

# create a startup script file to load up all the environment variables that would be used
$ touch .env

# add the following environmental variables to the `.env` file created
export DATABASE_URL=postgres://python_nigeria_site:postgres@localhost:7432/python_nigeria_site
export EMAIL_HOST=localhost

# run the .env script 
$ source .env

Start the application

$ python manage.py runserver

Frontend Team

It is assumed that members of the frontend team have node installed on their systems

After cloning the project, they run the following commands

# change directory to the frontend
$ cd frontend
$ npm install # if they use yarn then the command is yarn install
$ npx develop # or npm run develop or yarn develop

The frontend team would have to get familiar with gatsbyjs since it is the framework of choice that would be used in the building of the frontend

@wolejnr
Copy link

wolejnr commented Dec 30, 2017

@Olamyy @Abwas Have you been able to set up the project on your system? If yes which operating system are you running?

@Abwas
Copy link

Abwas commented Dec 31, 2017

Not yet still working on it. My OS is Windows 10

@Abwas
Copy link

Abwas commented Dec 31, 2017

@gbozee Please I encountered this error:
ERROR: Windows named pipe error: The system cannot find the file specified. (code: 2)
while trying to run the create database command:
$ docker-compose -f local.yml up -d postgres mailhog
though I have docker and docker-compose installed on Windows. Any help will be appreciated please! Thanks.

@Abwas
Copy link

Abwas commented Dec 31, 2017

Though this is my first encounter with Django cos I'm more familiar with Flask.

@gbozee
Copy link
Author

gbozee commented Dec 31, 2017

did you check if docker is running? Try restarting your docker service

@gbozee
Copy link
Author

gbozee commented Dec 31, 2017

this isn't a django problems as such. There is nothing stopping you from installing django locally on your system. The docker setup was more for setting up a database and a mail server easily

@Abwas
Copy link

Abwas commented Jan 1, 2018

OK thanks though I didn't install the docker locally, I installed it in the virtual environment. I'm trying to install locally now but failed cos it requires Windows 10 Pro or Enterprise Version 10586 and mine is Windows 10 Home. So please any alternative for setting up the database and mail server without using docker. Thanks!

@gbozee
Copy link
Author

gbozee commented Jan 1, 2018

If that is the case, then you don't even need docker at all. As long as you have postgres installed, everything can be installed locally.
Also the mailhog for local email binary can be downloaded locally on the system of choice
https://github.com/mailhog/MailHog

@Abwas
Copy link

Abwas commented Jan 18, 2018

@gbozee Apologies guys, so sorry for the lack of communication, it wasn't intentional. My system was faulty for the past two weeks and still not in good shape. Please any progress with the project documentation so far?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants