Re: Rendering DataBase Image File

2017-09-25 Thread James Schneider
On Sep 24, 2017 11:55 AM, "yingi keme"  wrote:

Okk. I will like to know how to set the MEDIA_ROOT and MEDIA_URL.?

And then, my images are uploaded to a directory named 'img' inside my
static files directory. Does it affect how you set the MEDIA_ROOT and
MEDIA_URL?


Yes. The location you've chosen for these images is likely incorrect, or at
the very least, impractical.

By default, an image file associated with a models.ImageField is stored in
MEDIA_ROOT/ and not in your STATIC directory.

The files within your STATIC directory should not change in production, and
ideally should be served by your web server directly and not through
Django. STATIC is for the files needed for the site structure such as CSS,
JavaScript, logo images, etc. End-user files should not be placed there.

MEDIA_ROOT should be set to a location that can be written to by the web
server that is not in any of your STATIC locations (Django will complain if
it is). This value is an absolute path in the server file system.

MEDIA_URL should be set to whatever URL path prefix should be used to
trigger the web server to provide a file. This value is something that will
prefix the path to the file in the URL used by the browser.

In you case, using a MEDIA_URL value of '/media/', an image URL might look
like http://example.com/media/img/my_image.jpg. The web server would then
map that request to download //img/my_image.jpg.

See these links:
https://docs.djangoproject.com/en/1.11/ref/settings/#media-root
https://docs.djangoproject.com/en/1.11/ref/settings/#media-url

So, nobody can really "tell" you what they should be set to since it tends
to be environment specific.

-James

-- 
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 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/CA%2Be%2BciXDVusovsDs61MNDEU%2B3PiYQvvWj1jPhqWWfUgb0M-XPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to clean a form which receives multiple files

2017-09-25 Thread guettli
thank you very much for your Feedback!

Am Freitag, 22. September 2017 18:24:23 UTC+2 schrieb mike:
>
> I do it this way too and agree that it feels dirty. Curious to hear what 
> others have to say about this!
>
> On Fri, Sep 22, 2017 at 9:18 AM, guettli > 
> wrote:
>
>> I am not happy with this snippet from the django docs:
>>
>>
>> from django.views.generic.edit import FormViewfrom .forms import 
>> FileFieldForm
>> class FileFieldView(FormView):
>> form_class = FileFieldForm
>> template_name = 'upload.html'  # Replace with your template.
>> success_url = '...'  # Replace with your URL or reverse().
>>
>> def post(self, request, *args, **kwargs):
>> form_class = self.get_form_class()
>> form = self.get_form(form_class)
>> files = request.FILES.getlist('file_field')
>> if form.is_valid():
>> for f in files:
>> ...  # Do something with each file.
>> return self.form_valid(form)
>> else:
>> return self.form_invalid(form)
>>
>> Source: 
>> https://docs.djangoproject.com/en/1.11/topics/http/file-uploads/#uploading-multiple-files
>>
>> My problem: The form instance can't validate the files.
>>
>> AFAIK in the method form.clean() I don't have a list of files.
>>
>> I can work around this, but it breaks the nice separation of concerns which
>> I usually get with the nice django form library :-) 
>>
>> Imagine my app receives three files. Is there a way to validate these files 
>> inside form.clean()?
>>
>> Regards,
>>   Thomas Güttler
>>
>> -- 
>> 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 django...@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/07e6b78b-6af2-466b-acb3-0a285c3e201b%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+unsubscr...@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/f46df930-1621-45a2-a876-1da8a2c0e6e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Weird issue in outputting CSV files for downloading in django

2017-09-25 Thread BIJAL MANIAR

Hi,
I want my view to respond with a file for downloading, so that the browser 
pops up the download/file save dialog.
I am using the 'Content-Disposition' header to specify the name of the file.
When I use the django development server, it works perfectly fine in all 
browsers
When I run it on production with apache mod_wsgi python3.5, on *chrome *it 
gives *Failed - Network error*. It doesn't work on firefox and IE as well.
Any help would be appreciated.

def download_function():
filename = '/test/A.sv'
download_name = "example.csv"
with open(filename, 'r') as myfile:
response = HttpResponse(myfile, content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename=%s' % 
download_name
response['Content-Length'] = os.path.getsize(filename)
return response


Thanks,

Bijal


-- 
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 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/09e4a016-429c-4669-9846-ade530a139e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi guys, I am new to django currently stuck in these two.

I am writing my pet project which will display a Team name and their logo.
I used these lines for my Team class in mode.spy


class Team(models.Model):
name = models.CharField(max_length=150)
logo = models.CharField(null=True, max_length=1000)


def __str__(self):
return self.name


Problem is, I can't load the images to my html file My logo images are
currently stored in my computer. The images will load properly if I grab an
image link online and paste the image location to the Logo field in Admin
but if I used the absolute path of the images in my computer, the images
wont load. When I tried to inspect the page, I am getting "Image could not
load".

Any tips please?

-- 
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 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/CAA6wQLJ6kjsd80%2BcmFOZhPB5C_1Ugnu%3Ds51aisfNgK%3DambvJUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CharField vs ImageField for Logo

2017-09-25 Thread Andréas Kühne
Hi,

There are a couple of things to think about here.

First of all - just because you put an item on your computer doesn't mean
that the icon can be served. For example, if you are running windows and
you enter 'C:\pictures\icon.jpg' as the source for the icon, your server
won't be able to find it, because the reference 'C:\pictures\icon.jpg'
doesn't mean anything for the web browser. The reason the image links you
are inputting work is because they probably contain all information, ie
http://www.example.com/pictures/icon.jpg.

So you can get that sorted and everything should work. HOWEVER, I really
think you should use the media storage functionality of Django for this.
Checkout : https://docs.djangoproject.com/en/1.11/topics/files/.

If you add the settings required (MEDIA_ROOT in the settings file) and then
change you logo from a CharField to an ImageField AND upload your file via
django admin, you should be able to show your file.

Regards,

Andréas

2017-09-25 14:38 GMT+02:00 tango ward :

>
> Hi guys, I am new to django currently stuck in these two.
>
> I am writing my pet project which will display a Team name and their logo.
> I used these lines for my Team class in mode.spy
>
>
> class Team(models.Model):
> name = models.CharField(max_length=150)
> logo = models.CharField(null=True, max_length=1000)
>
>
> def __str__(self):
> return self.name
>
>
> Problem is, I can't load the images to my html file My logo images are
> currently stored in my computer. The images will load properly if I grab an
> image link online and paste the image location to the Logo field in Admin
> but if I used the absolute path of the images in my computer, the images
> wont load. When I tried to inspect the page, I am getting "Image could not
> load".
>
> Any tips please?
>
>
> --
> 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 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/CAA6wQLJ6kjsd80%2BcmFOZhPB5C_
> 1Ugnu%3Ds51aisfNgK%3DambvJUg%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+unsubscr...@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/CAK4qSCfrBi-0XwcHQLJHWRcfbZHDuXR-ciBx6xB1TR_AR82h%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CSRF and API Calls

2017-09-25 Thread Tom Gorup
The view for csrf token is what I'm testing out now. I created a standard 
GET handler which should be returning the CSRF token. I was hoping to see 
how others have solved the problem. Possibly more elegantly that a "pre" 
GET to the POST just to obtain the CSRF token; however, at the same time I 
understand the need. 

I would prefer not to make the calls exempt for the obvious security 
reasons.


On Friday, September 22, 2017 at 2:17:08 PM UTC-4, Matthew Pava wrote:
>
> Do you have access to the Django backend code?
>
> You could disable CSRF validation by applying the @csrf_exempt decorator 
> to the corresponding view functions.
>
> Maybe you could create a view that returns only the CSRF token (through 
> AJAX?) that you can utilize as needed?
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *Tom Gorup
> *Sent:* Friday, September 22, 2017 8:46 AM
> *To:* Django users
> *Subject:* CSRF and API Calls
>
>  
>
> I'm having a bit of an issue. I'm attempting to utilize a Javascript/React 
> App to interact with a Django backend without the use of templates (hence 
> no {%csrftoken%} available). As I understand CSRF middleware, the CSRF 
> token comes with the form on the GET and is provided in the POST; however, 
> if I'm not utilizing the templates and the app is completely separate from 
> Django. 
>
>  
>
> How do I go about obtaining the CSRF token prior to making the 
> POST/PUT/etc.?
>
>  
>
> Let me know if you need more context. Appreciate any assistance!
>
> -- 
> 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/13ecce96-2de8-4a42-8b1e-3b98ccbae524%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+unsubscr...@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/f0c08232-d39f-418e-8467-3e3af69dbad8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: best practices for location of start up code

2017-09-25 Thread Larry Martell
On Sat, Sep 23, 2017 at 6:21 PM, Antonis Christofides
 wrote:
> Hello Larry,
>
> The Django development server runs in more than one thread, which is probably
> why your initialization code run twice.
>
> OTOH, it run only once on production probably because you have configured 
> uwsgi
> to run only one process (it's possible that this is the default on single-core
> machines). However, we usually want to run at least two processes.

I have 5 uwsgi processes - I was only seeing the init code run once
because I was just sending uwsgi a reload signal. If I killed it and
restarted it I was seeing the init code run 5 times.

> Running initialization code only once per wsgi server (re)start instead of 
> once
> per process start seems a bit strange. Why do you need this?

I had not been given all the requirements. Turns out what we need to
do should not be part of the server init, so we moved it somewhere
else.

> On 2017-09-23 21:50, Larry Martell wrote:
>> On Sat, Sep 23, 2017 at 2:39 PM, Larry Martell  
>> wrote:
>>> On Sat, Sep 23, 2017 at 1:34 PM, James Schneider
>>>  wrote:

 On Sep 22, 2017 2:58 PM, "Larry Martell"  wrote:

 We have some code we want to run 1 time when our django app is
 started. What is the best place for this? I tried putting it in my
 app's config function, but from there I get:

 *** AppRegistryNotReady: Apps aren't loaded yet.


 Once as in only when the app is initially deployed, or once every time the
 web server process is started?

 Note that if you place code to run every time the web process is started,
 that it will run for every process, and most web servers spawn multiple
 processes.
>>> I'm looking to run it once when the web server is started (not each
>>> time another process of the web server is started)
>> I am using nginx and uwsgi. I tried experimenting with Antonis
>> Christofides suggestion of using AppConfig.ready(). That seems to get
>> called just once when I start (or restart uwsgi). I tried many
>> connections to the server from different browsers and computers, but
>> still that was only called once. Is that something I can count on?
>>
>> Note, when running the devel django server it was called twice at
>> start up, but when the 'real' server it was only called once. Anyone
>> know why I got the 2 calls here?

-- 
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 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/CACwCsY6wx-XwRQLdb_D35E8yL%3DmstpKczchQ4HJpB4WzHXv3nA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: server connection reset when click on localhost: Python error: wsgiref-> simple_server.py "noneType" object has no attribute split

2017-09-25 Thread 'Chris Parry' via Django users
What was the package you were missing?

On Tuesday, 22 March 2016 00:01:11 UTC, amarshall wrote:
>
> Figured it out.. In case anyone else was wondering or comes across this. I 
> went into the wsgiref/simple_server.py file and commented out that line of 
> code:
> /usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
> self.status.split(' ',1)[0], self.bytes_sent
>
> After commenting that out another set of errors arose. More detailed and 
> told me I was missing a package. So I installed that package and all was 
> well. Guess I forgot to do another pip freeze into my requirements 
> file..Really simple thing that I completely missed. So if anyone else has 
> this issue you may be missing a package and Django isn't telling you 
> because it hasn't reached a certain line of code yet or some other reason.
>
> On Thursday, March 17, 2016 at 9:08:41 PM UTC-4, amarshall wrote:
>>
>>
>> So I'm moving my work environment from one environment to the next. I did 
>> a pip install -r requirements for a list of packages I had. setup the DB. 
>> Migration went good. I do runserver and that runs. BUT when I click on the 
>> link to the homepage it says "The Connection was reset" in my browser. In 
>> my stacktrace is the below message. I've searched and found similar errors 
>> on the internet but none django related with a fix. any help
>>
>> Here's the traceback I get:
>>
>> Exception happened during processing of request from ('127.0.0.1', 56784)
>> Traceback (most recent call last):
>>   File "/usr/lib/python2.7/SocketServer.py", line 593, in 
>> process_request_thread
>> self.finish_request(request, client_address)
>>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
>> self.RequestHandlerClass(request, client_address, self)
>>   File 
>> "/home/adrian/.virtualenvs/sneak8env/local/lib/python2.7/site-packages/django/core/servers/basehttp.py"
>> , line 102, in __init__
>> super(WSGIRequestHandler, self).__init__(*args, **kwargs)
>>   File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
>> self.handle()
>>   File 
>> "/home/adrian/.virtualenvs/sneak8env/local/lib/python2.7/site-packages/django/core/servers/basehttp.py"
>> , line 182, in handle
>> handler.run(self.server.get_app())
>>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 92, in run
>> self.close()
>>   File "/usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
>> self.status.split(' ',1)[0], self.bytes_sent
>> AttributeError: 'NoneType' object has no attribute 'split'
>>
>>
>>
>>

-- 
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 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/46d698e1-94a0-4f8f-ac07-849f9409ba56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to clean a form which receives multiple files

2017-09-25 Thread Tim Graham
There's a pull request to allow FileField(multiple=True): 
https://github.com/django/django/pull/9011

On Monday, September 25, 2017 at 4:19:24 AM UTC-4, guettli wrote:
>
> thank you very much for your Feedback!
>
> Am Freitag, 22. September 2017 18:24:23 UTC+2 schrieb mike:
>>
>> I do it this way too and agree that it feels dirty. Curious to hear what 
>> others have to say about this!
>>
>> On Fri, Sep 22, 2017 at 9:18 AM, guettli  wrote:
>>
>>> I am not happy with this snippet from the django docs:
>>>
>>>
>>> from django.views.generic.edit import FormViewfrom .forms import 
>>> FileFieldForm
>>> class FileFieldView(FormView):
>>> form_class = FileFieldForm
>>> template_name = 'upload.html'  # Replace with your template.
>>> success_url = '...'  # Replace with your URL or reverse().
>>>
>>> def post(self, request, *args, **kwargs):
>>> form_class = self.get_form_class()
>>> form = self.get_form(form_class)
>>> files = request.FILES.getlist('file_field')
>>> if form.is_valid():
>>> for f in files:
>>> ...  # Do something with each file.
>>> return self.form_valid(form)
>>> else:
>>> return self.form_invalid(form)
>>>
>>> Source: 
>>> https://docs.djangoproject.com/en/1.11/topics/http/file-uploads/#uploading-multiple-files
>>>
>>> My problem: The form instance can't validate the files.
>>>
>>> AFAIK in the method form.clean() I don't have a list of files.
>>>
>>> I can work around this, but it breaks the nice separation of concerns which
>>> I usually get with the nice django form library :-) 
>>>
>>> Imagine my app receives three files. Is there a way to validate these files 
>>> inside form.clean()?
>>>
>>> Regards,
>>>   Thomas Güttler
>>>
>>> -- 
>>> 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 django...@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/07e6b78b-6af2-466b-acb3-0a285c3e201b%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+unsubscr...@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/1dfd59e3-0bb6-4ef5-b1b6-e2dd083bd224%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi Andréas,


Thank you for the response.

I added these lines in my settings.py

MEDIA_DIR = os.path.join(BASE_DIR, 'media')

# Media

MEDIA_ROOT = MEDIA_DIR
MEDIA_URL = '/media/

Then I changed my logo to models.ImageField(upload_to='team_logo'). I also
created a 'media' folder inside my project folder which team_logo is a
subfolder in it. Tried running the codes again but the logo still wont
show.


{% block body_block %}



{% for team in teams %}



 

{{ team.name }}

{% endfor %}



{% endblock %}


Is there any setting that I missed in media for media?


Thanks,
Jarvis

On Mon, Sep 25, 2017 at 9:10 PM, Andréas Kühne 
wrote:

> Hi,
>
> There are a couple of things to think about here.
>
> First of all - just because you put an item on your computer doesn't mean
> that the icon can be served. For example, if you are running windows and
> you enter 'C:\pictures\icon.jpg' as the source for the icon, your server
> won't be able to find it, because the reference 'C:\pictures\icon.jpg'
> doesn't mean anything for the web browser. The reason the image links you
> are inputting work is because they probably contain all information, ie
> http://www.example.com/pictures/icon.jpg.
>
> So you can get that sorted and everything should work. HOWEVER, I really
> think you should use the media storage functionality of Django for this.
> Checkout : https://docs.djangoproject.com/en/1.11/topics/files/.
>
> If you add the settings required (MEDIA_ROOT in the settings file) and
> then change you logo from a CharField to an ImageField AND upload your file
> via django admin, you should be able to show your file.
>
> Regards,
>
> Andréas
>
> 2017-09-25 14:38 GMT+02:00 tango ward :
>
>>
>> Hi guys, I am new to django currently stuck in these two.
>>
>> I am writing my pet project which will display a Team name and their
>> logo. I used these lines for my Team class in mode.spy
>>
>>
>> class Team(models.Model):
>> name = models.CharField(max_length=150)
>> logo = models.CharField(null=True, max_length=1000)
>>
>>
>> def __str__(self):
>> return self.name
>>
>>
>> Problem is, I can't load the images to my html file My logo images are
>> currently stored in my computer. The images will load properly if I grab an
>> image link online and paste the image location to the Logo field in Admin
>> but if I used the absolute path of the images in my computer, the images
>> wont load. When I tried to inspect the page, I am getting "Image could not
>> load".
>>
>> Any tips please?
>>
>>
>> --
>> 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 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/ms
>> gid/django-users/CAA6wQLJ6kjsd80%2BcmFOZhPB5C_1Ugnu%
>> 3Ds51aisfNgK%3DambvJUg%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+unsubscr...@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/CAK4qSCfrBi-0XwcHQLJHWRcfbZHDuXR-
> ciBx6xB1TR_AR82h%3Dg%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+unsubscr...@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/CAA6wQLLtaj5p1WPCZ3ozZFMFHyqjg%2B1AoDLzXq8qY79JNwg%3DwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CharField vs ImageField for Logo

2017-09-25 Thread Andréas Kühne
Hi,

I think you've made a lot of progress!

The only thing I think you are missing now is that you should be using the
following in your template:


See: https://docs.djangoproject.com/en/1.11/ref/models/fields/#filefield
and
https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.models.fields.files.FieldFile.url

Regards,

Andréas

2017-09-25 20:38 GMT+02:00 tango ward :

> Hi Andréas,
>
>
> Thank you for the response.
>
> I added these lines in my settings.py
>
> MEDIA_DIR = os.path.join(BASE_DIR, 'media')
>
> # Media
>
> MEDIA_ROOT = MEDIA_DIR
> MEDIA_URL = '/media/
>
> Then I changed my logo to models.ImageField(upload_to='team_logo'). I
> also created a 'media' folder inside my project folder which team_logo is a
> subfolder in it. Tried running the codes again but the logo still wont
> show.
>
>
> {% block body_block %}
>
> 
> 
> {% for team in teams %}
> 
>
> 
>  
>
> {{ team.name }}
> 
> {% endfor %}
> 
>
>
> {% endblock %}
>
>
> Is there any setting that I missed in media for media?
>
>
> Thanks,
> Jarvis
>
> On Mon, Sep 25, 2017 at 9:10 PM, Andréas Kühne  > wrote:
>
>> Hi,
>>
>> There are a couple of things to think about here.
>>
>> First of all - just because you put an item on your computer doesn't mean
>> that the icon can be served. For example, if you are running windows and
>> you enter 'C:\pictures\icon.jpg' as the source for the icon, your server
>> won't be able to find it, because the reference 'C:\pictures\icon.jpg'
>> doesn't mean anything for the web browser. The reason the image links you
>> are inputting work is because they probably contain all information, ie
>> http://www.example.com/pictures/icon.jpg.
>>
>> So you can get that sorted and everything should work. HOWEVER, I really
>> think you should use the media storage functionality of Django for this.
>> Checkout : https://docs.djangoproject.com/en/1.11/topics/files/.
>>
>> If you add the settings required (MEDIA_ROOT in the settings file) and
>> then change you logo from a CharField to an ImageField AND upload your file
>> via django admin, you should be able to show your file.
>>
>> Regards,
>>
>> Andréas
>>
>> 2017-09-25 14:38 GMT+02:00 tango ward :
>>
>>>
>>> Hi guys, I am new to django currently stuck in these two.
>>>
>>> I am writing my pet project which will display a Team name and their
>>> logo. I used these lines for my Team class in mode.spy
>>>
>>>
>>> class Team(models.Model):
>>> name = models.CharField(max_length=150)
>>> logo = models.CharField(null=True, max_length=1000)
>>>
>>>
>>> def __str__(self):
>>> return self.name
>>>
>>>
>>> Problem is, I can't load the images to my html file My logo images are
>>> currently stored in my computer. The images will load properly if I grab an
>>> image link online and paste the image location to the Logo field in Admin
>>> but if I used the absolute path of the images in my computer, the images
>>> wont load. When I tried to inspect the page, I am getting "Image could not
>>> load".
>>>
>>> Any tips please?
>>>
>>>
>>> --
>>> 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 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/ms
>>> gid/django-users/CAA6wQLJ6kjsd80%2BcmFOZhPB5C_1Ugnu%3Ds51ais
>>> fNgK%3DambvJUg%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+unsubscr...@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/ms
>> gid/django-users/CAK4qSCfrBi-0XwcHQLJHWRcfbZHDuXR-ciBx6xB1TR
>> _AR82h%3Dg%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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googl

Need help formatting and incrementing a form in HTML

2017-09-25 Thread Zev
 

OK so I have a running form in Django that updates the model and displays 
this on the page, but I was hoping to better format it. What happens is 
that the page displays all data imputed in the form. What I want to do is 
to numerically list it. This is what I have in my home.html right now:


{% extends 'base.html' %}

{% block body %} 

 
Home 
 
{% csrf_token %} 
{{ form.as_p }} 
Submit 
 
{% for post in posts %} 
Object:{{ post.post }} 
{% endfor %} 
 

{% endblock %}


Also here's my view.py file:


from django.shortcuts import render, redirect
from firstapp.forms import IndexForm 
from django.views.generic import TemplateView 
from firstapp.models import Post 

class HomePage(TemplateView): 
template_name = 'home/home.html' 

def get(self, request): 
form = IndexForm() 
posts = Post.objects.all() 
args = {'form': form, 'posts': posts} 
return render(request, self.template_name, args) 

def post(self, request): 
form = IndexForm(request.POST) 
if form.is_valid(): 
post = form.save(commit=False) 
post.user = request.user 
post.save() 
text = form.cleaned_data['post'] 
form = IndexForm() 
return redirect('home:home') 

args = {'form': form, 'text': text} 
return render(request, self.template_name, args)


So say I have data "a", "b", and "c". It would display itself as

Object: a

Object: b

Object: c

If I added d to the form, it would add

Object: d

What I'm hoping to do is add an increment to this so it displays itself as

Object 1: a

Object 2: b

Object 3: c

And add d as

Object 4:

How would I go about implementing this? Another thing I wanted to know is 
whether I can change the "Post:" comment next to the form. Right now my 
form displays itself with "Post:" at the left side. Is there a way to edit 
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+unsubscr...@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/a51ddef9-d540-4d8a-8c10-822f3f16921b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


POST method on localhost

2017-09-25 Thread Allan
I've created a simple form for data upload.  I'm testing it through 
localhost and was wondering if this is realistic.  Web development is a new 
area for me so bare with me please if this is a laughable question.  I 
uploaded a 1GB file and it was uploaded and moved to a folder in my project 
in a matter of a few seconds.

def simple_upload(request):
if request.method =='POST' and request.FILES['myfile']:
myfile = request.FILES['myfile']
fs = FileSystemStorage()
filename = fs.save(myfile.name, myfile)
uploaded_file_url = fs.url(filename)
return render(request, 'simple_upload.html', {
'uploaded_file_url': uploaded_file_url
})

return render(request, 'simple_upload.html')

{% load static %}

{% block content %}
  
{% csrf_token %}

Upload
  

  {% if uploaded_file_url %}
File uploaded at: {{ 
uploaded_file_url }}
  {% endif %}

  Return to home
{% endblock %}

Thanks!

-- 
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 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/bf2476d2-8470-4c91-8590-99ecc4f477de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Guidance for contributing to django

2017-09-25 Thread KUNAL SINGHAL
As our minor project for the year, we were asked to contribute to Django. 
However, the problem with this is that I don't really know where to start. 
I have read the documentation, but still need guidance about what to do, 
specifically:
1. Low-level features that can be added to Django in around a month's time. 
2. Existing issues that I can fix with my limited hold on coding and how to 
go about it.(I possess intermediate coding skills)
3. Any other way I can contribute to the project as novice  

I would be really grateful if someone could mentor our project.
Thanks

-- 
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 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/9cbd64db-18dd-47fb-b659-71bad05913e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels: Using `allowed_hosts_only` with `WebsocketDemultiplexer`

2017-09-25 Thread Michael Huang
Hi there. I couldn't figure out how to use the allowed_hosts_only decorator 
with the connect method of WebsocketDemulitplexer. I ended up copying and 
pasting the relevant code into a mixin I could use directly with 
WebsocketDemultiplexer (removing __init__ and __call__, adding a connect 
method that performs what __call__ performed). This seems silly. Is there a 
way I could have used the decorator or is it possible that the methods 
in BaseOriginValidator should be altered so they can be used in mixins?

-- 
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 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/c7891571-70f6-481f-811c-3d78816314df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: Using `allowed_hosts_only` with `WebsocketDemultiplexer`

2017-09-25 Thread Andrew Godwin
It's pretty tough right now to use the decorators with the classes (this is
why things like http_user are built-in) - you have to wrap them around the
handle method, if I remember correctly.

I'm hoping to fix this with the design of Channels 2 by changing the way
classes get called, but that's not going to be useable for a little while.

Andrew

On Mon, Sep 25, 2017 at 11:20 AM, Michael Huang  wrote:

> Hi there. I couldn't figure out how to use the allowed_hosts_only
> decorator with the connect method of WebsocketDemulitplexer. I ended up
> copying and pasting the relevant code into a mixin I could use directly
> with WebsocketDemultiplexer (removing __init__ and __call__, adding a
> connect method that performs what __call__ performed). This seems silly. Is
> there a way I could have used the decorator or is it possible that the
> methods in BaseOriginValidator should be altered so they can be used in
> mixins?
>
> --
> 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 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/c7891571-70f6-481f-811c-3d78816314df%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+unsubscr...@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/CAFwN1uoPib_iocdykiutL7JeCsvJ_Pqna6sY1M0yzsbWMNkBfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi Andreas,


Really appreciate your guidance on this.

I am having trouble understanding this:

3: All that will be stored in your database is a path to the file (relative
to MEDIA_ROOT
).
You’ll most likely want to use the convenience url

attribute provided by Django. For example, if your ImageField

is called mug_shot, you can get the absolute path to your image in a
template with {{ object.mug_shot.url }}.


I tried applying the object.logo.url but the logo still doesn't display.
Also where did the object and url came from?

On Tue, Sep 26, 2017 at 3:39 AM, Andréas Kühne 
wrote:

> Hi,
>
> I think you've made a lot of progress!
>
> The only thing I think you are missing now is that you should be using the
> following in your template:
> 
>
> See: https://docs.djangoproject.com/en/1.11/ref/models/fields/#filefield
> and https://docs.djangoproject.com/en/1.11/ref/models/fields/#django.db.
> models.fields.files.FieldFile.url
>
> Regards,
>
> Andréas
>
> 2017-09-25 20:38 GMT+02:00 tango ward :
>
>> Hi Andréas,
>>
>>
>> Thank you for the response.
>>
>> I added these lines in my settings.py
>>
>> MEDIA_DIR = os.path.join(BASE_DIR, 'media')
>>
>> # Media
>>
>> MEDIA_ROOT = MEDIA_DIR
>> MEDIA_URL = '/media/
>>
>> Then I changed my logo to models.ImageField(upload_to='team_logo'). I
>> also created a 'media' folder inside my project folder which team_logo is a
>> subfolder in it. Tried running the codes again but the logo still wont
>> show.
>>
>>
>> {% block body_block %}
>>
>> 
>> 
>> {% for team in teams %}
>> 
>>
>> 
>>  
>>
>> {{ team.name }}
>> 
>> {% endfor %}
>> 
>>
>>
>> {% endblock %}
>>
>>
>> Is there any setting that I missed in media for media?
>>
>>
>> Thanks,
>> Jarvis
>>
>> On Mon, Sep 25, 2017 at 9:10 PM, Andréas Kühne <
>> andreas.ku...@hypercode.se> wrote:
>>
>>> Hi,
>>>
>>> There are a couple of things to think about here.
>>>
>>> First of all - just because you put an item on your computer doesn't
>>> mean that the icon can be served. For example, if you are running windows
>>> and you enter 'C:\pictures\icon.jpg' as the source for the icon, your
>>> server won't be able to find it, because the reference
>>> 'C:\pictures\icon.jpg' doesn't mean anything for the web browser. The
>>> reason the image links you are inputting work is because they probably
>>> contain all information, ie http://www.example.com/pictures/icon.jpg.
>>>
>>> So you can get that sorted and everything should work. HOWEVER, I really
>>> think you should use the media storage functionality of Django for this.
>>> Checkout : https://docs.djangoproject.com/en/1.11/topics/files/.
>>>
>>> If you add the settings required (MEDIA_ROOT in the settings file) and
>>> then change you logo from a CharField to an ImageField AND upload your file
>>> via django admin, you should be able to show your file.
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>> 2017-09-25 14:38 GMT+02:00 tango ward :
>>>

 Hi guys, I am new to django currently stuck in these two.

 I am writing my pet project which will display a Team name and their
 logo. I used these lines for my Team class in mode.spy


 class Team(models.Model):
 name = models.CharField(max_length=150)
 logo = models.CharField(null=True, max_length=1000)


 def __str__(self):
 return self.name


 Problem is, I can't load the images to my html file My logo images are
 currently stored in my computer. The images will load properly if I grab an
 image link online and paste the image location to the Logo field in Admin
 but if I used the absolute path of the images in my computer, the images
 wont load. When I tried to inspect the page, I am getting "Image could not
 load".

 Any tips please?


 --
 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 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/ms
 gid/django-users/CAA6wQLJ6kjsd80%2BcmFOZhPB5C_1Ugnu%3Ds51ais
 fNgK%3DambvJUg%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
>>> You received this message bec

Re: CharField vs ImageField for Logo

2017-09-25 Thread tango ward
Hi Andreas,


I was able to display the images but I dont know how they work. I checked
some online resources and found out that I need to add these in my urls.py

from django.conf import settings
from django.conf.urls.static import static

and at the bottom of it, I added

if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)


I also saw a urlpattern for STATIC_URL and STATIC_ROOT.

Would you have a minute or two to help me understand these codes?

I would really appreciate it.


Thanks

On Tue, Sep 26, 2017 at 5:23 AM, tango ward  wrote:

> Hi Andreas,
>
>
> Really appreciate your guidance on this.
>
> I am having trouble understanding this:
>
> 3: All that will be stored in your database is a path to the file
> (relative to MEDIA_ROOT
> ).
> You’ll most likely want to use the convenience url
> 
> attribute provided by Django. For example, if your ImageField
> 
> is called mug_shot, you can get the absolute path to your image in a
> template with {{ object.mug_shot.url }}.
>
>
> I tried applying the object.logo.url but the logo still doesn't display.
> Also where did the object and url came from?
>
> On Tue, Sep 26, 2017 at 3:39 AM, Andréas Kühne  > wrote:
>
>> Hi,
>>
>> I think you've made a lot of progress!
>>
>> The only thing I think you are missing now is that you should be using
>> the following in your template:
>> 
>>
>> See: https://docs.djangoproject.com/en/1.11/ref/models/fields/#filefield
>> and https://docs.djangoproject.com/en/1.11/ref/models/
>> fields/#django.db.models.fields.files.FieldFile.url
>>
>> Regards,
>>
>> Andréas
>>
>> 2017-09-25 20:38 GMT+02:00 tango ward :
>>
>>> Hi Andréas,
>>>
>>>
>>> Thank you for the response.
>>>
>>> I added these lines in my settings.py
>>>
>>> MEDIA_DIR = os.path.join(BASE_DIR, 'media')
>>>
>>> # Media
>>>
>>> MEDIA_ROOT = MEDIA_DIR
>>> MEDIA_URL = '/media/
>>>
>>> Then I changed my logo to models.ImageField(upload_to='team_logo'). I
>>> also created a 'media' folder inside my project folder which team_logo is a
>>> subfolder in it. Tried running the codes again but the logo still wont
>>> show.
>>>
>>>
>>> {% block body_block %}
>>>
>>> 
>>> 
>>> {% for team in teams %}
>>> 
>>>
>>> 
>>>  
>>>
>>> {{ team.name }}
>>> 
>>> {% endfor %}
>>> 
>>>
>>>
>>> {% endblock %}
>>>
>>>
>>> Is there any setting that I missed in media for media?
>>>
>>>
>>> Thanks,
>>> Jarvis
>>>
>>> On Mon, Sep 25, 2017 at 9:10 PM, Andréas Kühne <
>>> andreas.ku...@hypercode.se> wrote:
>>>
 Hi,

 There are a couple of things to think about here.

 First of all - just because you put an item on your computer doesn't
 mean that the icon can be served. For example, if you are running windows
 and you enter 'C:\pictures\icon.jpg' as the source for the icon, your
 server won't be able to find it, because the reference
 'C:\pictures\icon.jpg' doesn't mean anything for the web browser. The
 reason the image links you are inputting work is because they probably
 contain all information, ie http://www.example.com/pictures/icon.jpg.

 So you can get that sorted and everything should work. HOWEVER, I
 really think you should use the media storage functionality of Django for
 this. Checkout : https://docs.djangoproject.com/en/1.11/topics/files/.

 If you add the settings required (MEDIA_ROOT in the settings file) and
 then change you logo from a CharField to an ImageField AND upload your file
 via django admin, you should be able to show your file.

 Regards,

 Andréas

 2017-09-25 14:38 GMT+02:00 tango ward :

>
> Hi guys, I am new to django currently stuck in these two.
>
> I am writing my pet project which will display a Team name and their
> logo. I used these lines for my Team class in mode.spy
>
>
> class Team(models.Model):
> name = models.CharField(max_length=150)
> logo = models.CharField(null=True, max_length=1000)
>
>
> def __str__(self):
> return self.name
>
>
> Problem is, I can't load the images to my html file My logo images are
> currently stored in my computer. The images will load properly if I grab 
> an
> image link online and paste the image location to the Logo field in Admin
> but if I used the absolute path of the images in my computer, the images
> wont load. When I tried to inspect the page, I am getting "Image could not
> load".
>
> Any tips please?
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Djan

Re: Best option to check and/or convert encoding for csv files

2017-09-25 Thread Mike Dewhirst

On 26/09/2017 1:53 AM, Fellipe Henrique wrote:

Thanks Mike,

But my problem Ithink is more deep...

I use pyexcel to try to open a CSV file, to work with that on my 
software...


I receive these error everytime: 'utf-8' codec can't decode byte 0xa1 
in position 14: invalid start byte

my code is abouve:


Fellipe

My heartfelt sympathy. Surely there is a robot somewhere which can fix 
coding and decoding so us poor humans don't have to think about it. That 
is the perfect use-case for AI in Python's standard library. Anyone 
listening? Has anyone done it already?


Recently someone here posted 
https://djangodeployment.com/2017/06/19/encodings-part-1/ and in 
particular http://www.i18nqa.com/debug/utf8-debug.html


I think the right approach is to recognise that the problem is in 
reality and you have to cope with it. I have never properly dealt with 
it myself. Just writing this makes me realise it. I will have to use 
those debuggiing charts and gradually build a set of functions to 
"magically" recover from decode exceptions. But not until later next month.


I haven't used the csv library you mention. All my conversions so far 
have been small-scale LibreOffice save-as-csv which have let me use my 
editor's replace function to get rid of problem chars and repair csv 
files prior to importing data. I know this is the wimp's way out but I 
have never had time to do it properly.


I'm really sorry I can't help

Mike




@property def sheet(self):
 """ Returns the file content in a format based on pyexcel api. """ if 
not self.file:

 return None file_extension =self.file.name.split('.')[-1]
 file_type = mimetypes.types_map['.' + file_extension]
 if file_typenot in settings.ALOWED_DATA_FILE_CONTENT_TYPES:
 return None if self.transpose_columns:
 data_file =self._get_transposed_file()
 file_extension = data_file.name.split('.')[-1]
 else:
 data_file =self.file

 self._sheet = pyexcel.get_sheet(file_type=file_extension, 
file_content=data_file.read(), name_columns_by_row=0)
 data_file.seek(0)# it is necessary to return file cursor after read return 
self._sheet.to_dict()


It's works fine with the 0.4.4 pyexcel version.. but, I don't know, I 
start to have other issue with the old version, make me to update to 
the new version... here is the error:



Inline image 1

Do you see these error before?

I spent more then 2 weeks to try to solve that, and nothing.. :(


Thanks a lot

Regards!



T.·.F.·.A.·.     S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 
's/(.)/chr(ord($1)-2*3)/ge'

/Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh/
/Blog: /http:www.fellipeh.eti.br
/GitHub: https://github.com/fellipeh/
/Twitter: @fh_bash/

On Sun, Sep 24, 2017 at 5:02 AM, Mike Dewhirst > wrote:


On 22/09/2017 10:32 PM, Fellipe Henrique wrote:

Hello guys,

So, I have several csv files, to open using pyexcel... but I
start to have issues with CSV saved from Excel, with other
encoding...

There's any option to verify the encoding of file, or change
the encoding?


I use LibreOffice which provides an option to set one of any
number of encodings including utf-8 when saving xlsx Excel files
as csv



regards


T.·.F.·.A.·.     S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \
's/(.)/chr(ord($1)-2*3)/ge'
/Fedora Ambassador:
https://fedoraproject.org/wiki/User:Fellipeh/

/Blog: /http:www.fellipeh.eti.br 
/GitHub: https://github.com/fellipeh/
/Twitter: @fh_bash/
-- 
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
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/CAF1jwZFrM%2Bze3LQ6bXkhXOAA_LmSrbXYLFYzhF63KHNweAB_jw%40mail.gmail.com





Re: Guidance for contributing to django

2017-09-25 Thread James Schneider
On Sep 25, 2017 2:05 PM, "KUNAL SINGHAL"  wrote:

As our minor project for the year, we were asked to contribute to Django.
However, the problem with this is that I don't really know where to start.
I have read the documentation, but still need guidance about what to do,
specifically:
1. Low-level features that can be added to Django in around a month's time.
2. Existing issues that I can fix with my limited hold on coding and how to
go about it.(I possess intermediate coding skills)
3. Any other way I can contribute to the project as novice

I would be really grateful if someone could mentor our project.
Thanks



This page spells out everything you need to know and where to get started:

https://docs.djangoproject.com/en/dev/internals/contributing/

-James

-- 
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 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/CA%2Be%2BciWU0faEANtQtKAJUSz6p2KbWwVVPEnfdCpyU2OKO4ZHGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.