- Clone this repo via
git clone https://github.com/DSIW/sdf.git
- Install python3 via package manager (e.g.
pacman -S python
) - Install
virtualenv
andvirtualenvwrapper
via package manager (e.g.pacman -S python-virtualenv python-virtualenvwrapper
) - Add virtualenvwrapper to your zsh plugins if your're using oh-my-zsh and restart your terminal
cd sdf
- Create a new environment named
django_sdf
viamkvirtualenv django_sdf
- Execute
workon django_sdf
- Install required packages via
pip install -r requirements.txt
- Reset your DB via
./reset_db.sh
. This will migrate your DB and some seed data will be imported. - Run server in development mode on port 3001 via
python manage.py runserver 3001
- Open the app via
http://localhost:3001
- Install nginx via package manage (e.g.
pacman -S nginx
) cp config/django_sdf.conf /etc/nginx/conf.d
- Start and enable nginx service (e.g.
systemctl start nginx.service; systemctl enable nginx.service
) - Now you can request the site via
http://sdf.localhost
if local server is running viapython manage.py runserver 3001
.
libjpeg
: if you do not have this already installed dosudo apt-get install libjpeg-dev
decorator
: Required byipython
django-braces
: Mixins for views. E.g. FormMessagesMixin for Django's generic viewsdjango-extensions
: Enhanced commands:./manage.py (show_urls|validate_templates|shell_plus|runserver_plus)
django-paypal
: Paypal integrationinvoke
: Invoke commandsipython
: Interactive shell with history support. Run./manage.py shell_plus
ipython-genutils
: Required byipython
path.py
: Required byipython
pexpect
: Required byipython
pickleshare
: Required byipython
ptyprocess
: Required byipython
requests
: Required bydjango-paypal
python-dateutil
: Required by./reset_db.sh
simplegeneric
: Required byipython
six
: Required bydjango-extensions
traitlets
: Required byipython
Werkzeug
: Optional dependency ofdjango-extensions
wheel
: required for installation of pure python and native C extension packagesdjango-watson
: Required for searching
- We use Material Design
- We use Material Icons
- We use Fontawesome Icons if no icon in Material Design exists
For watson
to work, you need to execute the following tasks:
manage.py syncdb
manage.py installwatson
If you already have a populated database, you also need to build the indices:
manage.py buildwatson
Pillow is needed for image processing.
For Pillow
to work, you need to execute the following tasks:
- install
python-image
via package manager (e.g.apt-get install python-image
) pip3 install -r requirements.txt
For paypal
to work, you need to execute the following tasks:
- Signup at Paypal Developer
- Add this content to
sdf/local_settings.py
:
PAYPAL_TEST = True
PAYPAL_RECEIVER_EMAIL = "[email protected]"
ENDPOINT = "https://abc.ngrok.com"
SEED_MAX_PAYPAL = "[email protected]"
SEED_MARTIN_PAYPAL = "[email protected]"
manage.py makemigrations
manage.py migrate
- Start ngrok via
ngrok -proto=https -subdomain=abc 3001
- Set cronjob via
crontab -e
and add this line:
*/10 * * * * python3 /path/to/sdf/manage.py abort_old_payments
- 4 Spaces instead of Tabs for indentation
I recommend using git in terminal, so you have full control. You only need a couple of commands (pull,commit,status,push,checkout,add
).
cp config/gitconfig ~/.gitconfig
- Change your name and email in
~/.gitconfig
- Branch
master
contains code which works and will be deployed. - Branch
develop
is our development branch. Every feature branch will be merged into thedevelop
. - Use your own feature branches for every ticket named like
feature-31/username-topic
. This branch is for one person and its history can be changed (e.g. after rebasing). - Write commit messages like
Verb topic
. Verb could be one of Add, Fix, Refactor, Remove,... Example:Add user authentication
- Rebase/Squash your history if needed before merging in
develop
, so there is only one commit to merge. - Important: Use
git checkout develop; git pull --rebase
for updating the currentdevelop
branch from remote, so no useless commit messages likeMerge branch 'master' of git://...
will be created. (see http://gitready.com/advanced/2009/02/11/pull-with-rebase.html) - Update changes of
develop
to your current feature branch viagit checkout feature-31/user-topic; git rebase develop