This README would normally document whatever steps are necessary to get your application up and running.
Selfpower Website for Selfpower NGO at https://selfpower.ro
Summary of set up Setup for local on Macbook, Staging and Live/Production.
Deployment instructions
Check if you have Py3 and ocally make a new virtualenv in myProjects:
# Go to you local projects folder:
cd $HOME/myProjects/
# Check to make sure Py3 is available:
which python3.6
/usr/local/bin/python3.6
# Create a virtualenv
python3 -m venv selfpower
rm pip-selfcheck.json
to remove it, because it is in the repo and will refuse to clone (Issue #196)Go to github to the selfpower repo, click the green button "Clone or download" to the repo link to clipboard:
cd selfpower
git clone --no-checkout git@github.com:ionescu77/selfpower.ro.git tmp && mv tmp/.git . && rmdir tmp && git checkout master
passenger_wsgi.py
):# activate:
export SECRET_KEY="blbabb32#%$@$#%$^$#^"
export DJANGO_SETTINGS_MODULE="SelfpowerProject.settings.local"
export MAILCHIMP_API="--hidden--"
export MAILCHIMP_LIST_ID="--hidden--"
export EMAIL_HOST_USER="webmaster@selfpower.ro"
export EMAIL_HOST_PASSWORD="--hidden--"
export GOOGLE_RECAPTCHA_SECRET_KEY="--hidden--"
export GOOGLE_RECAPTCHA_SECRET_SERVER_KEY="--hidden--"
database_staging.py
and database_production.py
need to read secrets from ENV Variables too, so you need this in activate:export STAGING_DATABASE_PASSWORD="--hidden--"
Additionally, for the virtual environment created, in the activate.bat
file we must use another type of implementation of the ENV variables:
set "SECRET_KEY=blbabb32wdfiwjwrs"
set "DJANGO_SETTINGS_MODULE=SelfpowerProject.settings.local"
set "MAILCHIMP_API=--hidden--"
set "MAILCHIMP_LIST_ID=--hidden--"
set "EMAIL_HOST_USER=webmaster@selfpower.ro"
set "EMAIL_HOST_PASSWORD=--hidden--"
set "GOOGLE_RECAPTCHA_SECRET_KEY=--hidden--"
set "GOOGLE_RECAPTCHA_SECRET_SERVER_KEY=--hidden--"
set "STAGING_DATABASE_PASSWORD=--hidden--"
bin/activate
, finally we can activate the virtualenvsource bin/activate
# Check pip --version (must be 3.6)
pip --version
# Install requirements
pip install -r requirements/local.txt
pip install django-markdown-app==0.9.6
os.environ['DJANGO_SETTINGS_MODULE'] = "SelfpowerProject.settings.test"
os.environ['SECRET_KEY'] = ")&mx2e#kxcjitqcke^+1ji1-wk#m47sd9crs4!bstnk)*8u@"
os.environ['EMAIL_HOST_USER'] = 'webmaster@selfpower.ro'
os.environ['EMAIL_HOST_PASSWORD']="--hidden--"
os.environ['GOOGLE_RECAPTCHA_SECRET_KEY']='--hidden--'
os.environ['GOOGLE_RECAPTCHA_SECRET_SERVER_KEY']='--hidden--'
os.environ['MAILCHIMP_API']="--hidden--"
os.environ['MAILCHIMP_LIST_ID']="--hidden--"
os.environ['STAGING_DATABASE_PASSWORD']='--hidden--'
python src/manage.py makemigrations
python src/manage.py migrate
python src/manage.py createsuperuser
Nume utilizator (leave blank to use 'razvansky'):
Adresă de email: some_email@mail.raz
Password:
Password (again):
created post_save 8hfg2o3gpefh3go2fjwurygt3984fhibwi razvansky
Superuser created successfully.
It is not the case because the sqlite was still in the repo
python src/manage.py runserver
Before accessing the last menu item user profile!
http://127.0.0.1:8000/autentificare/profile/
You need to login one first time in Administrare - the Administrative Web Interface - in order to create the first profile:
http://127.0.0.1:8000/administrare
For the example login with the superuser. Otherwise you will get a crash when accessing the profile page.