rachelsince1995/Esmeer-Oscar
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Before running anything, Oscar requires virtualenv and virtualenvwrapper to be installed. To do this: 0. run pip install django-oscar 1. run pip install virtualenv 2. run pip install virtualenvwrapper 3. Open .basrc (or whatever your shell startup file is, i.e .profile, etc) in a text editor (located in source "~/.bashrc") 4. Add the following three lines to the shell startup file: export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel source /usr/local/bin/virtualenvwrapper.sh 5. Navigate to the Esmeer-Oscar folder 6. run mkvirtualenv oscar 7. run workon oscar Now that virtualenv has been set up, make sure that your database is completely empty and named 'production' with no username or password. To ensure this, do the following: 1. run mysql 2. Enter drop database production; 3. Finally, enter create database production; If all the steps were successful thusfar: 1. Navigate to the EsmeerOscar folder and run python manage.py migrate 2. Now run the server (python manage.py runserver) Note: If you have issues with the migration concerning the mysqldb database, it's because virtualenv has no idea what you had installed on your system prior apparently. I also had issues installing the python mysql package via pip. Here's how I fixed it: 1. apt-get install libmysqlclient-dev 2. pip install mysql-python Awesome. So we have the site up now. It's beautiful, right? RIGHT? ...Ahem. Now to populate the database with the countries of the world... 1. pip install pycountry (if you don't already have it) Note: Before running this next step, it's important to note that, by default, the next command will mark all countries as shipping countries. If you call it with the --no-shipping option, it will not mark any of them as shipping so it will need to be marked manually. 2. python manage.py oscar_populate_countries --no-shipping After running the above command you will need to open up mysql and manually add update production.address_country set is_shipping_country=1 where name ="United States of America"; update production.django_site set name="esmeer.com"; update production.django_site set domain="esmeer.com"; All of the necessary steps to start this from scratch (and what I personally used to set this up) can be found here: run pip install pillow sudo apt-get install libjpeg-dev http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html Have a nice freakin' day. :) UPDATE!! When pulling master, it is now necessary to install certain packages to enable Paypal support. 1. Make sure you are in your virtual environment. Run "pip install django-oscar-paypal". 2. After successful installation, run "python manage.py syncdb" NOTE -- There is currently an issue with product images that has not yet been addressed that is almost certainly related to this integration. Esmeer Gmail: Login: EsmeerTest@gmail.com Password: EsmeerFTW PAYPAL ACCOUNTS: Paypal Dev Account: Login: EsmeerTest@gmail.com Password: EsmeerFTW! Paypal Test Buyer: Login: EsmeerTest-buyer@gmail.com Password: EsmeerFTW! LESS integration steps: 1) RUN as ROOT: curl -sL https://deb.nodesource.com/setup | sudo bash - (Add Nodejs repo) 2) RUN as ROOT: sudo apt-get install -y nodejs (Install Nodejs) 2.1) sudo apt-get install npm & npm install -g less 3) pip install django-static-precompiler (Make sure you are working on your virtualenv) 4) YOU'RE DONE! LESS compilation should work now. DEFAULT PRODUCT UPDATE For the default product type to work, run: ./manage.py loaddata EsmeerOscar/fixtures/productClass.json This just feeds the productClass database a default product type. You should only have to run this once, unless the ProductClass table is wiped. Then you have to run it again. Setting up Solr on your machine Download and extract -------------------- $ wget http://archive.apache.org/dist/lucene/solr/4.7.2/solr-4.7.2.tgz $ tar xzf solr-4.7.2.tgz Place this somewhere not in our Esmeer directory, as we don't want to commit the solr framework to GitHub. Install pysolr dependency $ pip install pysolr Start the server ---------------- $ cd solr-4.7.2/example/solr/collection1 $ java -jar start.jar You’ll need to revise your schema. You can generate this from your application (once Haystack is installed and setup) by running $ ./manage.py build_solr_schema. Take the output from that command and place it in solr-4.10.2/example/solr/collection1/conf/schema.xml. Then restart Solr Pull in Indexes --------------- Now we need to build the index into our project. Make sure Solr and the Django Web Server is running and execute this To pull in indexes make sure your settings.py has the following line. This will do it automatically. HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' Alternatively you can run the following line to rebuild manually. $ python manage.py rebuild_index --noinput Everything should be good now. All changes to settings.py and search_indexes.py should be handled in the Solr branch or merged in master depending on when you read this Deployment with Vagrant After installing Vagrant you will need to install the aws-pluggin Then with the virtualbox image you will be able to run vagrant up. Here is a link if you have questions: http://www.iheavy.com/2014/01/16/how-to-deploy-on-amazon-ec2-with-vagrant/ **Keep in mind this does not work with the free instance found that out the hard way. So Deployment to the free tier was done by the following steps: On your local machine spin up the VM for deployment: Install all the necessary packages according to this read me. Then just copy over the /var/www/ directory to /var/www/ on the server and change the permissions After this is done make sure your apache configuration is configure correctly An example of this is on the current production machine or the vm /var/apache2/sites-enabled/000-default You can only access the server if an account has been created for you or using AWS public key given to you. TESTING FOR PRODUCTION SITE AS OF 5/1 https://docs.google.com/document/d/1o37fnRXDkH6sWGe6fithe5qz0YKgdppS3_mt1avDT98/edit?usp=sharing
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published