wagtail

Django Wagtail CSV and photo “upload” - management command

送分小仙女□ 提交于 2021-02-20 02:21:51
问题 I am working on a django/wagtail management command (let's call it "file_upload") that does roughly the following: take "csv" argument, which is a full path to a CSV file. parse and open the result using csv for each row, create and save a custom Wagtail Image model object (inheriting from AbstractImage , with a few extra CharField that I do not think prevent me from doing what I want to do) The (currently simplified) CSV looks like this: 1.jpg,Title 1 2.jpg,Title 2 Does not complicated at

Django Wagtail CSV and photo “upload” - management command

戏子无情 提交于 2021-02-20 02:20:48
问题 I am working on a django/wagtail management command (let's call it "file_upload") that does roughly the following: take "csv" argument, which is a full path to a CSV file. parse and open the result using csv for each row, create and save a custom Wagtail Image model object (inheriting from AbstractImage , with a few extra CharField that I do not think prevent me from doing what I want to do) The (currently simplified) CSV looks like this: 1.jpg,Title 1 2.jpg,Title 2 Does not complicated at

Django Wagtail CSV and photo “upload” - management command

こ雲淡風輕ζ 提交于 2021-02-20 02:17:19
问题 I am working on a django/wagtail management command (let's call it "file_upload") that does roughly the following: take "csv" argument, which is a full path to a CSV file. parse and open the result using csv for each row, create and save a custom Wagtail Image model object (inheriting from AbstractImage , with a few extra CharField that I do not think prevent me from doing what I want to do) The (currently simplified) CSV looks like this: 1.jpg,Title 1 2.jpg,Title 2 Does not complicated at

Wagtail Tinymce - ModuleNotFoundError: No module named 'wagtail.wagtailadmin'

折月煮酒 提交于 2021-02-11 13:50:56
问题 I'm trying to install the package "wagtailtinymce" already downloaded it, however, the repository tutorial is completely bad. I do not know if it's because of some update or something. I'm using the latest version of wagtail and I already have a project created (obvious). The error is in every import the package tries to make, and since I'm starting in Django and Wagtail, I do not know what to do. I have not been able to migrate the application yet because of this error. File "/mnt/sda3

Wagtail modeltranslation doesn't work with DEBUG = False

余生长醉 提交于 2021-02-11 13:27:55
问题 I have a problem with absent redirection to the default language for the multilanguage wagtail site. If I set DEBUG = False on production, I got Internal server error , because redirection to url with language postfix is absent. If DEBUG = True everything works fine. I'm using wagtail_modeltranslation https://progtribe.com/ - doesn't work https://progtribe.com/uk - works I use Wagtail, Gunicorn, Nginx In my error logs I see only This log from gunicorn: If I set DEBUG = True then I get 302

Wagtail modeltranslation doesn't work with DEBUG = False

帅比萌擦擦* 提交于 2021-02-11 13:26:32
问题 I have a problem with absent redirection to the default language for the multilanguage wagtail site. If I set DEBUG = False on production, I got Internal server error , because redirection to url with language postfix is absent. If DEBUG = True everything works fine. I'm using wagtail_modeltranslation https://progtribe.com/ - doesn't work https://progtribe.com/uk - works I use Wagtail, Gunicorn, Nginx In my error logs I see only This log from gunicorn: If I set DEBUG = True then I get 302

How do you translate the slug value of a page?

旧街凉风 提交于 2021-02-10 23:32:22
问题 I'm trying to implement a language switcher, for which I'm using the Django recommended form: <form action="{% url 'set_language' %}" method="post">{% csrf_token %} {% get_current_language as LANGUAGE_CODE %} <input name="next" type="hidden" value="{{ redirect_to }}"> <input name="language" type="hidden" value="{% if LANGUAGE_CODE == 'en' %}es{% else %}en{% endif %}"> </form> My urls.py is set up like so: urlpatterns = [ # Wagtail urls re_path(r'^cms/', include(wagtailadmin_urls)), re_path(r'

How do you translate the slug value of a page?

北慕城南 提交于 2021-02-10 23:30:22
问题 I'm trying to implement a language switcher, for which I'm using the Django recommended form: <form action="{% url 'set_language' %}" method="post">{% csrf_token %} {% get_current_language as LANGUAGE_CODE %} <input name="next" type="hidden" value="{{ redirect_to }}"> <input name="language" type="hidden" value="{% if LANGUAGE_CODE == 'en' %}es{% else %}en{% endif %}"> </form> My urls.py is set up like so: urlpatterns = [ # Wagtail urls re_path(r'^cms/', include(wagtailadmin_urls)), re_path(r'

many-to-many relationship of wagtail page model to itself?

巧了我就是萌 提交于 2021-02-10 14:47:44
问题 So i got a PlantDetailPage model with "companion" field among others (yes plants can be companions), in which I should be able to select other PlantDetailPages. I got the thing to show up, create new plants in inline (yes, a menu in the menu in the menu...), but there's few issues: 1) It just won't select them (no action on clicking "select plantdetailpage") 2) "companions" menu button is now shown on the left (like a snippet that it became?) - which I'd like to avoid. 3) I don't know how to

wagtail AbstractImage, ParentalManyToManyField and ClusterableModel

天涯浪子 提交于 2021-02-07 17:33:06
问题 Using wagtail 2.1, django 2.0.3, python 3.6.4 I have the following (simplified) custom image model, linked to PhotoType and PhotoPlate via m2m relationships: from wagtail.images.models import AbstractImage from modelcluster.fields import ParentalManyToManyField from modelcluster.models import ClusterableModel class PhotoType(models.Model): title = models.CharField(verbose_name='Title', max_length=255, blank=False, null=False, default=None) class PhotoPlate(models.Model): plate= models