educloudalliance / educloud-bazaar-legacy

Service and material distribution channel
4 stars 2 forks source link

CMS graphical interface can not be accessed #63

Closed preriasusi closed 9 years ago

preriasusi commented 9 years ago

There used to be a way for a CMS to access graphical UI in 'bazaar.educloudalliance.org/panel/'. Now that link is forwarding to front page. Also signing in to Bazaar as CMS is not possible, since everything is forwarding to Educloud SSO.

Sturgelose commented 9 years ago

In order to fix the issue, the idea was create a parallel page which handled the old login.

In order to do that, I have created a new URL in /accounts/local which handles the local login. However this wasn't working as the costumer app wasn't properly done. The costumer app was done downloading the code and adding some more code inside. However, Oscar won't handle the new views this way. The reason is that the app had to be inherited and then overridden some parts in order to work properly.

from oscar.core.application import Application 

class CustomerApplication(Application):

should be replaced with

from oscar.apps.customer.app import CustomerApplication as CoreCustomerApplication 

class CustomerApplication(CoreCustomerApplication):

Finally, in order the app to replace the original customer Oscar app, it must be set in settings.py

INSTALLED_APPS = [
                     ...
                     'apps.customer.notifications',
                     'apps.customer.wishlists',
                     'apps.customer.alerts',
                 ] + get_core_apps(
    ['apps.catalogue', 'apps.search', 'apps.order', 'apps.customer', 'apps.checkout'])

Because the previous existing "apps.catalogue.", Oscar didn't understand the .

Finally I added the URL in the costumer/app.py file:

url(r'^local/$', self.login_view.as_view(template_name='customer/local_registration.html'), name='login'),

Which forces the /accounts/local path to use a specific template instead of the default one while still keeping the same logic as the usual login.

Sturgelose commented 9 years ago

Extra info to deploy in dev server:

There were ownership problems, so I had to do a chown -R in order to get them back to the user as Ville had done something wrong.

DON'T USE THE pull.sh FILE IN THE HOME FOLDER! IT DOESN'T WORK! I'll try to fix it soon anyway :)

Second, don't use the symlink in the home folder. The project in the server is located at /var/www/educloud-bazaar/. So just do a git pull origin devel there. Then if the server doesn't work, it can be tested stopping gunicorn with a sudo service bazaar stop and a manage.py runserver to see what is the output while running the server manually. The gunicorn can be started again with a sudo service bazaar start.