i have found a django slideshow and have installed it following the guide bellow
https://github.com/clarle/django-slides
Download and place the 'slideshow' folder somewhere on your PYTHONPATH.
(i placed it in site packages)
Add slideshow to your INSTALLED_APPS under settings.py.
(I added it to satchmo store settings.py and also main satchmo settings.py to be sure)
To use a slideshow in another Django application, you can refer to the slideshow object as slideshow.Slideshow in your Django models.
(this i was not sure how to do or if i needed to)
If you're not extending base.html, make sure you have jQuery 1.4.2+ and Slides 1.1.7+ in your templates somewhere. Use {% load slideshow_tags %} in whatever template you wish to use a slideshow in.
the module shows up in the satchmo admin page but when i try to add or change a slideshow i get an error
DatabaseError at /admin/slideshow/slideshow/add/no such table: slideshow_slide
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/slideshow/slideshow/add/
Django Version: 1.4.20
Exception Type: DatabaseError
Exception Value:
no such table: slideshow_slide
Exception Location: C:\Python27\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 344
Python Executable: C:\Python27\python.exe
Python Version: 2.7.9
Python Path:
['C:\Users\Administrator\MyStores\store',
'C:\Python27\lib\site-packages\satchmo-0.9.3-py2.7.egg',
'C:\Windows\SYSTEM32\python27.zip',
'C:\Python27\DLLs',
'C:\Python27\lib',
'C:\Python27\lib\plat-win',
'C:\Python27\lib\lib-tk',
'C:\Python27',
'C:\Python27\lib\site-packages',
'C:\Python27\lib\site-packages\win32',
'C:\Python27\lib\site-packages\win32\lib',
'C:\Python27\lib\site-packages\Pythonwin',
'..\..\apps',
'']
i think its telling me that there is no database setup for the slideshow but am not sure if that is the case or if it is something else altogether as i am a python beginner, i would be gratefull for any help with this.
thanks
kev
I managed to install the slideshow module from https://github.com/clarle/django-slides in satchmo
the solution in the end was really easy, all i had to do was to place the slideshow folder in my PYTHONPATH (i put it in the site packages directory)
i added 'slideshow',
to the INSTALLED_APPS section of my settings.py file in my custom satchmo store directory/folder.
and finally i opened a terminal/cmd prompt and executed the following command
python manage.py syncdb
and hey presto the modules were added, the database updated with the new tables and once i had run the server and logged into the admin page i am now able to setup my slideshow
i hope this helps anyone else who needs the slideshow in satchmo as the clue to updating the database came from another install guide for a different slideshow which i thought i would chance it and have a go.
Related
I have a Cookiecutter Django project in which I'd like to add a "SiteSettings" model to control constants. My first instinct was to run manage.py startapp site. However I received the following message:
CommandError: 'site' conflicts with the name of an existing Python module and cannot be used as an app name. Please try another name.
Upon closer inspection, it appears that Cookiecutter already created a sites module within contrib, but with no models.py file. So I decided to make a models.py with the SiteSettings model in this directory.
However when I run makemigrations it says: No changes detected in app 'sites'
How can I add my desired model to this module and get migrations working for this module?
You will run into countless problems if you follow this path. Just use another name and do manage.py startapp newname.
I'm trying to deploy a small django app on heliohost following the instructions in this post How to deploy a Django site using a different version of Django on Heliohost and also the official ones. But when I try to browse the site I only get the index of my public_html folder. Does anyone have any idea what I am doing wrong?
I know this is old post but if you still trying django on heliohost, try cookiecutter template for heliohost.
$ pip install cookiecutter
$ cookiecutter https://github.com/rahul-gj/cookiecutter-helio.git
project_name [mysite]: ---> Type your project name here.
helio_user [user_name]: ---> your heliohost username.
The folder with project name will be created in your working directory.
Paste the content of the folder (folder + manage.py file) on heliohost public_html directory.
go to yourusername.heliohost.org/yourproject
You should see something like this:
https://krydos.heliohost.org/djangotest/
Explore the django on heliohost.
I'm trying to install the following django app from the cheeseshop:
https://bitbucket.org/codekoala/django-articles/overview
This is my first day of Django-ing and I'm unsure what to do to get the app's folder populated inside my project.
So far, I've pip installed the app into my virtualenv. This is verified by opening a python shell and getting no errors when I run "import articles"
I've edited the settings.py file and added it to the list of installed apps. I believe this to be OK as I can then run runserver without any "module not found" errors.
syncdb also ran fine.
Where do I go from here?
ie, I would like to have a section of the website called News which uses this app. I have no routes or other apps configured yet, just a clean Django with psycopg2.
EDIT: Enabling the default admin site, I can manage the Articles there, but still unsure of how these will be displayed on the site when I have no app folder created for them. When trying to startapp articles, I'm warned it's conflicting name with an existing module..
No need to create a new app called articles. As you are able to import articles via the python console you have successfully installed it. You can find it in your virtualenv folder in the folder site-packages:
/path_to_your_virtualenv/.virtualenvs/<virtualenvname>/lib/<pythonversion>/site-packages
You can use this app, installed via pip, as it is an app which lives in your project folder.
You just need to include the articles urls in your own urls.py. Since you say you want it under News, this would do fine:
urlpatterns = patterns('',
(r'^news/', include('articles.urls'),
)
Note though that the readme for the articles app implies that you'll need to create your own base template for it to inherit from. Just create a base.html file in a directory called templates under your project, give it a basic HTML structure, and put in {% block content %}{% endblock %} in the relevant place (and the same for the other blocks mentioned in the readme).
You should probably do the Django tutorial anyway, to understand exactly what's going on with the URL and the templates.
im using django 1.2 and I am trying to deploy django using apache mod_wsgi.
My app works fine using the development server, but when I try to use the wsgi, it can not load file containing template filters.
I have it in structure like /app/subapp/templatetags/core_filters.py, init.py is located where it is supposed to. When I try to open any view loading the code, or template loading {% load core_filters %} exception occurs. It says it is not a valid tag library, at lists all the apps it tried to find core_filters in, but my app.core.templatetags.core_filters is not among them although it is listed in installed apps.
Any suggestions, sollutions?
Any chance you accidentally left your local_settings.py file on the live server, causing some pathing issues or there's some other difference between your settings.py and local_settings.py files?
There was an error on the python path. uWsgi had different python path that contained another package with the same name
If anyone knows how to make django-cms play with grappelli, please give some tips
Well I've just gone through a fairly epic adventure, the story of which might be of some use to you. The end point of said adventure was getting django-cms 2.1.3 working with django-filebrowser-no-grappelli . Whilst that may sound in fact like the opposite of what you want, I ended up there because what I really wanted was to get django-cms working with filebrowser. Without grappelli though the standard django-filebrowser does not work as expected. But with grappelli django-cms does not work as expected. So therein lay the rub, to quote shakespeare. Getting django-cms working with filebrowser was relatively straight forward except for the fact that when trying to upload files with uploadify (which is shipped with filebrowser), after selecting the files in the file dialog, nothing happened. Eventually I figured out that this was because the jquery library was being loaded twice: once by filebrowser for use with uploadify, and once by django-cms. So by commenting out the second line in this file:
your site packages dir/cms/templates/cms/toolbar/toolbar.html
which loads jquery.min.js, uploadify worked as expected. Soooo...if you just want to get django-cms working with grappelli so you can use filebrowser, the above might be helpful. Here is my settings file for reference.
My solution is to implement 2 subdomains, 'www' and 'cms', in each of which a separate instance of the Django site is running with a different STATIC_ROOT and a modified INSTALLED_APPS. grappelli runs in the 'www' subdomain. It is not running in the 'cms' subdomain, so that you can use django-cms there.
Set up a subdomain: cms.example.com
Modify your webserver to serve this subdomain. Use the same settings as your main django site but point to a different script handler. e.g. if using wsgi direct the server to run wsgi_cms.py
cp wsgi.py wsgi_cms.py. Edit wsgi_cms.py and change the line
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
to os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings_cms")
settings_cms.py :
:
from settings import *
INSTALLED_APPS.remove('grappelli.dashboard')
INSTALLED_APPS.remove('grappelli')
STATIC_ROOT = os.path.join('/what/ever/static_cms/')
STATIC_URL = '/static_cms/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/`
modify settings.py: change INSTALLED_APPS from a tuple to a list
restart web servers
./manage.py collectstatic --settings=myproject.settings_cms
your regular site continues as normal. To edit django-cms pages with grappelli disabled go to http://cms.example.com/admin/cms/page/
I've once made a django-cms fork on github that supports grappelli, it's a bit outdated, but maybe helps you to get started or probaly you'd like to contribute.