Git Product home page Git Product logo

civic-marketplace's Introduction

Install libraries

pip install -r requirements.txt

For now the project uses Python 2.7, be aware of possible issues if you have Python 3.

Test locally

You can pick either SQLite or MySQL for local testing.

SQLite

No need to do anything, but since our Google cloud app uses MySQL, be aware of possible inconsistencies.

MySQL

sudo apt-get update

sudo apt-get install libmysqlclient-dev mysql-client mysql-server

If it is your first time to install mysql-server, a prompt should appear to ask you to set up the root password.

Start your local MySQL service:

service mysql restart

By default, the service runs on port 3306. Check if the MySQL service is running:

ps aux | grep mysqld

Check if you can connect to your local MySQL server using root:

mysql -u root -p then enter the root password.

If you have not created the local MySQL database: CREATE DATABASE catalyst;

Uncomment the MySQL local service part in the DATABASES entry in civic_marketplace/settings.py. Put your root password there.

Populate the database

python manage.py makemigrations

python manage.py migrate

python manage.py loaddata skills causes organizations preferredtimes

Check if django tables are created in your selected backend.

If you met any migration problem and had to clean up everything, here is a tutorial on how to reset migrations. Be aware that you will lose all the data by doing this. It happens when old migration scripts are not applicable to the new schema.

Run the server on localhost

python manage.py runserver

Then check the website in localhost:8000.

You can also do:

python manage.py runserver host:port

but may need to add the host in ALLOWED_HOSTS in civic_marketplace/settings.py.

Connect to Google Cloud Platform

Note: our cloud instance has expired.

./cloud_sql_proxy -instances="catalyst-market:us-central1:catalyst"=tcp:3307

This launches a local service listening on 3307, which connects to our instance on Google Cloud Platform. Change the port number if needed.

To connect to the local service and thus also our cloud instance, run:

mysql -h 127.0.0.1 --port 3307 -u catalyst -p then enter catalyst as the password.

Notice: ALL CHANGES MADE HERE APPLY TO OUR CLOUD INSTANCE

Deploy to Google Cloud Platform

Install Cloud SDK: https://cloud.google.com/sdk/downloads

To include third-party libraries:

pip install -t lib/ django google-cloud social-auth-app-django django-datetime-widget django-widget-tweaks

Collect static files:

python manage.py collectstatic

Finally, deploy it:

gcloud app deploy --project catalyst-market

Notice: THIS DEPLOYS A NEW VERSION TO GOOGLE CLOUD

Admin account

Admin URI: https://catalyst-market.appspot.com/admin

username: catalyst

password: catalyst

civic-marketplace's People

Contributors

jingjingwang avatar aditya-jalan2 avatar

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.