puput | A Django blog app implemented in Wagtail | Blog library
kandi X-RAY | puput Summary
kandi X-RAY | puput Summary
A Django blog app implemented in Wagtail
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a blog page
- Returns the number of comments in the comment system
- Handle GET requests
- Strip leading slash and ending slashes
- Render comments
- Import model
- Return a list of sitemap urls
- Returns the entry url for a blog entry
- Get entries by date
- Update the number of comments
- Lists the most common tags
- Serve entries search
- Serve entries by tag
- Fetch an object from the queryset
- Render a list of categories
- Get entries by category
- Displays the most recent entries
- Return the popular entries
- Update the comment count
- Get the metadata for a given field
- Get entries by author
- Guess the mimetype of an item
- Return the enclosure URL for an item
- Returns the item s description
- Return the canonical URL for a given entry
- Add a post to a link
puput Key Features
puput Examples and Code Snippets
Community Discussions
Trending Discussions on puput
QUESTION
I have a Django site with wagtail and puput integrated into it, as well as whitenoise handling the static files. For some reason, in production, the static files are working for the regular site, but not for the django admin or wagtail admin.
...ANSWER
Answered 2021-May-24 at 22:54You should not need to add the static paths to your urlpatterns when using whitenoise. It's configuration is taken care of by adding middleware.
Also, using django.views.static.serve()
for this purpose (it looks like that is what you are doing in the example) is not suitable for production. The docs state that
This helper function works only in debug mode
This may be related to the issue you are having.
QUESTION
I have a custom image and rendition model, and have followed the wagtail v2.4 guide to implement them:
...ANSWER
Answered 2019-Apr-17 at 13:26The initial migration in the third party library should define a swappable dependency, for example: from wagtail.images import get_image_model_string
QUESTION
I use django-taggit 0.23.0
and wagtail 2.0.2
for a weblog app called puput 1.0.2
.
Puput github repo
My preferred language is Persian (Farsi) in Wagtail's admin dashboard and one of my language letters is on the "comma" key of keyboard.
So, each time I want to use that letter, tag gets submitted and I cannot add tags properly. How can I customize ui-widget in adding/editing tags in admin's dashboard?
I also tried using these command lines in settings and overwriting its functions but yet didn't solve my problem:
TAGGIT_TAGS_FROM_STRING = 'utils.comma_joiner'
TAGGIT_TAGS_FROM_STRING = 'utils.comma_splitter'
Any solution would be a lot appreciated!!!
...ANSWER
Answered 2018-Dec-05 at 10:36You should upgrade to Wagtail 2.3. This includes a fix for the same issue on Cyrillic keyboards (where the letter б corresponds to the comma key) and should hopefully fix the problem for Persian too.
QUESTION
I´m trying to make a whatsapp button but I´m having problems with the trailing slash at the end on the href. Whatsapp renders wrongly with the trailing slash.
I´m using wagtail and puput. I´d like to do it on template only because wagtail and puput are addons on divio. If I install them separatedly, I would have to remake my website, so I can´t change models.py.
I´m using {% canonical_url entry %}
for the href. What I´d like to have would be something like {% canonical_url|slice:":-1" entry %}
They provide full_url
placeholder, but it doesn´t add date to link. It gives foo.com/slug instead of foo.com/2017/09/01/slug so everything gets rendered wrong too.
Any suggestions?
Thanks!
...ANSWER
Answered 2017-Sep-10 at 17:07There is exactly such a thing: the slice builtin.
The example in the documentation is this:
QUESTION
I am part editor and part developer and not utterly advanced at either career. But I am carrying out only a small-scale project. I'm thinking that in the blog that I recently added to my Django site (as yet only on the development server), with Wagtail and Puput, I might want to upload, say, two ~50KB images per week for five years, after which I'll be doing something else. There will never be a huge number of readers or a need for vast storage. Those being the circumstances, I specifically want to know if what I'm doing to overcome the problems that I encountered with uploaded images not resizing to small screens in the Puput blog, non-responsive design, looks feasible. Or, did I make some stupid mistake and, say, just use the Puput/Wagtail editor incorrectly?
When you click into the "body" textbox in the Puput editor to insert an image, it's quite simple. You just browse for your file, give the image a name, and select whether you want full-width or aligned on the left or right. And upon doing that your image will be uploaded into your previously established "media" folder and the database will simply be updated to contain the location of your image in the "media" folder. The tag in your text body will be given an ID attribute which is a link to the database entry.
Two troubling things then happen: (1) when you go into the browser's Responsive Design Mode the image is bigger than the small screen, no responsiveness; and, you actually don't now have an image stored in your media folder, you have three--- the original is in a subdirectory called "original_images" and there are two images in an "images" subdirectory. The two additional images may not have exactly the same pixel dimensions as the original, depending on your choice of full-width or not, the aspect ratio of the images perhaps, etc.
So this is rather intolerable, unless of course you can tell me what mistake I may have made. Otherwise, here's what I have done to get past this, and again, my question is would this work out in practice or do you have a better idea. I found this post on github, and in particular the comment by jerel concerning an insert_editor_js
and wagtail_hooks.py
hook. This overcomes the richtext limitations of standard hallo and permits opening a second editor window in which you can see and enter HTML.
But Wagtail has this Whitelister
class that only permits certain attributes to be used with certain HTML tags. So the Wagtail people also have a hook for changing that, which is explained here. Here's my version of the wagtail_hooks.py
file:
ANSWER
Answered 2017-Feb-20 at 22:13The root of the issue is that you need a good way of applying the style width: 100%
to all rich text images. Ideally you'd do that with a global CSS rule, which would avoid the need to hand-edit the HTML of the body field.
Puput doesn't seem to provide an "official" way to customise the base templates at present, although there are a few pointers here: https://github.com/APSL/puput/issues/63. The following steps should hopefully do the trick:
- Create a
blog
app inside your project (run./manage.py startapp blog
, and add'blog'
to theINSTALLED_APPS
list in your settings making sure it's abovepuput
) - or if your project already has a suitable app, follow the remaining steps with that app name in place ofblog
; - Create a
blog/templates/puput/
directory Create a file
blog/templates/puput/base.html
containing:
QUESTION
I've added a puput blog to an existing Django project. I followed all the steps for setting up a standalone blog app (https://puput.readthedocs.io/en/latest/setup.html).
It works fine in that I now have working blog at http://127.0.0.1:8000/blog/ and can edit the content and add new posts at http://127.0.0.1:8000/blog_admin/ . But where are all the files? Specifically the template file. I don't see any new folders or files in my Django project.
I would like to edit the html template in order to get a layout that fits with my project. But I can't find any files to edit.
I how someone can help. Thanks!
...ANSWER
Answered 2017-Feb-05 at 08:34puput already provides the templates (https://github.com/APSL/puput/tree/master/puput/templates/puput) so they are installed in your python path along with the puput package. You should be able find them in your /lib/site-packages/pupup/templates.
To change them do not edit them directly from their installation location. Instead, copy the templates you want to override in your project keeping the correct directory structure (i.e puput's blog_page.html should be copied to your templates/puput/blog_page.html) and edit them from there.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install puput
You can use puput like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page