· 8 years ago · Jan 21, 2018, 03:32 PM
1
2cd pets
3Configure your instance
4The project configuration uses python-decouple to dynamically read environment variables and .env files.
5
6If you want, you can get started by copying contrib/sample-env as .env:
7
8cp contrib/sample-env pets/.env
9Then you have to set following variables:
10
11Basic Django settings
12SECRET_KEY: Django's secret key
13ALLOWED_HOSTS (e.g. 127.0.0.1, .localhost) Django's allowed hosts
14DJANGO_SETTINGS_MODULE: In order to make development and deploy to production simpler there's two settings module; pets.settings.dev for development and pets.settings.prod for production.
15Database
16DATABASE_URL: (e.g. postgres://username:password@server:port/database_name) Database URL
17DB_CONN_MAX_AGE: (e.g. 0) Django's database CONN_MAX_AGE
18Email configuration
19SENDGRID_API_KEY: API key of you SendGrid account.
20DEFAULT_FROM_EMAIL: The email address that will be used as the from email field.
21OAuth
22If you want to login via social media, you will have to create apps as a developer at Facebook and/or Twitter. Once you're done, set the app secret and app key for each of them:
23
24SOCIAL_AUTH_FACEBOOK_KEY
25SOCIAL_AUTH_FACEBOOK_SECRET
26SOCIAL_AUTH_TWITTER_KEY
27SOCIAL_AUTH_TWITTER_SECRET
28Other dependencies
29Install Pillow dependencies
30As Pets uses Pillow, some extra packages are needed. In a Debian based Linux this should do the job:
31
32sudo apt-get install python-dev python3.x-dev libjpeg8-dev
33Install PhantomJS
34To install PhantomJS in a Debian based Linux you migh follow Julio NapurÃ's tutorial.
35
36In a Mac with Homebrew, this does the trick:
37
38brew install phantomjs
39Install Python packages
40pip install -r requirements/local.txt
41Test
42Execute all tests, it will take some minutes.
43
44cd pets
45python manage.py test