I have downloaded http://www.djangosnippets.org/snippets/1289/ for breadcrumbs, how to configure it in the application ? i.e. where to place the file and any configuration changes ?
You're likely very new to Django, so you may have a bit of reading to catch up on.
The snippet you linked to is basically a tag library. You can read about how to create and use Django tag libraries in the official docs.
For what it's worth, I would put my tag library in a tags.py file in a Django app.
Related
I would like to know how should i could manage to change the static files use by the saelor framework. I've tried to change the logo.svg but failed to do so.
I'm still learning python program while using the saleor framework for e-commerce.
Thank you.
Here is how it should be done. You must put your logo in the saleor/static/images folder then change it in base.html file in footer and navbar section.
I was wondering what is the best way for customizing zinnia because by default when installing via pip it installs in site packages do I need to open the site package directory and edit it from there? Just want to know. Plus do I need to do some extreme tweaking to zinnia in other for it to work since all I want is a simple post that, displays entries as a list and detail or I just leave it as it is after installation.
As written in the comments, you need to create the static dir and collect the templates.
The best place to look and get an explanation is the Django documentation. Here is the link to the deployment section. Please make sure you read the other sections as well: https://docs.djangoproject.com/en/1.11/howto/static-files/#deployment
everyone:
Recently,I meet a problem when I'm using Django to devlope my site.
In my project, one requirement is to view file online.
That is to say, one can browses files of formats:pdf, jpeg,doc and so on
directly in browsers such as chrome or firefox and so on.
I know this can be done by flash,FlexPaper is one solution. But in django,
not in flash,is there any other solutions? Anyone knows that? If not, I can
only use flexpaper and maybe site can't be accessed via apple devices
Many thanks!!
I think, you can use https://github.com/NetAngels/django-webodt (documentation) with option inline=True:
render_to_response(..., inline=True)
There are plenty of non-flash file browser plugins out there: Elfinder has a Django connector, and you can probably get an integration with CKfinder.
The django packages page also has a list of django file browsers link.
I want to merge the ember.js documentation into my local yuidoc documentation for my project since many of my objects extend Ember Objects.
The Yuidoc Documentation says I can put a property "external.data" in my yuidoc.json file with the address to an external data.json file. Is this file available? If not, can it be made available so those of us documenting our ember projects can auto-sync to ember's documentation?
I believe the file is generated when you run 'yuidoc .' and it is located in the same dir as the index.html file that is built for API documentation (the root of the api docs). There is a file in the git repo here that looks like it might've been generated by this data.json file but it obviously does not contain json format. It would be nice if this data.json file were made available at the root of the published api docs on the ember website
We don't currently commit this file. Can you open an issue on https://github.com/emberjs/website so we can address this?
I am farily new to the topic, but I am trying to combine both Django and Pyjamas. What would be the smart way to combine the two? I am not asking about communication, but rather about the logical part.
Should I just put all the Pyjamas generated JS in the base of the domain, say http://www.mysite.com/something and setup Django on a subdirectory, or even subdomain, so all the JSON calls will go for http://something.mysite.com/something ?
As far as I understand now in such combination theres not much point to create views in Django?
Is there some solution for clean urls in Pyjamas, or that should be solved on some other level? How? Is it a standard way to pass some arguments as GET parameteres in a clean url while calling a Pyjamas generated JS?
You should take a look at the good Django With Pyjamas Howto.
I've managed to get the following to work, but it's not ideal. Full disclosure: I haven't figured out how to use the django's template system to get stuff into the pyjamas UI elements, and I have not confirmed that this setup works with django's authentication system. The only thing I've confirmed is that this gets the pyjamas-generated page to show up. Here's what I did.
Put the main .html file generated by pyjamas in django's "templates" directory and serve it from your project the way you'd serve any other template.
Put everything else in django's "static" files directory.
Make the following changes to the main .html file generated by pyjamas: in the head section find the meta element with name="pygwt:module" and change the content="..." attribute to content="/static/..." where "/static/" is the static page URL path you've configured in django; in the body section find the script element with src="bootstrap.js" and replace the attribute with src="/static/bootstrap.js".
You need to make these edits manually each time you regenerate the files with pyjamas. There appears to be no way to tell pyjamas to use a specific URL prefix when generating together its output. Oh well, pyjamas' coolness makes up for a lot.
acid, I'm not sure this is as much an answer as you would hope but I've been looking for the same answers as you have.
As far as I can see the most practical way to do it is with an Apache server serving Pyjamas output and Django being used as simply a service API for JSONrpc calls and such.
On a side note I am starting to wonder if Django is even the best option for this considering using it simply for this feature is not utilizing most of it's functionality.
The issue so far as I have found with using Django to serve Pyjamas output as Django Views/Templates is that Pyjamas loads as such
Main html page loads "bootstrap.js" and depending on the browser used bootstrap.js will load the appropriate app page. Even if you appropriately setup the static file links using the Django templating language to reference and load "bootstrap.js", I can't seem to do the same for bootstrap.js referencing each individual app page.
This leaves me sad since I do so love the "cruftless URLS" feature of Django.