Giter Site home page Giter Site logo

user-cube / xpto_store Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4.99 MB

Shop Store Made in Django.

Home Page: https://xpto-store.herokuapp.com/

Python 17.74% CSS 1.39% HTML 80.86%
shopping-cart shop-store django html5 css javascript django-templates django-orm

xpto_store's Introduction

XPTO Store

Online Shop Store made with django framework.

Authors

Deploy on Heroku

Primeiro é preciso criar um Procfile:

echo 'web: gunicorn TPW_Proj1.wsgi' > Procfile

Alterar o ficheiro settings.py adicionando no topo:

import django_heroku

E no final do documento acrescentar:

django_heroku.settings(locals())

Adicionar aos requisitos:

django-heroku

Migrate to PostgreSQL

In order to achieve that, do the following steps in order :

$ python manage.py dumpdata > db.json

Change the database settings to new database such as of MySQL / PostgreSQL.

import os

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': os.getenv('DB_NAME'),
        'USER': os.getenv('DB_USER'),
        'PASSWORD': os.getenv('DB_PASS'),
        'HOST': os.getenv('DB_HOST'),
        'PORT': os.getenv('DB_PORT'),
    }
}

Note: We must create an .env file and add the following lines to settings.py

from dotenv import load_dotenv
load_dotenv()
$ python manage.py migrate
$ python manage.py shell

Enter the following in the shell

from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()

After that we only need to load the previous dataset into the new database

$ python manage.py loaddata db.json

xpto_store's People

Contributors

miguelmatos-ua avatar preokane avatar user-cube avatar

Watchers

 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.