Skip to content

Latest commit

 

History

History
122 lines (82 loc) · 3.66 KB

CONTRIBUTING.md

File metadata and controls

122 lines (82 loc) · 3.66 KB

Contributing

All contributors are welcome! This project needs help from many types of contributors, including people interested in code, design, community building, testing, and documentation. Please feel free to bring any ideas or suggestions forward in order to improve this project.

Development

This section describes the steps necessary to set up an environment to run this project on your local computer. For example, you may want to try out the software to get ideas or even add some features.

Prerequisites

You will need to make sure your computer has Python 3 installed. If you would like to checkout the code from GitHub, you will also need to install Git.

Get the code

There are two main ways to get the code for this project:

a) download it from GitHub b) clone it using Git

For the Git instructions,

  1. go to the project on GitHub
  2. copy the clone link under the "code" button
  3. clone the repository into a local folder

E.g. Using SSH:

git clone [email protected]:brylie/wagtail-social-network.git

Using HTTPS:

git clone https://github.com/brylie/wagtail-social-network.git

Create a virtual environment

When developing or running Python code, you should try to make sure you are working in a virtual environment. The virtual environment will keep your computer in good order, particularly when managing multiple Python projects.

Run the following command, from within the code directory you cloned above, to set up a virtual environment on Linux/Mac

python -m venv env

That will create a new virtual environment in the env subdirectory wherever you ran the command.

Activate the virtual environment

Once you have created a virtual environment, you need to activate it with the following command on Linux/Mac:

source env/bin/activate

Install dependencies

Once you are inside of the virtual environment, you can make sure you have the latest dependencies installed by running the following command on Linux/Mac:

pip install project/requirements.txt

Note: the above example assumes you are running the pip install command from within the root directory of this repository, whereas the requirements.txt file is in the project/ subdirectory.

Run the project

Once you have installed the dependencies, you can run the project. However, first make sure you have run all database migrations and created a superuser.

python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

From there, you should be able to access the project at localhost:8000

Using the DJANGO_SETTINGS_MODULE

We currently have some development settings contained in core.settings.dev. However, those settings are not used when running python manage.py runserver

You can change to your preferred settings in two ways:

  1. By using the --settings flag while running the server

You have to: python manage.py runserver --settings=core.settings.<your preferred settings>

Eg:

python manage.py runserver --settings=core.settings.base

Or:

python manage.py runserver --settings=core.settings.dev 

Or:

python manage.py runserver --settings=core.settings.production 
  1. By setting environment variables:

-In UNIX BASH Shell:

export DJANGO_SETTINGS_MODULE=core.settings.<your preferred settings>
python manage.py runserver

-In Windows Shell:

set DJANGO_SETTINGS_MODULE=core.settings.<your preferred settings>
python manage.py runserver