Re: Django Produces Python?

2017-03-26 Thread Andréas Kühne
If you want managed hosting, all you have to do is ask if they can host django. You normally install django in a virtualenvironment - so as long as they allow virtual environments you are probably good to go. Most managed servers that can install python work with Django - Django is a pretty well

Re: How to create a new user with django rest framework and custom user model

2017-03-26 Thread Andréas Kühne
I think you have a few errors in your code. In views.py you write: User.objects.create_user( serialized.save() ) serialized.save() is probably calling User.objects.create - which you shouldn't do. If you want to create a user the way you are doing you will need to

Re: Django Captcha Ajax call not working

2017-03-27 Thread Andréas Kühne
Hi, First of all - you are not sending anything to the form. $.ajax({ type: "POST", url: "../captcha", contentType: "application/json", data: {}, dataType: "json", success: function(data)

Re: Programming Error at admin

2017-03-17 Thread Andréas Kühne
Have you run the migrations for the project? It looks like you don't have the sessions table created? Regards, Andréas 2017-03-17 14:58 GMT+01:00 kessev : > I used the sql sever to create model but when I want to open admin page it > pop out this! > What's wrong is

Re: Tweaking the admin title to display the model name

2017-03-21 Thread Andréas Kühne
xperience > with the implementation of nested formsets? > > > On Monday, 20 March 2017 10:57:20 UTC+2, Andréas Kühne wrote: >> >> Yes, >> >> I actually have written an application where we use the django admin >> interface as the primary work area for

Re: Tweaking the admin title to display the model name

2017-03-18 Thread Andréas Kühne
.au>: > On 17/03/2017 7:49 PM, Andréas Kühne wrote: > >> You can override the admin change form for the model you want and then >> change the title. >> >> You can check here for some information: https://docs.djangoproject.com >> /en/1.10/ref/contrib/admin

Re: Programming Error at admin

2017-03-18 Thread Andréas Kühne
%25B7%25E5%258F%2596.PNG> > > > > > > > > > > > Andréas Kühne於 2017年3月18日星期六 UTC+8上午2時44分36秒寫道: >> >> Have you run the migrations for the project? >> >> It looks like you don't have the sessions table created? >> >> Regards, >> >> An

Re: Tweaking the admin title to display the model name

2017-03-20 Thread Andréas Kühne
face also makes it look pretty slick! > > On Saturday, 18 March 2017 09:54:37 UTC+2, Andréas Kühne wrote: >> >> Yeah I know - the django admin platform is really great - add the >> grappelli interface to it and you can use it as a proper backend for a >> project. :-)

Re: Tweaking the admin title to display the model name

2017-03-17 Thread Andréas Kühne
You can override the admin change form for the model you want and then change the title. You can check here for some information: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#overriding-admin-templates Regards, Andréas 2017-03-17 5:21 GMT+01:00 Mike Dewhirst

Re: Django login implement using exisit mssql (MD5 hash password encode).

2017-03-17 Thread Andréas Kühne
Hi, You shouldn't implement this yourself - use the existing authentication methods for this. See https://docs.djangoproject.com/en/1.10/topics/auth/ for more information on the subject. Also MD5 hashed passwords would be a very bad security decision - it's simply not safe enough. BUT if you

Re: superuser having all permissions makes perm checking messy

2017-03-17 Thread Andréas Kühne
I also think you are talking about to different things. Thomas, I get a feeling you are not using the default permissions system built into django, but rather using your own. Regardless of how you do it - you could just add a method on the user object that is : def has_permission(self,

Re: Will function based views ever be deprecated?

2017-04-03 Thread Andréas Kühne
I find it interesting that so many haven't embraced the new CBV's. I ONLY use CBV's when designing and find the usages much simpler - because of no boilerplate and also the fact that I can derive from other classes when needed. Of course - the first time you use a form view or a template view and

Re: Will function based views ever be deprecated?

2017-04-04 Thread Andréas Kühne
Very good explanation Andrew, I'm looking forward to having time to look at your talk - seems right on the money. Regards, Andréas 2017-04-03 23:24 GMT+02:00 Andrew Pinkham : > There's a little bit of vocabulary overload going on that I can't help but > point out, as it

Re: getting error "Project matching query does not exist."

2017-04-11 Thread Andréas Kühne
Hi, I think his point is that no file change will resolve this. :-) In the file "brickly/framework/middleware.py" you are searching for a Project with the database ID 1 - and it doesn't exist. The middleware apparantly needs a Project to function. So you can either add a project to your

Re: Django forks

2017-04-17 Thread Andréas Kühne
Hi, Just out of curiosity, what is the problem that you are having? Regards, Andréas 2017-04-16 15:27 GMT+02:00 : > Hello everybody ! > > Anybody maintaining a Django fork and open for contributions ? > > I want to fix problems that have been recurrent for me over the last

Re: Alternative to celery

2017-04-20 Thread Andréas Kühne
I don't know anything about the python-rq stuff - however redis can be configured to save to disk (see https://redis.io/topics/persistence) - so you wouldn't loose anything on a power-failure (if configured correctly). Redis is so much more than a cache nowadays. Regards, Andréas 2017-04-20

Re: How to unsubscribe?

2017-03-05 Thread Andréas Kühne
It's managed by google groups. Go your google groups settings and remove you subscription there. Regards, Andréas 2017-03-05 8:17 GMT+01:00 Marco Miani : > Hi. > > can anyone please explain how I get off this list? > > I have tried to click the link at the jottom of

Re: can i use the listview which the django-admin used im my tempate

2017-03-05 Thread Andréas Kühne
Hi, I don't really understand what you mean, but there is a ListView in the generic views package. To use that all you really need to do is to tell the listview class what model you are using. For example: class UserList(ListView): model = User You can see the information about the view

Re: Will function based views ever be deprecated?

2017-04-03 Thread Andréas Kühne
I really think you should revisit CBV's - you don't have to use the generic views unless they make sense. I regularly override most of my own with mixins and the like. And like you said - querying the database and returning a template is probably one of the most common things I do. That's a detail

Re: regarding virtualenv and python version 3.5 or 3.4 or other versions

2017-08-14 Thread Andréas Kühne
If you want something to scale - make sure that you make the right prerequisites for that. We run on virtual machines and have custom built images that get spun up automatically if the system needs to scale (it scales horizontally). That way I know what I have on the machines and can upgrade to

Re: [1.8 to 1.10] Why I had to set trailing slash to false in my DRF urls.py in order to make things work like before the update

2017-07-16 Thread Andréas Kühne
Hi, I think the error message is pretty self explaining. You are using DRF - what are you using for the frontend? Which URLs are being called? By default all django urls should end in a trailing slash - for example : /posts/1/ and if you are calling these from a django template page this is

Re: Warning while upgrading Django to 1.11.3

2017-07-27 Thread Andréas Kühne
Hi, In your match urls file, you include urlpatterns twice. urlpatterns += [ url(r'^matches/', include('speedy.match.matches.urls', namespace='matches')), url(r'^', include('speedy.match.accounts.urls', namespace='accounts')), url(r'^admin/', admin.site.urls), url(r'^i18n/',

Re: save cropped image with PIL to database

2017-07-04 Thread Andréas Kühne
can anybody please tell me about my mistake please > > On Monday, July 3, 2017 at 9:12:55 PM UTC+4:30, Andréas Kühne wrote: >> >> I would have a look at the easy-thumbnails plugin ( >> http://easy-thumbnails.readthedocs.io/en/2.1/). It uses pillow behind >> t

Re: save cropped image with PIL to database

2017-07-03 Thread Andréas Kühne
I would have a look at the easy-thumbnails plugin ( http://easy-thumbnails.readthedocs.io/en/2.1/). It uses pillow behind the scenes and it is very easy to do the cropping and everything that you need and you don't need to write it yourself :-) Regards, Andréas 2017-07-03 12:09 GMT+02:00 shahab

Re: Where is django-admin?

2017-04-28 Thread Andréas Kühne
Have you tried searching for django-admin.py? It is a regular python file that should be installed in your virtual environment. I have never used django on windows, so I don't know where that would be. If you can find the file your path probably needs updating? Regards, Andréas 2017-04-28

Re: Deploy Django on Apache server

2017-08-09 Thread Andréas Kühne
2017-08-09 9:01 GMT+02:00 Akshay Jagirdar : > Hi Guys, > > Please help me with deployment of Django project on Apache server. > > My System environment... > > OS : Fedora 20 > Python : 2.7 > Django : 1.11 > Apache: 2.4 > > What I know is i have modify httpd.conf

Re: database tables are not being created

2017-08-07 Thread Andréas Kühne
Have you added the application your models belong to to the INSTALLED_APPS part of settings.py? And have you added the models file in that application? Regards, Andréas 2017-08-07 21:33 GMT+02:00 : > > I have been working on a django application for several months,

Re: database tables are not being created

2017-08-07 Thread Andréas Kühne
Ok, Regarding point 2 there - have you added the models to the __init__.py file? Imported them as in: from .model1 import Model1 As far as I have seen, this is needed to make sure the migrations can detect the models. Regards, Andréas 2017-08-07 22:09 GMT+02:00 :

Re: Row based permissions: In DB or App? ... farewell pain

2017-08-07 Thread Andréas Kühne
Hi, I understand your concern, however I would like to learn more about how you intend to solve the problem. The only way I could see a solution would be to change the database user depending on which application user is logged in. That would mean updating users and permissions in the database

Re: SuspiciousOperation errors after upgrading from Django 1.8 -> 1.10

2017-08-07 Thread Andréas Kühne
Hi, This sounds a bit like the problem we had with sessions when we tried using dynamodb for a session store. We reverted to using redis instead, so I don't really know how to solve your problem, but I would take a look at the session store. It could be as easy as some of the sessions were

Re: Is an upgrade from 1.6 to 1.11 as complicated as migrating from 1.1 to 1.6?

2017-05-16 Thread Andréas Kühne
I upgraded from 1.3 to 1.5. That was the hard part I think. We are currently running version 1.10 and the updates to that version have been without a problem. That being said - it all depends on what your application does. If you do a lot of things that are specific for your application. The main

Re: TemplatedDoesNotExist

2017-05-16 Thread Andréas Kühne
Hi, Are you getting a TemplateDoesNotExist error when using the runserver command? That PROBABLY doesn't have anything to do with your PyCharm setup - but rather with how you have included the templates in your settings. But to be able to help you, we need more information: 1. Which version of

Re: Email conformation problem

2017-05-17 Thread Andréas Kühne
Hi, I think Constantine is probably correct. It's not a specific django problem if your emails are being flagged as fishing emails. The problem is more likely how the emails are being sent AFTER they are sent from django. Django only creates an email based on the properties you use - sender,

Re: type error issue

2017-06-12 Thread Andréas Kühne
In your urls.py file you have to add the variable you want to add to the URL You currently have : url(r'^region', views.region, name='region'), But it should be: url(r'^region/(?P[\w-]+)/$', views.region, name='region'), Otherwise the url doesn't know where to get the cnty variable from

Re: Django phone number validation

2017-06-21 Thread Andréas Kühne
Hi, https://github.com/stefanfoulis/django-phonenumber-field You could probably use that library - it works against googles phonenumber library, which is the library that is used on andoid phones as well. Regards, Andréas 2017-06-21 8:18 GMT+02:00 Santosh Yelamarthi

Re: How do I code this in views.py

2017-06-26 Thread Andréas Kühne
Hi, You shouldn't be coding a login system yourself. Django has a very good authentication system that you can use: https://docs.djangoproject.com/en/1.11/topics/auth/ You can then use decorators to say that a page is protected:

Re: Django REST API

2017-05-22 Thread Andréas Kühne
Hi, That is a very broad question and hard to answer directly. Reasons why you would want a REST API: 1. Communicating with another server 2. Communicating with a mobile application 3. Creating a single page application with a javascript framework like angular, react, jquery or the like. I

Re: Is an upgrade from 1.6 to 1.11 as complicated as migrating from 1.1 to 1.6?

2017-05-16 Thread Andréas Kühne
est > future in terms of updates. Is there any reason we should consider 1.10 > over 1.11? > > Thanks > > > On 5/16/2017 3:11 PM, Andréas Kühne wrote: > >> I upgraded from 1.3 to 1.5. That was the hard part I think. We are >> currently running version 1.10 and t

Re: Django bugfix release: 1.11.2

2017-06-02 Thread Andréas Kühne
Hi, You should use pip to install python dependencies, so in this case: pip install django --upgrade That way you will get the latest version of django. Best regards, Andréas 2017-06-02 0:17 GMT+02:00 Bernd Wechner : > Any tips on how to install it? Forgive the

Re: Internet Explorer question

2017-06-16 Thread Andréas Kühne
Hi, If you target corporate users, you will have to test IE. I would say that that is a requirement. The draggable corner of a TextField is a browser implementation for example and doesn't exist in IE (as you now have experienced). However the javascript problems you are seeing should "just

Re: Error even after following the django documentation

2017-06-16 Thread Andréas Kühne
Hi, Could you please include your models.py file? So that we can see the model declarations. Regards, Andréas 2017-06-16 14:07 GMT+02:00 danbmathew : > Thanks for the reply.Well i used the same model shown in the > documentation.I even cross checked all my codes to

Re: Django Real time Notifications

2017-06-11 Thread Andréas Kühne
Hi, You should check out django-channels ( https://channels.readthedocs.io/en/stable/) for that. That is a websocket based solution for doing realtime notifications (as long as the users are logged in to the website). Regards, Andréas 2017-06-11 14:00 GMT+02:00 yingi keme

Re: Django package boilerplate.

2017-05-01 Thread Andréas Kühne
If you opensource it and host the code on github - you can easily setup travis ci for free. https://docs.travis-ci.com/user/languages/python/ Med vänliga hälsningar, Andréas 2017-05-01 17:18 GMT+02:00 Frederik Creemers : > I've got a few utilities in my app that I

Re: Django Sass verwenden

2017-05-02 Thread Andréas Kühne
Hi, Sorry my german is very rusty - but it looks like you need something to compile your sass files to css. Checkout this project for an example: https://github.com/andreyfedoseev/django-static-precompiler I use PyCharm as my IDE and it includes automatic conversion from scss files to css - so I

Re: Django forks / clones / wrappers

2017-05-05 Thread Andréas Kühne
Hi, As far as I know, there is nothing that is compatible with Django and is not Django? I don't really understand what you are trying to do either, and why you don't want to use Django. From what you have written I am guessing that you want the models/db layer and forms part from Django? What I

Re: HOMEPAGE

2017-09-21 Thread Andréas Kühne
You can use django cms (https://www.django-cms.org/) to create functionality like wordpress. But it's a bit overkill if all you want is a wordpress site - use wordpress. Regards, Andréas 2017-09-21 14:29 GMT+02:00 m712 : > Django is not Wordpress, you don't use

Re: cors headers in django

2017-09-21 Thread Andréas Kühne
Hi, Did you add the plugin itself as well? Because it's not the only settings that are required, if you look at the code it also has middleware and other things. Regards, Andréas 2017-09-21 6:55 GMT+02:00 Rakhee Menon : > Hey!!Thanks...But I tried adding those in

Re: Autocomplete in Django

2017-09-17 Thread Andréas Kühne
That really depends on how you want it to work? I would probably add an item on the dropdown that shows the current items in the database, with "Add city". If the user presses that you can have an AJAX call that adds the item to the database. Regards, Andréas 2017-09-17 6:23 GMT+02:00 Mreno

Re: ABOUT DJANGO

2017-09-21 Thread Andréas Kühne
Hi, I'm sorry - your questions are a bit too broad to cover here. If you have specific question about the django framework or a problem with how you are supposed to use django, feel free to ask those questions here. If you don't have any experience in django, I recommend looking at the following

Re: Is it an error by Django?

2017-10-06 Thread Andréas Kühne
Hi, No, the correct format is content=b'' otherwise you would just be default content to a string that equals "b". It says that there is no encoding on the string afterwards and it is a byte string. It works the same way Python 2 used to do with unicode strings, in that case it was

Re: Link to download a file

2017-09-07 Thread Andréas Kühne
Hi, I would recommend that you checkout how django uses storage backends. The reason for that is that if you would like to use your application with a cloud provider that has a storage solution - for example S3, your code won't work the way it is written now. However if you just make some minor

Re: send email using django

2017-08-30 Thread Andréas Kühne
Hi, First make sure that the settings for google smtp server sending are correct. See https://stackoverflow.com/questions/32301868/django-sending-email-with-google-smtp for an example. There you can also see a setting called "Allow access to less secure apps". This is an issue even when using

Re: zip file

2017-09-07 Thread Andréas Kühne
Hi, If you only want to save the content "as is" to a model - just use the FileField on the model. See here: https://docs.djangoproject.com/en/1.11/ref/models/fields/#filefield You can then also use different types of storage backends to save the file to either the server itself or to the cloud

Re: zip file

2017-09-07 Thread Andréas Kühne
should i download zip from web into my django-project? > > On Thursday, September 7, 2017 at 1:35:04 PM UTC+5:30, Andréas Kühne wrote: >> >> Hi, >> >> If you only want to save the content "as is" to a model - just use the >> FileField on the model. See

Re: POST method on localhost

2017-09-26 Thread Andréas Kühne
ons on where to get started with this? We > were originally making a desktop application, but plans have shifted and > I'm not very knowledgeable about everything web. > > Allan > > On Tuesday, 26 September 2017 13:35:08 UTC-7, Andréas Kühne wrote: >> >> Hi again, >>

Re: POST method on localhost

2017-09-26 Thread Andréas Kühne
ference in aspects such as data > upload? We are new to web development and at this stage we are doing > research, and this would be a nice example to show. > > On Tuesday, 26 September 2017 00:37:58 UTC-7, Andréas Kühne wrote: >> >> Hi! >> >> Yes that is re

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

Re: CharField vs ImageField for Logo

2017-09-26 Thread Andréas Kühne
g_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

Re: POST method on localhost

2017-09-26 Thread Andréas Kühne
Hi! Yes that is realistic in the sense that it takes a couple of seconds to upload a 1GB file to localhost. It should take a small amount of time, because it is just copying the file (through django) to the directory you specified. However uploading a 1 GB file to a web server on the Internet

Re: CharField vs ImageField for Logo

2017-09-25 Thread Andréas Kühne
but the logo still wont > show. > > > {% block body_block %} > > > > {% for team in teams %} > > > > > > {{ team.name }} > > {% endfor %} > > > > {% endblock %} > > > Is

Re: Deploy production django applications with Python2.7 and Python3.5 on same Apache web server

2017-08-28 Thread Andréas Kühne
Hi, I found this information that could be handy for setting up with multiple environments and mod_wsgi. http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html I don't think you really need to use a different setup, just some configuration in your httpd.conf file.

Re: Deploy production django applications with Python2.7 and Python3.5 on same Apache web server

2017-08-28 Thread Andréas Kühne
t the same time. > > The only solution therefore is to have two separate instances of Apache > running, one for Python 2 and one for Python 3 code. > > Thanks, > Bijal > > On Monday, August 28, 2017 at 4:56:41 PM UTC+5:30, Andréas Kühne wrote: >> >> Hi, >> &g

Re: deploying django project

2017-09-02 Thread Andréas Kühne
You could also check out the tutorial at digitalocean: https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 Regards, Andréas 2017-09-02 10:51 GMT+02:00 Antonis Christofides < anto...@djangodeployment.com>: > Hello, > >

Re: deploying django project

2017-09-02 Thread Andréas Kühne
ptember 2, 2017 at 1:44:50 PM UTC+4:30, Andréas Kühne wrote: >> >> You could also check out the tutorial at digitalocean: >> >> https://www.digitalocean.com/community/tutorials/how-to-serv >> e-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04 >> >>

Re: models.py

2017-10-18 Thread Andréas Kühne
Hi, The __str__ function is described here: https://docs.djangoproject.com/en/1.11/ref/models/instances/#str It is mainly used in django in the admin interface when you haven't setup any rules for the list layout. You can also see it when you look at an object in the python shell (athough that

Re: hello everyone! I'm working on Django Framework. but when I run the script $ ./manage.py runserver or $./manage.py runserver 0.0.0.0:8000 it only work on my system. how to make it public? so that

2017-10-19 Thread Andréas Kühne
2017-10-19 9:37 GMT+02:00 Erik Rull <erik.r...@rdsoftware.de>: > Hello Andréas, > > Andréas Kühne wrote: > > 1. First of all, you shouldn't run django with runserver on a production > > system. runserver is just for development purposes, and doesn't do a lot > of

Re: hello everyone! I'm working on Django Framework. but when I run the script $ ./manage.py runserver or $./manage.py runserver 0.0.0.0:8000 it only work on my system. how to make it public? so that

2017-10-18 Thread Andréas Kühne
Hi, That is a bit outside of django. 1. First of all, you shouldn't run django with runserver on a production system. runserver is just for development purposes, and doesn't do a lot of optimization that you get when running it "correctly". 2. You need to be on a computer that is accessible from

Re: Generating a unique 10 digit ID for each model instance

2017-10-23 Thread Andréas Kühne
James, I agree with you - after thinking about it for another day, your solution would be the best. Regards, Andréas 2017-10-23 10:51 GMT+02:00 James Schneider <jrschneide...@gmail.com>: > > > On Oct 22, 2017 9:29 AM, "Andréas Kühne" <andreas.ku...@hypercode.se>

Re: Generating a unique 10 digit ID for each model instance

2017-10-22 Thread Andréas Kühne
Hi, When you say "globally unique" - I am supposing you mean within your application? What you need to do is set a field to be the primary key, see : https://docs.djangoproject.com/en/1.11/topics/db/models/#automatic-primary-key-fields However - it would be simpler to use the standard primary

Re: Generating a unique 10 digit ID for each model instance

2017-10-22 Thread Andréas Kühne
te *new ID* and re-run the for loop > If *new ID* does not match any *existing ID * in the database, proceed > with continuing the model instance. > > Also I read up on Signals, but is it necessary? > > > On Sunday, October 22, 2017 at 12:30:02 PM UTC-4, Andréas Kühne wrote: >>

Adding several user models

2017-10-24 Thread Andréas Kühne
Hi all, I would love to pick your collective brains for a second. I am working on an application that will be first and foremost an administration system. As such there will be very few users in the system. It will have a front end developed in angular 5 and a Django rest framework backend.

Re: No module named list_detail

2017-11-23 Thread Andréas Kühne
Hi, You have got this because the code you are using is for an older version of django. The object_list functionality has been moved to ListView in the generics package. See here: https://docs.djangoproject.com/en/1.11/ref/class-based-views/generic-display/#listview The object_list functionality

Re: Does django work with bootstrap 4

2017-11-27 Thread Andréas Kühne
Hi, You don't have to learn any ruby to use sass. I prefer sass when I create my css files. You do however need to know howto compile scss files into css. You should be able to find howtos on google. You could also try: https://github.com/jrief/django-sass-processor, then you don't even have to

Re: Decrypting Password

2017-12-14 Thread Andréas Kühne
The point of the way the password is stored, is to prevent this. I don't think it is possible to decrypt the password, because it's not encrypted. It's a hash that should be oneway. See: https://docs.djangoproject.com/en/2.0/topics/auth/passwords/ What you can do is try passwords until you find

Re: No Reverse Match Exception

2017-12-17 Thread Andréas Kühne
2017-12-17 9:35 GMT+01:00 pradam programmer : > From this: > Update > Change to this: > Update > > That will not work and isn't recommended. Everything within {% %} is python code already, so you don't need to interpolate again. I don't even think that will work.

Re: Rails User management system to django user management system for REST API

2017-11-12 Thread Andréas Kühne
Hi, I really doubt this is a good idea. But if you want to user the same database for both applications, you will need to map up the database user model in django. You can find information about that on the following pages: https://docs.djangoproject.com/en/1.11/ref/contrib/auth/

Re: Django translations on mobile

2017-11-04 Thread Andréas Kühne
Django (like other frameworks) listen to specific headers to check for languages (namely : https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). That is the same on all devices. The way we know what language to display the website in is through the browsers sending this

Re: How to run

2017-12-11 Thread Andréas Kühne
Hi, I would recommend that you look at the tutorials that explain a lot. Start with the django tutorial at: https://docs.djangoproject.com/en/2.0/intro/tutorial01/ If you need to do more or get a deeper explanation check out the django girls tutorial: https://tutorial.djangogirls.org/en/ Both

Re: ModelAdmin Media JS file order issue in Django 2.0

2017-12-10 Thread Andréas Kühne
Checking through the documents I found the following reference: https://docs.djangoproject.com/en/2.0/topics/forms/media/#order-of-assets Changed in Django 2.0: In older versions, the assets of Media objects are concatenated rather than merged in a way that tries to preserve the relative

Re: Django 2.0 released

2017-12-03 Thread Andréas Kühne
That's a terrible way to find out about a new release. Hope you didn't suffer too much! Regards, Andréas 2017-12-02 19:07 GMT+01:00 Adler Neves : > I guess I noticed it updated the worst way possible: > >- A commit has been pushed >- Continuous Integration tests

Re: Django Template and compating with select option value

2017-10-29 Thread Andréas Kühne
Hi, I am not really sure what you are trying to accomplish. What you are writing doesn't make sense. I think you should check how to write the paginate by properties. You can find some information here: https://docs.djangoproject.com/en/1.11/topics/pagination/

Re: Adding several user models

2017-10-25 Thread Andréas Kühne
James, Thank you for your long and detailed answer. I agree with you in all of your points and I think that your solution is correct. 2017-10-25 2:52 GMT+02:00 James Schneider <jrschneide...@gmail.com>: > > > On Oct 24, 2017 3:46 AM, "Andréas Kühne" <andreas.ku...@h

Re: Current user ip address on form.py

2018-04-27 Thread Andréas Kühne
Hi, You can get the IP address from the request. See here: https://stackoverflow.com/questions/4581789/how-do-i-get-user-ip-address-in-django Regards, Andréas 2018-04-27 14:28 GMT+02:00 lakshitha kumara : > Hello Guys > > Is there way to get current user ip address

Re: Current user ip address on form.py

2018-04-27 Thread Andréas Kühne
>> def __init__(self, *args, **kwargs): >> self.request = kwargs.pop('request') >> super(RegistrationForm, self).__init__(*args, **kwargs) >> >> On Friday, April 27, 2018 at 6:06:36 PM UTC+5:30, Andréas Kühne wrote: >> >>> Hi, >>&

Re: Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS.

2018-05-13 Thread Andréas Kühne
Hi, The error is pretty self explanatory. When the test client calls the django server it uses the hostname of testserver. This works while testing and also in development mode as long as you have DEBUG=True in your settings file. If you have changed that to False, django will look in the list

Re: Problem with debug = True/False

2018-05-10 Thread Andréas Kühne
Hi, That is the way it should be if you look in the documentation: https://docs.djangoproject.com/en/2.0/howto/static-files/ Serving the files In addition to these configuration steps, you’ll also need to actually serve the static files. During development, if you use

Re: Query about django

2018-06-18 Thread Andréas Kühne
Common web application tasks :-) Seriously though - Django makes it easy to do things that you may want to do with a web application, for example: * Handle forms for adding / updating items in a database * Competent ORM. * User authentication / authorization * Simple admin interface * Handle

Re: Help with context_processor

2018-06-18 Thread Andréas Kühne
First of all - that is not how a context processor works. You are confusing template tags and context processors. A template tag is one of the following: https://docs.djangoproject.com/en/2.0/howto/custom-template-tags/ It must then be registered and then included in your template. So then you

Re: Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

2018-06-15 Thread Andréas Kühne
As Jason stated you probably have an issue with security groups. Make sure that your EC2 instance is in a security group that can access the mysql server. Otherwise you won't be able to connect. And the error you have is what you get when the security groups aren't correct. See here:

Re: python manage.py (anything) NOT WORKING ANYMORE

2018-06-04 Thread Andréas Kühne
Hi, I got really strange issues when I upgraded my ubuntu machine from 17.04 to 17.10 when they changed the python version that was shipped with ubuntu (only going from python3.5 to 3.6 I THINK). This made all of my python environments stop working and I had to recreate them from scratch. Have

Re: Accessing the model attribute of UpdateView & friends

2018-06-05 Thread Andréas Kühne
Hi, Have you tried self.model? It should be present in all methods in the class? Regards, Andréas 2018-06-05 21:56 GMT+02:00 Mikkel Kromann : > Dear Django-users. > > I'm slowly working towards a Django "data-warehouse" framework, where I > can easily add a lot of models (each containing a

Re: Unable to Save form to mysql - How to save form field values to mysql database and get the value from database

2018-07-02 Thread Andréas Kühne
In your views file, you don't have any index method - that's what the error is saying. So you need to solve the url mapping for your index method. Regards, Andréas 2018-07-02 5:55 GMT+02:00 Tamilvanan Anbalagan : > Hi Team, > > I am very new to django framework, iI am trying to using simple

Re: Help with context_processor

2018-06-20 Thread Andréas Kühne
) > > So I relied on various stackoverflow posts, which were quite confusing to > say the least. > > > > Now, is there anyway I can loop over the items in the dictionary? > > In the end, I will probably query my dictionary from another model of mine. > > > > Would

Re: Help with context_processor

2018-06-20 Thread Andréas Kühne
the items in the dictionary? > In the end, I will probably query my dictionary from another model of mine. > > Would the { for item in items } still hold? > > > cheers, Mikkel > > mandag den 18. juni 2018 kl. 22.55.29 UTC+2 skrev Andréas Kühne: > >> First of all - that i

Re: Upload of file with FileField working in admin but not in template

2018-05-03 Thread Andréas Kühne
Hi, The problem isn't CBV's, it's probably your template. You have the following: But it should be: Otherwise the browser doesn't know how to encode the files Regards, Andréas 2018-05-03 18:44 GMT+02:00 Alexander Joseph : > I'm using CBVs and trying to

Re: makemigration not working

2017-12-27 Thread Andréas Kühne
Looking at the output you have, it looks like you haven't got django installed in your virtualenvironment (or you haven't activated your virtualenvironment before running the command). Check here: https://tutorial.djangogirls.org/en/django_installation/ Look for the information about how to

Re: Disallowed User Agents | Force To upgrade

2018-01-07 Thread Andréas Kühne
Include something like this: https://browser-update.org/ It'll add a warning on your site that says that they should upgrade their browser to get the best experience. Regards, Andréas 2018-01-06 6:11 GMT+01:00 Ruchit Bhatt : > In my new Django project, i am

Re: How do I make a Django model from a tab-delimited data file?

2018-01-08 Thread Andréas Kühne
Hi, You will have to parse the CSV file manually with a custom management command (at least that is what I would do). All you need to do is open the file, split each row with a "," and then import the correct columns to the model. You can also use something like pandas to convert the CSV file

Re: Django rest framework Version

2018-01-08 Thread Andréas Kühne
Hi, Just get the latest version of DRF (currently 3.7.7) - as long as the version of django you are running is supported by the DRF version. Regards, Andréas 2018-01-09 4:59 GMT+01:00 Rakhee Menon : > Hey!!! > Please can anyone tell whats the stable version of django

Re: Upload file to a dynamically generated location

2018-01-08 Thread Andréas Kühne
Hi, If you look at the documentation for the upload_to parameter, you can see that you can do exactly what you want: https://docs.djangoproject.com/en/2.0/ref/models/fields/#django.db.models.FileField.upload_to The upload_to method (in your case "get_user_document_directory") can take 2

  1   2   3   4   5   >