Giter VIP home page Giter VIP logo

shopit-app's Introduction

ShopIT app Build Status

An AngularJS and Django to manage promotions that are available to customers through the ShopIT mobile app.

Running Locally

Make sure you have Python installed properly. Also, install the Heroku Toolbelt. You also must have Node.js installed in your development machine.

Creating a local PostgreSQL database.

In order to run the application locally you must to have a local postgres database installed.

If you are in a Linux environment you must to install the dependencies for PostgreSQL work with Django and then install PostgreSQL.

$ sudo apt-get install libpq-dev python-dev
$ sudo apt-get install postgresql postgresql-contrib

If you are using a Mac Os environment you can install PostgreSQL via Homebrew.

$ brew install postgresql

Now you need to create a database, a user and grant the created user access to the database. Start by running the command:

$ sudo su - postgres

Your terminal prompt should now say "postgres@yourserver". If this is the case, then run this command to create your database:

$ createdb shopit_db

Create the database user:

$ createuser -P

You will now be met with a series with 6 prompts. The first one is the name of the user, that in our case is shopit, the next prompt is the user password, that in our case is shopit_admin. You will be prompted to confirm the password and then for the next three prompts just enter "n" and hit "enter". This menas that your user only has access to what you give it access and nothing else. Now activate the PostgreSQL command line:

$ psql

Grant to the user access to your recently created database:

$ GRANT ALL PRIVILEGES ON DATABASE shopit_db TO shopit;

Creating a virtual environment

Make sure that you have virtualenv installed. To install virtualenv you need to make sure that you have pip installed.

$ which pip

If pip is installed, the resulting output should be like /usr/local/bin/pip. Otherwise, install pip according to the oficial instructions.

$ curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python

Install virtualenv.

$ pip install virtualenv

Now that virtualenv is installed you are able to create a virtual environment.

$ virtualenv venv
$ source venv/bin/activate

Install the dependencies of your project to run the application locally.

$ pip install -r requirements.txt --allow-all-external

Install bower and its dependencies.

$ npm install -g bower
$ npm install
$ bower install

Apply the migrations the migrations to your database.

$ python manage.py migrate

Run the application locally

$ python manage.py runserver

Now your application is running on http://localhost:8000.

After you finished the development in the virtual environment make sure to deactivate then.

$ deactivate

Deploying to Heroku

Before to deploy the application on Heroku make sure that you have committed the changes in your local repository. After that execute the command:

$ git push heroku master

Documentation

For more information about using Python on Heroku, see these Dev Center articles:

shopit-app's People

Contributors

mvpgomes avatar

Watchers

James Cloos avatar Vasco Pires avatar Hugo Lopes avatar  avatar

shopit-app's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.