- Clone this repo via
git clone https://github.com/DSIW/sdf.git - Install python3 via package manager (e.g.
pacman -S python) - Install
virtualenvandvirtualenvwrappervia 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_sdfviamkvirtualenv 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.localhostif local server is running viapython manage.py runserver 3001.
libjpeg: if you do not have this already installed dosudo apt-get install libjpeg-devdecorator: Required byipythondjango-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_plusipython-genutils: Required byipythonpath.py: Required byipythonpexpect: Required byipythonpickleshare: Required byipythonptyprocess: Required byipythonrequests: Required bydjango-paypalpython-dateutil: Required by./reset_db.shsimplegeneric: Required byipythonsix: Required bydjango-extensionstraitlets: Required byipythonWerkzeug: Optional dependency ofdjango-extensionswheel: 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 syncdbmanage.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-imagevia 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 = "...-facilitator@example.com"
ENDPOINT = "https://abc.ngrok.com"
SEED_MAX_PAYPAL = "...-facilitator@example.com"
SEED_MARTIN_PAYPAL = "...-buyer@example.com"
manage.py makemigrationsmanage.py migrate- Start ngrok via
ngrok -proto=https -subdomain=abc 3001 - Set cronjob via
crontab -eand 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
mastercontains code which works and will be deployed. - Branch
developis 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 --rebasefor updating the currentdevelopbranch 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
developto your current feature branch viagit checkout feature-31/user-topic; git rebase develop