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.
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.
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.
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,
- go to the project on GitHub
- copy the clone link under the "code" button
- 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
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.
Once you have created a virtual environment, you need to activate it with the following command on Linux/Mac:
source env/bin/activate
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.
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
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:
- 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
- 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