Git Product home page Git Product logo

opd-brand-manager's Introduction

1 - DESCRIPTION

This is the source code corresponding to [Open Knowledge Foundation Open Product Data] 1 brand manager developped with Python Django framework version 1.6.

#ย 2 - INSTALLATION

21 - DEVELOPMENT ENVIRONMENT

211 - PREREQUISITES

Mandatory :

  • [Python 2.7.5+] 2
  • [Pip 1.3.1+] 3
  • [VirtualEnv 1.9+] 4
  • [PostgreSQL 9.1.9] 5
  • [libffi 3.0.13+] 6
  • [ElasticSearch 0.90.8+] 7

Optionnal :

  • [VirtualEnvWrapper 3.7+] 8

212 - CONFIGURATION

  1. Create a virtual environment using virtualenv (or if you installed it, virtualenvwrapper).
  • Activate your virtual environment.

  • Clone the current git repository.

  • Install the requirements with pip :

    pip install -r requirements/dev.txt

  • Add the Django settings in your virtalenv postactivate script :

    echo 'export DJANGO_SETTINGS_MODULE="manager.settings.dev"' >> ~/pyve/pod/bin/postactivate

  • Prepare the test database with the Django dumped data (in the last command replace #### by the latest migration number) :

      # First, we need to create a new role 'pod' with PostgreSQL 
      createuser pod
      # Now, we need to create a new database 'pod_brand' with PostgreSQL
      createdb pod_brand
      # At this point the database configured in settings/dev.py is empty
      python manage.py syncdb --migrate
      # At this point the database contains the Django default tables
      python manage.py sqlflush |psql -h localhost -U <user> <dbname>
      # At this point the database contains the Django default tables emptyied
      python manage.py loaddata sql/django_brand_data_####.json
      # At this point the database contains the Django testing data
    

213 - RUN

To run the server, from your virtual environment, only one command is needed :

foreman start

This command should return something like :

11:41:18 web.1  | started with pid 1839
11:41:19 web.1  | 2013-11-18 11:41:19 [1842] [INFO] Starting gunicorn 18.0
11:41:19 web.1  | 2013-11-18 11:41:19 [1842] [INFO] Listening at: http://0.0.0.0:5000 (1842)
11:41:19 web.1  | 2013-11-18 11:41:19 [1842] [INFO] Using worker: sync
11:41:19 web.1  | 2013-11-18 11:41:19 [1847] [INFO] Booting worker with pid: 1847

You can then navigate to the [hereabove mentionned] 9 address in your browser and will see the web application displayed.

214 - MIGRATE

To migrate the database, only one command is needed : python manage.py migrate brand

If you encounter some problems or your database is corrupted : dropdb pod_brand Then re-prepare the test database (except the role 'pod', which stays there)

215 - UPDATING DATABASE

When you modify the model, you'll need to update the database : python manage.py schemamigration --auto brand

If there was no problem, update the dump (replace #### by the migration number) : python manage.py dumpdata > sql/django_brand_data_####.json

21 - PRODUCTION ENVIRONMENT

Heroku needs a custom buildpack to integrate [libffi] 6. This one was created to fit brand-manager needs : [Mibou/heroku-buildpack-python] 10

To use it, Heroku buildpack url must be configured as follow :

heroku config:add BUILDPACK_URL=git://github.com/Mibou/heroku-buildpack-python.git

To take daily dumps, on Heroku, it is needed to add the scheduler add-on :

heroku addons:add scheduler

3 - CONTRIBUTE

To contribute to the brand manager, you must :

  1. Download and read the specifications from the [docs folder] 11 at the repository's root.
  • Leave a message on the "[Who wants to contribute] 12" issue #9 ticket.
  • Wait to be assigned an issue or take an unasigned issue dropping a comment on it.
  • Fork the repository, do your modifications, push them and create a pull request on GitHub. More information about how to contribute in [GitHub documentation] 13.

As much as possible, your changes must validate [PEP8] 14 coding standards. You can also check your contributions using [Pylint] 15.

opd-brand-manager's People

Contributors

fabricetheytaz avatar feng-gao avatar francoisdupayrat avatar mibou avatar philippeplagnol avatar rufuspollock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opd-brand-manager's Issues

[Export Data] How ?

Different out data flow should be created

  • dump to be able to clone the brand repository (which format,...)
  • API to get brand data from and BSIN code for example,
  • etc...

[ADMIN] Owner management - Rename head of column

In the owner management (listing, add form and edit form), the labels should be renamed like this
owner nm -> Owner Name
owner link -> Owner Website
owner wiki en -> Wikipedia English website

[PUBLIC] What should be owner list URL ? How should apps be structured ?

The way the code is currently structured, the obvious way is: http://www.product-open-data.com/brand/owner/

I think it would make more sense to have directly http://www.product-open-data.com/owner/

That's a major architecture question, since unless we just modify the subsite urls or split brand app urls.py into 2 files , it would mean to split the brand app into brand app and owner app, which would also split the assets (css and images) and the admin into 2 parts.

What's your opinion on that ? I'm going to implement with brand/owner/ for now.

Confirmation of suppression

When a brand is deleted, a flag is updated, there's no physical delete.
How is it possible in Django to have a pop up or a screen asking for confirmation ?

[SPECS] Nullable fields in database

In BRAND_PROPOSAL :

  • PROPOSAL_CD : NOT NULL
  • USER_ID : NOT NULL
  • STATUS : NOT NULL

In BRAND_PROPOSAL_REVIEW :

  • PROPOSAL_CD : NOT NULL
  • USER_ID : NOT NULL
  • REVIEW_DT : NOT NULL
  • COMMENT : NULL

[admin] Brand proposal review

  • BrandProposalReview should have a "valid" boolean field.
  • BrandProposal should be saved as Brand if BrandProposal has at least two BrandProposalReviews and "valid" field was True for the two latest BrandProposalReviews for this BrandProposal.

Who wants to contribute

You want to contribute and to be assigned to help ? just let a message here :) thanks in dvance for your help :)
my skype : philippiere

Got 'NoReverseMatch' when clicking on the last page of brand list_view

ok, there are 42 pages of brands, and when you click on 42 page, it shows the debug page:

NoReverseMatch at /admin/brand/brand/
Reverse for 'brand_brand_change' with arguments '(u'',)' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'admin/brand/brand/(.+)/$']

also, if you use the search function with a query string (e.g. 'aaaa') that can not match any records, it reports the same error.

Functional specification

Here is the place to discuss of the Functional specifications in the docs/ folder
Please always indicate the version of the document when you want to discuss of a subject :)

Thanks :)

[GENERAL] Owner management postponed

The owner will not be present in the first version of the brand manager because the codification of the owner code needs a study,...

POD will not be impacted because the owner will keep the table brand_owner incuding BSIN code.

-> Specs to adapt

Recaptcha

I made a mistake in the recaptcha and a server error 500 page is displayed

[ADMIN] Owner Management - Delete button

The owner list should follow the brand list presentation

  • display the logo
  • add a button to delete a owner.

The deletion of a owner is not logical, but the integrity must be checked before to delete it: impossible to delete a owner assigned to 1 or more brands.

Fix the CSS

Remove all the fixed width breaking the design.
For example, nav ul width is fixed to 405px.
Each nav ul li has a fixed width.

[Export Data] API

A restfull API could be a good beginning

input: BSIN and Output, all the data we have about the brand & owner

[admin] brand to validate

when a brand is to validate by the moderator, the status is 3
the status should be a text and not an integrer (ex: status : moderation approval required)

[Public] Propose a brand

Add a form in the public interface to allow visitor to propose a brand to present in the repository
-> see functional specifications

[ADMIN] Brand : input of comments

The field for comments in the Add / Update / Delete form for brand is should be a text area and comment a text in the brand table

How to browse the list of brands

I launch this discussion because the brand list we have currently 2 different approachs in POD and this repository,...

What I did in POD (this is just a point of view and a personal choice) is to create a cache, to pre generate big list of brands and to have 27 lists : a to 7 + 1 list of brands starting with a digit.

The current list doesn't use cache but a search engine.

I wonder is other way exists to make to let people find a brand very easily, so here is my question:
-> what kind of browser do you suggest ?

[Export Data] Synchronization dataflow

Dataflow used to to synchronize daily (or weekly) and in a delta mode (only the diff provided)

content, format and structure to defined

considering it's quite complex, this will be part of the release 1.1

[GENERAL] Owner wiki english to remove

As a master data repository, the database shouldn't contain links to an other source of information.

The link between BSIN and Brand Owners with external data source (such as wikipedia, open corporate, wikidata) will be done on an other project.

[admin] add brand

after comment the following data appear:

User: (None)
Status: 1
Comments: (None)

but

  • comment is already displayed,
  • the login of the moderator should be displayed
  • what is status 1 ?

[Export Data] Dump

A dump must be done do allow a new user of the brand repository to initialize his database

we could at least propose csv and json formats
ne maybe need to create a zip and to put each table in seperate files, or everything together,...

the frequency of the dump is to define,..

Is it possible to have an automatic dump (with a cron ?)

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.