Re: Some problems with running django

2018-06-06 Thread 曹逍遙
Hello Julio Biason He is the initial version I did it according to the tutorial [image: Mailtrack] Sender notified by Mailtrack

Re: Some problems with running django

2018-06-06 Thread 曹逍遙
Julio Biason 您好 Thank you I am a beginner mytestsite/settings.py I don't know where to change I did not change him too difficult I do not know what to do [image: Mailtrack] Sender notified by Mailtrack

Progress bar with celery

2018-06-06 Thread Mohammed Noor
Hello guys, I have been trying to create a progress bar in my django application using celery. But i have been greatly unsuccessful in trying to make it work. It would be great if i can get some examples/tutorials which show how to do it. The problem im facing is, my configured tasks aren’t

Re: bootstrap to the login template

2018-06-06 Thread Daniel Germano Travieso
Hey! You should check the documentation https://docs.djangoproject.com/en/2.0/topics/forms/#working-with-form-templates for the Forms that django uses. Each form has it's fields as attributes that generate the input tag that will house the input you receive. You could, for example, create a

Re: Accessing the model attribute of UpdateView & friends

2018-06-06 Thread Daniel Germano Travieso
I'm glad it helped. As you can see, the dispatch method I wrote does override the default definition, but I return the super() dispatch method, so on the default flow the end result is the same (the validity of the request would be checked anyway, only after you set your class atribute). To avoid

Re: is this my correct results.html and detail.html code?i am only a beginer, please check

2018-06-06 Thread 'Anthony Flury' via Django users
I can't see anything necessarily wrong in terms of most browsers but it isn't strictly compliant with the HTML standards. To be strict HTML, your html files should be including *html* and *body* tags as a minimum. The *html* tag starts and end the html file - in theory browsers are entitled

bootstrap to the login template

2018-06-06 Thread G.R. Nobles
Below are two forms, the login form (top) and a bootstrap form (bottom), I'm trying to apply bootstrap to the login page, how can I integrate bootstrap onto the login objects, e.g. {{ form.username }} is the entire textbox, so I'm at a loss being a beginner with Django (my first week).

Re: Best way to add an image from a filefield to django 2.0 admin?

2018-06-06 Thread Mark Phillips
Daniel, I did read the docs and could not get it to work. Probably operator error, as I went back a day later and followed the docs, and it worked as advertised! In the interest of completeness, here are the snippets of what I did: class DocumentMetaDataAdmin(admin.ModelAdmin):

Re: Generating server-side off-line HTML of Django pages ...

2018-06-06 Thread Melvyn Sopacua
On woensdag 6 juni 2018 18:25:35 CEST 'Anthony Flury' via Django users wrote: > Does the test client execute javascript as well ? I can't remember. No. Not even the HTML. For that you need selenium, which is a whole different beast. The test client is used for "unit tests for views". Selenium

Re: Accessing the model attribute of UpdateView & friends

2018-06-06 Thread Mikkel Kromann
Thanks Daniel. Both your proposed solutions worked very well. For now, I don't have other information stuffed into my model definitions, so the urls.py approach could do. However, if I decide to put more information into models.py, the def dispatch() approach could be useful. One question

Re: Django and aws elastic beanstalk

2018-06-06 Thread David Bednarczyk
Im sure you already checked but make sure you also have the appropriate container commands in the .ebextensions folder, under a django.config or python.config file, what ever you want to call it should work. It should look similar to this: container_commands: 01_migrate: command: "python

my image is not showing in my website.Screenshot is attached below:

2018-06-06 Thread Avitab Ayan Sarmah
index.html: {% load static %} {% if latest_question_list %} {% for question in latest_question_list %} {{ question.question_text }} {% endfor %} {% else %} No polls are available. {% endif %} results.html: {{ question.question_text }} {% for choice in

is this my correct results.html and detail.html code?i am only a beginer, please check

2018-06-06 Thread Avitab Ayan Sarmah
results.html: {{ question.question_text }} {% for choice in question.choice_set.all %} {{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }} {% endfor %} vote again? detail.html: {{ question.question_text }} {% if error_message %}{{ error_message }}{% endif %}

Re: Please give the steps to follow this:

2018-06-06 Thread Avitab Ayan Sarmah
thank you eric On Wednesday, June 6, 2018 at 10:22:44 PM UTC+5:30, Eric Pascual wrote: > > Templates contain standard HTML code (or any other text based content) and > template directives, delimited by '{% %}'. They can also contain > placeholders, delimited by '{{ }}', which content is

Re: Please give the steps to follow this:

2018-06-06 Thread PASCUAL Eric
Templates contain standard HTML code (or any other text based content) and template directives, delimited by '{% %}'. They can also contain placeholders, delimited by '{{ }}', which content is processed and replaced with the resulting value. The resulting values are basically the ones you pass

Please give the steps to follow this:

2018-06-06 Thread Avitab Ayan Sarmah
1. In your templates, use the static template tag to build the URL for the given relative path using the configured STATICFILES_STORAGE

Re: Generating server-side off-line HTML of Django pages ...

2018-06-06 Thread 'Anthony Flury' via Django users
Does the test client execute javascript as well ? I can't remember. On 05/06/18 00:14, Bernd Wechner wrote: Thanks Melvyn, looks exactly like what I wanted! Will investigate. I had a feeling this could not be a novel or unique use case. Regards, Bernd. On Monday, 4 June 2018 20:09:25

Fwd: Re: relation “” does not exist in django for app name with mixed-case

2018-06-06 Thread 'Anthony Flury' via Django users
Forwarded Message Subject: Re: relation “” does not exist in django for app name with mixed-case Date: Wed, 6 Jun 2018 17:22:13 +0100 From: Anthony Flury To: Majid Hojati The problem isn't the name of the model. I doubt Django is going to have an issue with

Re: Not Found: / [06/Jun/2018 19:45:16] "GET / HTTP/1.1" 404 2027 Not Found: /favicon.ico

2018-06-06 Thread Avitab Ayan Sarmah
checking.. On Wednesday, June 6, 2018 at 8:38:01 PM UTC+5:30, Sadialiou Diallo wrote: > > that means your image isn't in the good directory > > go to this link.you will see there all details for static files > > https://docs.djangoproject.com/en/2.0/howto/static-files/ > > you most configure your

Re: Not Found: / [06/Jun/2018 19:45:16] "GET / HTTP/1.1" 404 2027 Not Found: /favicon.ico

2018-06-06 Thread Sadialiou Diallo
that means your image isn't in the good directory go to this link.you will see there all details for static files https://docs.djangoproject.com/en/2.0/howto/static-files/ you most configure your project before manipulating images -- You received this message because you are subscribed to

Re: Not Found: / [06/Jun/2018 19:45:16] "GET / HTTP/1.1" 404 2027 Not Found: /favicon.ico

2018-06-06 Thread Daniel Germano Travieso
You probably need to set up your static files on Django. Take a look at the documentation for static file serving. On Wed, Jun 6, 2018, 11:59 Avitab Ayan Sarmah wrote: > what is this means? and hw do i resolve this error? Please comment.And > also my image is not open in my webpage when i have

Not Found: / [06/Jun/2018 19:45:16] "GET / HTTP/1.1" 404 2027 Not Found: /favicon.ico

2018-06-06 Thread Avitab Ayan Sarmah
what is this means? and hw do i resolve this error? Please comment.And also my image is not open in my webpage when i have added an image with black background with .gif suffix.How do i resolve it? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: restore migration files

2018-06-06 Thread C. Kirby
Glad to hear! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: restore migration files

2018-06-06 Thread Leif
thank you, Mike On Wednesday, June 6, 2018 at 9:24:24 AM UTC-4, Mike Dewhirst wrote: > > Maybe you can find an old backup of your models and create a new database > from them. Then overwrite the old models with your latest ones and make > migrations again. Those should suffice to replace the

Re: restore migration files

2018-06-06 Thread Leif
Hi Kirby, Thank you very much. That is very helpful. It is working now. Now the migrations directory is tracked in code repository to prevent from happening again. Best, Leif On Wednesday, June 6, 2018 at 10:23:01 AM UTC-4, C. Kirby wrote: > > If you don't need the history of the app

Re: How to test a WebsocketConsumer that has async_to_sync code in it

2018-06-06 Thread Andrew Godwin
Hi - I will reply on the ticket, as I'll be requesting you paste a large chunk of code and the formatting is better over there! Andrew On Wed, Jun 6, 2018 at 12:26 PM 'Artemis' via Django users < django-users@googlegroups.com> wrote: > I cannot test my *WebsocketConsumer* ( which includes many

Re: restore migration files

2018-06-06 Thread C. Kirby
If you don't need the history of the app migrations then it is pretty straightforward, you will basically end up with a squashed migration. If you do need the migration history (there is another system that is not up to sync with yours, etc) you are stuck, and I would suggest you start using a

Re: Accessing the model attribute of UpdateView & friends

2018-06-06 Thread Daniel Germano Travieso
Ok! I think I see your problem. It is a deeper understanding of python classes that may be the problem. You see, "model" and "self" are class atributes of the python class that houses your class based view (as every class in django is first a python class). So, if you try to access the attribute

Re: Accessing the model attribute of UpdateView & friends

2018-06-06 Thread Mikkel Kromann
Hello Daniel. Thank you for your reply. Perhaps I was not explicit enough in describing my problem - it is far simpler than your solution indicates. In my model definitions, I already have a list of the fields to be represented in the form of UpdateView - it is an attribute in the form of a

Re: restore migration files

2018-06-06 Thread Mike Dewhirst
Maybe you can find an old backup of your models and create a new database from them. Then overwrite the old models with your latest ones and make migrations again. Those should suffice to replace the deleted migrations. Connected by Motorola Leif wrote: >Dear Django Experts: > > >Somehow I

Re: restore migration files

2018-06-06 Thread Leif
there is a suggestion here but not clear: https://stackoverflow.com/questions/34919650/deleted-migration-files-how-to-makemigrations-without-losing-data On Wednesday, June 6, 2018 at 8:54:48 AM UTC-4, Leif wrote: > > Dear Django Experts: > > Somehow I deleted the files under migrations

Re: Accessing the model attribute of UpdateView & friends

2018-06-06 Thread Daniel Germano Travieso
Hello! As you see on the documentation ( https://docs.djangoproject.com/en/2.0/topics/class-based-views/) for the class based views, any arguments you pass to the class based view .as_view() method will override attributes of the class based view, so if you set MyCView.as_view(model=Foo) is the

restore migration files

2018-06-06 Thread Leif
Dear Django Experts: Somehow I deleted the files under migrations directory. Now I am no longer able to migrate new changes. I got 'No change detected' message when I apply python manage.py migrate. Anway I can restore files under migrations directory? Best, Leif -- You received this

Re: Upload video with automatically created thumbnail in Django 2

2018-06-06 Thread Julio Biason
Hello, Another solution is to use `ffmpeg`. There is an option to extract (even multiple) screencaps from a video (sorry, can't remember the proper option for this). And, as Daniel pointed, this is very heavy operation, so either you'll need a heck of a server (with plenty CPU and fast disks) OR

Re: Upload video with automatically created thumbnail in Django 2

2018-06-06 Thread Daniel Germano Travieso
Hello! This type of video rendering and processing should be done by a python module that can handle this workload. For example, you can use OpenCV, a C++ computer vision module that has a python hooks version, so you can upload your video via django the usual way an use the OpenCV to process

Re: Some problems with running django

2018-06-06 Thread Julio Biason
Hi, UnicodeDecodeErrors are quite common in Python 2, when you add an UTF8 character and the system is not set up for it (usually, you need to start your code with `# encoding: utf-8`). But the fact that this seems to affect socket is weird as heck. I'd check anything in mytestsite/settings.py

Re: Best way to add an image from a filefield to django 2.0 admin?

2018-06-06 Thread Daniel Germano Travieso
Hello Mark. You can just override the Model Admin for your model and insert an Inline Form for example. Check the documentation for customizing the model admin! Hope it helps! On Mon, Jun 4, 2018, 18:02 Mark Phillips wrote: > I have a Document model that uploads an image. I have a

Some problems with running django

2018-06-06 Thread 曹逍遙
Hello I run => python manage.py runserver get result --- C:\mydjango\mytestsite>python manage.py runserver Performing system checks... System check identified no issues (0 silenced). You have 14 unapplied migration(s).

How to test a WebsocketConsumer that has async_to_sync code in it

2018-06-06 Thread 'Artemis' via Django users
I cannot test my *WebsocketConsumer* ( which includes many *async_to_sync*) references using the *WebsocketCommunicator*. My problem is identical to this closed issue: https://github.com/django/channels/issues/944 Can someone give me some hints as to how to proceed without removing the

Objects from webservices

2018-06-06 Thread gypsymauro
Hi, I feel very good with django and its ORM, and for this reason I wondering if it's possible to "attach" a model to a webservice (SOAP or REST) and writing some code to load and search objects trough this webservices instad of the DB, it's possible in any way or I've to change strategy?

Re: Accessing the model attribute of UpdateView & friends

2018-06-06 Thread Mikkel Kromann
Thanks for the advice, Andréas. But the response is the same: File "C:\Users\ ... xxx ... \items\views.py", line 7, in ItemUpdateView fields = self.model.fields NameError: name 'self' is not defined As far as I understood, model is an attribute, not a method (though I'm new to

Re: Upload video with automatically created thumbnail in Django 2

2018-06-06 Thread Pravin Yadav
Hi Sir, is it possible to create only one thumbs image. If any one know kindly help me. I'm not getting any solutions. Plz help... Thanks, Pravin Yadav On Tuesday, June 5, 2018 at 6:54:15 PM UTC+5:30, HaatBhaar Developer wrote: > > Hello dude, > I