Sunday, September 30, 2018

Extending contrib.sites.get_current_site logic

What is the best-practice pattern to replace/extend functionality in django.contrib libraries?


My use case in this instance is to add domain alias awareness to the contrib.sites library. I've already created a customized sites library that incorporates the additional model updates and logic we need, but other third-party libraries we use (allauth, for example) are directly calling django.django.contrib.sites.models.objects.get_current(). We've begun maintaining a local fork of each of these libraries to update the call to point to our customized sites lib instead. Is there a more efficient solution for this?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/aa42b81e-5dea-4961-b924-1f47198de0dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Sql server

Did you check the documentation at https://docs.djangoproject.com/en/2.1/topics/auth/customizing/#substituting-a-custom-user-model ?

On Thursday, 27 September 2018 05:05:39 UTC+5:30, Elton Oliveira wrote:
Hello guys, I'm having two difficulties and I wonder if anyone can help me, first I need to change the names of the auth tables of Django to follow the standard of company names, second I need to create the security tables in a custom schema in SQL Server, does anyone have any tips?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/326a2a01-ab38-44ea-8fa1-67db97fc3b0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: favicon.ico

Yes and confirm if you linked your favicon directory correctly on your page

On Sun, Sep 30, 2018, 9:06 PM Vishvajit Pathak <wishmore191@gmail.com> wrote:
Prajesh,

Please provide complete context of the issue you are facing.

Assuming you are getting 404 HTTP ( "GET /favicon.ico HTTP/1.1" 404 ) error code :

Could you check value of STATIC_URL in settings.py ?

Also please post the code (if possible) related to how are you referring to the favicon in your html file ?


On Sunday, 30 September 2018 17:37:42 UTC+5:30, Prajesh Parekh wrote:
how to solve error of favicon.ico in url.py ?  server is showing error of favicon.ico 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f5a0d5c1-d253-450d-9416-0d3c993bdef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH9y-HwhUfS0bQcc%2BfD06YS%2B3ZhwJbg9W6Xs0-05U4UqkVaXrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: favicon.ico

Prajesh,

Please provide complete context of the issue you are facing.

Assuming you are getting 404 HTTP ( "GET /favicon.ico HTTP/1.1" 404 ) error code :

Could you check value of STATIC_URL in settings.py ?

Also please post the code (if possible) related to how are you referring to the favicon in your html file ?


On Sunday, 30 September 2018 17:37:42 UTC+5:30, Prajesh Parekh wrote:
how to solve error of favicon.ico in url.py ?  server is showing error of favicon.ico 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f5a0d5c1-d253-450d-9416-0d3c993bdef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: favicon.ico

hai friends am sharing admin page interfacing for creating subuser for
super user.

please send me comments to my file


On Sun, Sep 30, 2018 at 5:40 PM Joel <joel@eyrie.in> wrote:
>
> Please produce complete error report.
>
> On Sun, 30 Sep, 2018, 5:37 PM Prajesh Parekh, <parekhprajesh2909@gmail.com> wrote:
>>
>> how to solve error of favicon.ico in url.py ? server is showing error of favicon.ico
>>
>> --
>> 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+unsubscribe@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ca50829c-8487-44e6-9d66-3c9ffe328910%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA%3Diw_-FgWj1njZnKxxQ-wWNkND_8YtyEAx%2BQAyqQTX9JLW%3DyQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKcBU__6Eti%2B%3DBhVJOCh%3DFRJeaSp-qLwzQ-MePTUa3F3MWuzhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: favicon.ico

Please produce complete error report.

On Sun, 30 Sep, 2018, 5:37 PM Prajesh Parekh, <parekhprajesh2909@gmail.com> wrote:
how to solve error of favicon.ico in url.py ?  server is showing error of favicon.ico 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ca50829c-8487-44e6-9d66-3c9ffe328910%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA%3Diw_-FgWj1njZnKxxQ-wWNkND_8YtyEAx%2BQAyqQTX9JLW%3DyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

favicon.ico

how to solve error of favicon.ico in url.py ?  server is showing error of favicon.ico 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ca50829c-8487-44e6-9d66-3c9ffe328910%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, September 29, 2018

Re: hi friends i want admin page like this. it is a application form in university

Sudha,
You may want to have a look at https://docs.djangoproject.com/en/2.1/ref/contrib/admin/

On Thursday, 27 September 2018 16:42:33 UTC+5:30, Sudha Mohan 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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2da4b5dc-e2a7-4b51-a8c7-6475ea15c1cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Mpdf html design break fixing in php

Hi bro!,

PHP ???? MPDF ??? this forums are only related with "Python"
____________________________________________________
Franklin Sarmiento
Full-stack developer
skype: franklin.s.dev
Twitter: @franklinitiel
linkedin: Franklin Sarmiento ( franklinitiel@gmail.com )
Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )



El vie., 28 sept. 2018 a las 0:22, sankar ardhas (<sankarardhas@gmail.com>) escribió:
Hi everyone,
                      In Mpdf pdf generation , html design breaks . how to fix this? I have attached pdf file and check it.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAzT%2Bs6%3Da1M34KLmQbB3ko%2B6GxyHj5MGHRuCg0NyUwRfx3r%2B2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMsjBK%2BjgmeCyXbKW79U1DjBSqQO4sijQu7vdOXxqhn%3DmLBHSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: how to create a form builder in django

Do you need a Cms too?
I had used wagtail for its formnuilder and cms is keeps the django applications as it workes similar with the route en views.


or just built the blog and the forms later 


tim


Op 29 sep. 2018, om 08:26 heeft django_learner <iftequar14@gmail.com> het volgende geschreven:

I am a newbie in Django. Can anyone help me how to create a form builder in Django without using django-fobi or any other packages

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f239efe6-4efd-4edd-b161-074da1df40be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Friday, September 28, 2018

how to create a form builder in django

I am a newbie in Django. Can anyone help me how to create a form builder in Django without using django-fobi or any other packages

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f239efe6-4efd-4edd-b161-074da1df40be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django alternatives to Gulp

I would recommend moving to webpack and using https://github.com/owais/django-webpack-loader to manage loading of webpack files. This allows you to precompile your webpack resources and include only the compiled js/CSS and the webpack stats file. Django will use the webpack stats file to determine what js and CSS to serve and this method will support cache busting.

On Fri., Sep. 28, 2018, 7:43 a.m. Keyra, <django.community@posteo.de> wrote:
Hello,

Iam currently moving an already existing project to django. So far, Gulp
has been used to organize static files and assets there. Although there
seems to exist solutions like django-gulp, I would like to switch to a
more "python/django way" in organizing my static files, but I am still
inexperienced how static files are best handled in Django.

Should I use compressor with precompilers? And which precompilers for
sass for example? Is django-sass-processor for example a precompiler
that can be used together with django compressor?

I'm still a little confused about how I'm going down the right and clean
road. For example, I find it strange that even in django *.scss files
are treated as static files (and stored in the appropriate folder).
Because basically they are not static files if they still need to be
compiled.

Thanks for suggestions,
keyra

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b1f0754b-ea65-986a-caed-0449bc3ad6c6%40posteo.de.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOMGqtdS2fVtui7ODheY1yWNgcKXOAJ0KAxr7TNV-PJngGGu_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Django alternatives to Gulp

Hello,

Iam currently moving an already existing project to django. So far, Gulp
has been used to organize static files and assets there. Although there
seems to exist solutions like django-gulp, I would like to switch to a
more "python/django way" in organizing my static files, but I am still
inexperienced how static files are best handled in Django.

Should I use compressor with precompilers? And which precompilers for
sass for example? Is django-sass-processor for example a precompiler
that can be used together with django compressor?

I'm still a little confused about how I'm going down the right and clean
road. For example, I find it strange that even in django *.scss files
are treated as static files (and stored in the appropriate folder).
Because basically they are not static files if they still need to be
compiled.

Thanks for suggestions,
keyra

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b1f0754b-ea65-986a-caed-0449bc3ad6c6%40posteo.de.
For more options, visit https://groups.google.com/d/optout.

Re: Can anyone share code for uploading csv or excel file to sqlite3 database.

Hi,


Which error(s) did you get exactly ? It is not clear in you message whether your problem is at the CSV data processing level or at the Django one.


In case this could help, using the standard csv module you can obtain a reader wich takes care of parsing and decoding thanks to the reader() module function. You pass it the file object directly, without reading its content in memory. Since it provides an iterator over the data, yielding rows one at a time as tuples, this lets you load big files without any problem.


The DictReader class of the same module works more or less the same way, but returns rows as dicts which keys are the CSV columns names, making the mapping code more readable and self-documented.


Best


Eric


From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf of BBG <bhavik.gorajiya@gmail.com>
Sent: Thursday, September 27, 2018 8:41:42 PM
To: Django users
Subject: Re: Can anyone share code for uploading csv or excel file to sqlite3 database.
 
I have tried this but not working

def upload_csv(request):      data = {}      if "GET" == request.method:          return render(request, "add_student/bulk.html", data)      # if not GET, then proceed      try:          csv_file = request.FILES["csv_file"]          if not csv_file.name.endswith('.csv'):              messages.error(request,'File is not CSV type')              return HttpResponseRedirect(reverse("add_student:upload_csv"))          #if file is too large, return          if csv_file.multiple_chunks():              messages.error(request,"Uploaded file is too big (%.2f MB)." % (csv_file.size/(1000*1000),))              return HttpResponseRedirect(reverse("add_student:upload_csv"))            file_data = csv_file.read().decode("utf-8")            lines = file_data.split("\n")          #loop over the lines and save them in db. If error , store as string and then display          for line in lines:              fields = line.split(",")              data_dict = {}              data_dict["enrollment_no"] = fields[0]              data_dict["student_name"] = fields[1]              data_dict["gender"] = fields[2]              data_dict["course"] = fields[3]              data_dict["category"] = fields[4]              data_dict["admission_year"] = fields[5]              data_dict["branch"] = fields[6]              data_dict["current_semester"] = fields[7]              data_dict["address"] = fields[8]              data_dict["city"] = fields[9]              data_dict["district"] = fields[10]              data_dict["state"] = fields[11]              data_dict["student_contact"] = fields[12]              data_dict["parent_contact"] = fields[13]              try:                  form = EventsForm(data_dict)                  if form.is_valid():                      form.save()                  else:                      logging.getLogger("error_logger").error(form.errors.as_json())              except Exception as e:                  logging.getLogger("error_logger").error(repr(e))                  pass      except Exception as e:          logging.getLogger("error_logger").error("Unable to upload file. "+repr(e))          messages.error(request,"Unable to upload file. "+repr(e))        return HttpResponseRedirect(reverse("add_student:upload_csv"))

On Thursday, September 27, 2018 at 1:59:24 PM UTC+5:30, Eric Pascual wrote:

Hi,


Have you studied the documentation of the CSV module included in Python standard library ?


You'll find there all the needed information for reading and interpreting CSV files without having to implement the raw parsing, and have there rows in a form ready to use for inserting objects in your model.


For performance's sake, it is advised to use bulk inserts or updates instead on individual saves on the Django side if your CSV files contain a lot of data.


Best


Eric


From: django...@googlegroups.com <django...@googlegroups.com> on behalf of BBG <bhavik....@gmail.com>
Sent: Wednesday, September 26, 2018 6:04:09 PM
To: Django users
Subject: Can anyone share code for uploading csv or excel file to sqlite3 database.
 
I want to create upload bulk data. Can anyone share code to upload csv or excel file. 

--
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...@googlegroups.com.
To post to this group, send email to djang...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fc5736a8-3396-491b-b265-853f46fdad87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/88ea4342-f61d-4282-99d2-511f7e9f14a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.