Logo not display in spree commerce - spree

I installed ROR and SPREE in windows. When I am running the site, logo not displaying in the demo content.
Please tell the solution to fix it. I tried to change the logo using spree.rb with below code:
# Example:
# Uncomment to stop tracking inventory levels in the application
# config.track_inventory_levels = false

Try to use something like this. may be it is helpful to you:
Spree.config do |config|
config.admin_interface_logo = 'logo/some_other_logo.png'
config.logo = 'logo/this_logo.png'
end

Related

browser.click() & browser.send_keys() conflict - Selenium 3.0 Python 2.7

I am currently trying to implement a subtitle downloader with the help of the http://www.yifysubtitles.com website.
The first part of my code is to click on the accept cookies button and then send keys to search the movie of interest.
url = "http://www.yifysubtitles.com"
profile = SetProfile() # A function returning my favorite profile for Firefox
browser = webdriver.Firefox(profile)
WindowSize(400, 400)
browser.get(url)
accept_cookies = WebDriverWait(browser, 100).until(
EC.element_to_be_clickable((By.CLASS_NAME, "cc_btn.cc_btn_accept_all")))
accept_cookies_btn = browser.find_element_by_class_name("cc_btn.cc_btn_accept_all")
accept_cookies_btn.click()
search_bar = browser.find_element_by_id("qSearch")
search_bar.send_keys("Harry Potter and the Chamber of Secrets")
search_bar.send_keys(Keys.RETURN)
print "Succesfully clicked!"
But it only works once - if not randomly. If I turn on my computer and run the code, it does click, make the search and print the last statement. The second time, it doesn't click but still make the search and print the final statement.
After each try, I close the session with the browser.quit() method.
Any idea on what might be the issue here?
Specify wait for button and search bar it should solve your problem.
Thanks,D

Biopython Entrez wanting to access /root/.config in Django app

I have some code in a Django app which does the following, to get a Pubmed article by DOI:
def getPubmedByDOI(request,doi):
Entrez.email = 'me#mydomain.com'
handle = Entrez.esearch(db="pubmed", term=doi)
record = Entrez.read(handle)
return getPubmedArticle(request,record["IdList"][0]) // renders the article
This works nicely but for one thing - the Entrez.esearch call insists upon access to /root/.config on the server, specifically to write to the following empty directory:
/root/.config/biopython/Bio/Entrez/DTDs/
It's Apache on Gentoo, running as follows:
User django
Group apache
All the code for the application is in ~django/, so I'd expect any writing to be in ~django/.config rather than /root/.config. I can work around this by changing permissions on /root but a better solution would be to configure Biopython or Apache so as not to write to /root. Does anyone have any suggestions as to how this might be done?
Logged upstream as https://github.com/biopython/biopython/issues/918 which suggests setting:
>>> from Bio.Entrez.Parser import DataHandler
>>> DataHandler.global_dtd_dir
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Entrez/DTDs'
>>> DataHandler.local_dtd_dir = '...'

Undetected Django app when installing from git

I'm having trouble installing django-admin_action_mail from git.
I tried to install it via:
pip install
git+https://github.com/mjbrownie/django-admin_action_mail.git
But Django did not pick it up when I added it to settings.INSTALLED_APPS.
Did I miss something?
The admin code for that app is commented out (see here: https://github.com/mjbrownie/django-admin_action_mail/blob/master/admin_action_mail/admin.py ) so nothing is going to show up on the admin page - even if it's working and enabled.
It looks as though you need to create your own models to handle the mailing functions. Take a look at the README where it tells you to add something like the following in your app's admin.py:
from admin_action_mail.actions import mail_action
class MyModelAdmin(admin.ModelAdmin):
#Note all args are optional
actions = [
mail_action(
'description' : "Send Email to Related Users",
'email_dot_path' : 'email', # dot path string to email field (eg 'user.email')
'email_template_html' : 'admin_action_email/email.html'
'reply_to' : 'noreply#example.com' # defaults to request.user.email
)
]
admin.site.register(MyModel, MyModelAdmin)
Have you added a model like that to your own app's admin.py?
EDIT: As the problem appears to be with installation, the following should help:
You can add arbitrary paths to your wsgi path spec, that means it will pick up Python app modules in other locations. Assuming your app is installed in /home/user2161049/myapp you can put your external modules under /home/user2161049/myapp/external. In this case copy the contents of that app into /home/user2161049/myapp/external/admin_action_mail/.
To add this to your settings.py:
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(SITE_ROOT, 'external'))
The first line defines SITE_ROOT based on the current running script (setup.py) at startup. The second adds the external folder into the search path. You can put anything you want in there, and even define a specific folder somewhere else if you want to keep your externals out of your app folder. Restart the server and it should find the app just fine.

How can django debug toolbar be set to work for just some users?

Right away: yes I know about INTERNAL_IPS.
I'm about to have my django app opened up at work integration and testing. I know there will be debugging and plenty modifications and/or optimizations to be made so I'd love to have the Django Debug Toolbar. However, I'd prefer to not have it up for all of my co-workers (who are the 'clients').
The reason the INTERNAL_IP setting doens't work for just me (btw: I have a static IP on my development computer) is that I am using Nginx as a reverse-proxy and serving with Gunicorn. Because of the reverse-proxy, using an internal_ip of 127.0.0.1 shows DjDT to any computer on the network and using that ip is the only way I've been able to see it myself.
What I'm looking for is either a way to get my IP or my login name to be the only one to access the toolbar. I once saw a thread about the user name limited access but I can't find it...
And as a side question- anyone know why the toolbar doesn't render in IE? For me it just shows as tables on the bottom of the page.
Try:
def show_toolbar(request):
return not request.is_ajax() and request.user and request.user.username == "yourusername"
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'projectname.settings.show_toolbar',
# Rest of config
}
The accepted answer is no longer correct. Newer versions of the toolbar need the value of the SHOW_TOOLBAR_CALLBACK key to be a string with the full import path of the function. So if you're defining your callback function your settings.py file, you'd have to add:
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'projectname.settings.show_toolbar',
}
If you face No .rsplit() Error. NEW SOLUTION:
Because SHOW_TOOLBAR_CALLBACK is now a dotted string path and not support a callable.
edit your settings.py:
def custom_show_toolbar(request):
return True # Always show toolbar, for example purposes only.
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': 'your_project_name.settings.custom_show_toolbar',
}
In Django 4+ this username validation worked for me:
def show_toolbar(request):
return str(request.user) == "username" #... any other validations

Problem getting preview from Django-MarkItUp in Admin interface

I am working on a custom markup formatter for Django and I wanted to interface it with MarkItUp.
It is successfully being called when I save the field, which is of type MarkupField, but when I try to preview this field from the Admin interface using the default settings, all I get back in the preview box is plaintext.
I am using the MarkItUp version from here: http://bitbucket.org/carljm/django-markitup/src
Here are my settings:
MARKITUP_FILTER = ('util.wookie.formatter.wookie', {})
JQUERY_URL = 'js/lib/jquery.js'
In urls, I have the following line:
(r'^markitup/', include('markitup.urls')),
Any ideas?
Is something serving the assets from both the MARKITUP_MEDIA_URL the JQUERY_URL locations?