-
Notifications
You must be signed in to change notification settings - Fork 2
Home
The whole project includes this repo and the Android app. It aims to create a photo sharing app and a generator that can customize it. This repo is the generator part, which is a website where users can customize their own photo app with their own name and own set of functions.
Currently the website contains only one page, where users can fill in a form and get their own APK after clicking the submit button.
The way to set up the website is mentioned in README.md of this repo.
Before deployment, please test this website following the steps for testing. If it works well, you can then follow the following steps to deploy it into a production environment.
- Modify HTMLs in
Phimpme/static
folder. Especiallyprivacy.html
where stays the user agreement。 - Install Django
- Go to
Phimpme/Phimpme/apps/appshop/gen_script.py
you will see
template_path = "/Users/yzq/Documents/GitHub/phimpme-android/Phimpme"
Change it to the path of the source code of Phimp.me Android app. - Create a
local.properties
file in Phimp.me Android app, as described in the app wiki. - Go to the root of this repo and execute
python manage.py syncdb
to create the SQLite database file and create admin account. - Execute
python manage.py loaddata Phimpme/apps/appshop/appshop.json
to load settings. - Follow Paypal REST API Configuration part to set up the auth key of PayPal.
- Turn off Django's debug mode. Open
Phimpme/settings.py
, then changeDEBUG
andTEMPLATE_DEBUG
intoFalse
. - Deploy the Django website with a web server (e.g. Apache, Nginx). See details here: How to deploy with WSGI
Modify the PayPal auth key in settings.py to your own. The PAYPAL_MODE
should be live
in the production environment. You can apply for these keys on https://www.paypal.com.
PAYPAL_MODE = 'sandbox' # 'sandbox' for testing, 'live' for real environment
PAYPAL_CLIENT_ID = 'AUVEihBfbBCQzLxaTjNdhzV16yI-PvQEHDJblP6P4Ba1Fr5cu_CAZdO0-5IM'
PAYPAL_CLIENT_SECRET = 'EF5uIBClqoo--0oIhKeFtaa-ciCgL34WDkhyQbBslM7_MHZe2DHkNJTAM9pD'
Change the DOMAIN in settings.py to the domain of deployment environment
DOMAIN_NAME = '192.168.56.101:8000'
Change the e-mail part to your own e-mail service
# configure email host
EMAIL_HOST = 'smtp.qq.com' # SMTP server
EMAIL_PORT = 25 # SMTP port
EMAIL_HOST_USER = '[email protected]' # E-mail address
EMAIL_HOST_PASSWORD = 'xxxxxxxx'
In the Phimpme Android app, we modularized each feature as much as possible. We use a set of constants as function switches, and put all of them in Configuration.java. So on the generator side, we could use regular expressions to set the constants into true
or false
in order to enable or disable functions. The app name is in the strings.xml while the app logo is in drawable folder. The experimental version of generator hasn't support changing package name yet, but we will implement it in the future.
There are several steps for the generator script to generate an APK.
- Make a copy of the source code of the app
- Change the app name in strings.xml
- Change the logo in drawable folder
- Modify Configuration.java to enable or disable functions
- Compile the project through
./gradlew
in the project folder.
Details of building the Android project in command line is available in the wiki of the Phimp.me Android app.