How to dump results and progress of a script in a log file

2020-05-05 Thread Ram
Hi, We are running a script from our Django App's admin control and this script is going to 1. extract the data from XML feed or an API and insert the results into a db table 2. once the data is saved in a db table, the data will be presented in front app page 3. but we want to dump the output

Re: reg: User model data missing from web page

2020-05-05 Thread 'Amitesh Sahay' via Django users
Hello Chetan,  Below is how I have created the forms. from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from .models import UserProfile from django import forms class SignUpForm(UserCreationForm): email = forms.EmailField() first_name =

How to omit Admin field verbose name

2020-05-05 Thread Mike Dewhirst
One of my Admin forms has a price field and the currency and symbol depend on the selected region. I would like to display (readonly) just the field content for currency and symbol for example ... "AUD $ [   222.22]" ... but all I can achieve at the moment is ... "Currency:

Re: I am building an open source School Management System

2020-05-05 Thread Milson Munakami
Hi Sherif, I tried to run your project but unfortunately unable to run it properly. It is showing: GET http://127.0.0.1:8000/static/dist/css/adminlte.min.css net::ERR_ABORTED 404 (Not Found) 127.0.0.1/:268 GET http://127.0.0.1:8000/static/dist/js/jquery.formset.js net::ERR_ABORTED 404 (Not

Security question: Can Django templates be used to execute arbitrary code on the server?

2020-05-05 Thread jrief
Is it safe to keep Django template strings inside a TextField of a Django model and allow users with staff privileges to edit them? I'm asking because I'm unsure how safe/dangerous this could be. Would it be possible to abuse a built-in templatetag to execute arbitrary code on the server?

Template Variations title not showing

2020-05-05 Thread Ahmed Khairy
Hello all, I have made a variation to an Item class in models.py and I think i got the template syntax right but apparently there are something wrong which i can't figure it out Here is the model class Item(models.Model): title = models.CharField(max_length=100) description =

I am building an open source School Management System

2020-05-05 Thread Sherif Adigun
I am currently building an open source school Management System on django and it's currently available on GitHub. https://github.com/adigunsherif/Django-School-Management-System I need contributors and collaboration. Feel free to fork me on GitHub, send a message and let's build a solution --

Job Request

2020-05-05 Thread Sherif Adigun
In case you have a remote Django development job, please I'm available. Thank you I can be reached at adigunshe...@gmail.com -- 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,

Re: Two forms in one template

2020-05-05 Thread Sherif Adigun
Please remove if pack_form.is_valid(): pack_form.instance = self.object pack_form.save() And replace with print(pack_form) Then let's see what it's printing in the console On Tue, May 5, 2020, 8:30 PM Sergei Sokov wrote: > I have this error when I try save data

[no subject]

2020-05-05 Thread fahad rasool
Can someone tell that how to perform an operation ,for example we retreive two numbers from database and want to add them and display on template in django -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Two forms in one template

2020-05-05 Thread Sergei Sokov
I have this error when I try save data for SkladForm, when I press submit Request Method: POST Request URL: http://192.168.0.249:8000/sklad Django Version: 3.0.5 Exception Type: KeyError Exception Value: 'pack_form' Exception Location: /var/workspace/myp4/webprint/print/views.py in form_valid,

Re: Best hosting for Django Application?

2020-05-05 Thread Sherif Adigun
Thank you all for your suggestions. I'll give python anywhere a try -- 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.

Re: reg: User model data missing from web page

2020-05-05 Thread 'Amitesh Sahay' via Django users
Hi Chetan, The default user model already has those three fields, right? And since I have extended the  User as a onetoone field inside the UserProfile model, so shouldn't that work? I mean, that's my understanding. May be I am wrong. Let me know, just for the sake of clarity. Right now I don't

A 404 error with “id-” in slug

2020-05-05 Thread Oleg Barbos
A 404 error with “id-” in slug on multilingual website with Indonesian language in Django 3.0 Could someone suggest a solution to this? *http://example.com/de/id-button/* - 200 OK *http://example.com/id/id-button/* - 200 OK *http://example.com/any-other-slug/* - 200 OK

A 404 error with “id-” in slug

2020-05-05 Thread Oleg Barbos
A 404 error with “id-” in slug on multilingual website with Indonesian language in Django 3.0 Could someone suggest a solution to this? *http://example.com/de/id-button/* - 200 OK *http://example.com/id/id-button/* - 200 OK *http://example.com/any-other-slug/* - 200 OK

A 404 error with “id-” in slug

2020-05-05 Thread Oleg Barbos
A 404 error with “id-” in slug on multilingual website with Indonesian language in Django 3.0 Could someone suggest a solution to this? *http://example.com/de/id-button/* - 200 OK *http://example.com/id/id-button/* - 200 OK *http://example.com/any-other-slug/* - 200 OK

A 404 error with “id-” in slug on multilingual website with Indonesian language

2020-05-05 Thread Oleg Barbos
Could someone suggest a solution to this? *http://example.com/de/id-button/* - 200 OK *http://example.com/id/id-button/* - 200 OK *http://example.com/any-other-slug/* - 200 OK *http://example.com/id-button/* - 404 error: Using the URLconf defined in example.urls, Django tried these URL

Re: Dynamic Radio Form

2020-05-05 Thread Jason Turner
Thanks. That makes sense. Appreciate your help. On Tue, May 5, 2020, 11:11 AM Chetan Ganji wrote: > To answer your question, you could add an extra field on schedule model to > store the winner > e.g. winner = models.CharField(max_length=55) > > IMO, league and team in the schedule model should

Re: reg: User model data missing from web page

2020-05-05 Thread Chetan Ganji
Hi Amitesh, Assuming you are using model forms in django without any customisation, as UserProfile model does not have first_name, last_name and email field, reading the first_name from cleaned_data is failing. To solve it, you have to add 3 extra fields in the UserProfileForm i.e. first_name,

Re: Best hosting for Django Application?

2020-05-05 Thread Franck Tchouanga
Salutation to all members please I am in search of web developers in laravel for a web development project please. This is my email address ftchoua...@gmail.com On Tue, May 5, 2020, 18:44 Jorge Gimeno wrote: > > > On Tue, May 5, 2020 at 10:36 AM JEGATHEESWARAN SUNDARAVADIVEL < >

Re: Best hosting for Django Application?

2020-05-05 Thread Jorge Gimeno
On Tue, May 5, 2020 at 10:36 AM JEGATHEESWARAN SUNDARAVADIVEL < jagatheesjo...@gmail.com> wrote: > You can check pythonanywhere hosting > > Thanks and regards > Jegatheeswaran > > On Tue, 5 May 2020 at 23:03, Sherif Adigun wrote: > >> I am planning to launch my first major Django application on

Re: Best hosting for Django Application?

2020-05-05 Thread JEGATHEESWARAN SUNDARAVADIVEL
You can check pythonanywhere hosting Thanks and regards Jegatheeswaran On Tue, 5 May 2020 at 23:03, Sherif Adigun wrote: > I am planning to launch my first major Django application on a live server > for production. Could you please suggest hosting service that is reliable > and considerably

Re: I'm new to this django help me out

2020-05-05 Thread Sherif Adigun
what is your question? On Tuesday, May 5, 2020 at 6:25:48 PM UTC+1, sree lekha wrote: > > -- 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

Best hosting for Django Application?

2020-05-05 Thread Sherif Adigun
I am planning to launch my first major Django application on a live server for production. Could you please suggest hosting service that is reliable and considerably cheap? I have used Heroku but not for a serious or client project. Please tell me your experience and advise. Thank you --

I'm new to this django help me out

2020-05-05 Thread sree lekha
-- 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 view this discussion on the web visit

Re: reg: User model data missing from web page

2020-05-05 Thread 'Amitesh Sahay' via Django users
Hello Chetan, I was doing some random test, so I put "User" there. It is not the part of the original code.  Below is models.py from django.db import modelsfrom django.urls import reversefrom django.contrib.auth.models import User class UserProfile(models.Model):    user =

Re: Django MySQL database backup and restore to new server

2020-05-05 Thread marc bellazzini
SOLVED # after more extensive googling . ORIGINAL SERVER - cd to your web project directory - python manage.py dumpdata > db.json NEW SERVER - sftp db.json file to new server web project directory - python manage.py migrate - python manage.py shell -- >> from

Re: Dynamic Radio Form

2020-05-05 Thread Chetan Ganji
To answer your question, you could add an extra field on schedule model to store the winner e.g. winner = models.CharField(max_length=55) IMO, league and team in the schedule model should be separate tables. You would use fk to them in schedule model. winner should also be an fk to team.

Re: Two forms in one template

2020-05-05 Thread Sherif Adigun
> > you have two returns in get_Context_data. use only this > def get_context_data(self, **kwargs): context = super(SkladCreateView, self).get_context_data(**kwargs) if self.request.POST: context['pack_form'] = PackForm(self.request.POST) else:

Re: reg: User model data missing from web page

2020-05-05 Thread Chetan Ganji
Hi Amitesh, If you post the models, then only someone will be able to give you exact solution. Couple of things I noticed. How is this even working?? You have not defined User variable in the function?? If its the default User model, how would passing it to UserProfile will help in your

reg: User model data missing from web page

2020-05-05 Thread 'Amitesh Sahay' via Django users
I have a profile page where I am fetching data from two models. One from the default User model and another one is custom UserProfile.  However, The data from the custom model is getting populated, but not the User model.Below are the two functions responsible for the whole procedure.  def

Re: Django MySQL database backup and restore to new server

2020-05-05 Thread marc bellazzini
SOLVED # after more extensive googling I found a solution myself. I hope this helps someone else ORIGINAL SERVER - cd to your web project directory - python manage.py dumpdata > db.json - python manage.py migrate - python manage.py shell -- >> from django.contrib.contenttypes.models

Re: Two forms in one template

2020-05-05 Thread Sergei Sokov
Thank you for answer. I have this error when I try save data for SkladForm, when I press submit Request Method: POST Request URL: http://192.168.0.249:8000/sklad Django Version: 3.0.5 Exception Type: KeyError Exception Value: 'pack_form' Exception Location:

Re: Best Practices Creating a User

2020-05-05 Thread Gs_1001
The documentation provides some ways to extend the functionality of the user model But the thing I didn't know at first was that once you have your application working and all, it's quite difficult to make changes to the user model. So I always prefer to make a CustomUser model at the start of

Best Practices Creating a User

2020-05-05 Thread 'Debjyoti Biswas' via Django users
Hi I am a new Django user, I am working on a platform and I chose Django to develop it solely because of how "batteries included" it feels. I have to create users for my platform when they sign up, I was just wondering if its best practice to use `User` from `django.contrib.auth.models` for

Re: Trouble installing GeoDjango with spatialite on Python3

2020-05-05 Thread Bugra Demiriz
Did you solve this problem? 24 Mayıs 2017 Çarşamba 09:27:22 UTC+3 tarihinde Antonis Christofides yazdı: > > Hi, > > This is the error message I get when I run "./manage.py test" or > "./manage.py migrate": > > File >

Re: Two forms in one template

2020-05-05 Thread Sherif Adigun
Try this code. Instead of using kwargs[], context is most common. class SkladCreateView(LoginRequiredMixin, CustomSuccessMessageMixin, CreateView): model = Sklad template_name = 'sklad.html' form_class = SkladForm success_url = reverse_lazy('sklad') success_msg = 'Материал сохранён' def

Re:

2020-05-05 Thread Kasper Laudrup
Hi Adedotun, On 05/05/2020 06.12, Adedotun Richard wrote: Can you see that the Customer is not define that was the reason why it was underlined. Try and import your app model to your view.py: from .models import * Please don't suggest doing wildcard imports. It is highly discouraged for

Re: Django Package Website is not opening

2020-05-05 Thread Mike Dewhirst
On 5/05/2020 5:08 pm, Hamza Mirchi wrote: Hi Mike! What is the issue here sometimes it opened and sometimes it's not opening I really have no idea. I believe it must be an internet problem between you and the site because it works for me. Maybe you could contact your IT support people and

Re: Django Package Website is not opening

2020-05-05 Thread Hamza Mirchi
Hi Mike! What is the issue here sometimes it opened and sometimes it's not opening I'm from pakistan Thanks On Monday, May 4, 2020 at 4:31:49 AM UTC-4, Mike Dewhirst wrote: > > On 4/05/2020 6:21 pm, Mike Dewhirst wrote: > > On 4/05/2020 6:14 pm, Hamza Mirchi wrote: > >> Hi Everyone, > >>