Re: django angular

2017-03-03 Thread Andreas Kuhne
Hi Mohamed, I would start by looking at some of the tutorials for django rest framework - because you will need to have a format like json to communicate from angular to the database. Checkout : http://www.django-rest-framework.org/ I would also recommend looking at the tutorials on angular :

Re: good 404 vs bad 404

2017-03-01 Thread Andreas Kuhne
I think you should always report a 404 as a 404 regardless of the situation. The application shouldn't have to know if it is a valid 404 or an "invalid" - because from the applications point of view, the page (or item) couldn't be found. Just my 2 cents. Regards, Andréas 2017-03-01 10:25

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Andreas Kuhne
Great to see that I could be of help :-) Regards, Andréas 2017-02-01 21:35 GMT+01:00 Thames Khi : > Thank you so much, you are a legend, sir! I can now continue my learning > and combine my python database code with django. > > I am very grateful, thank you for taking the

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Andreas Kuhne
The setting you have to specify are: STATIC_URL and STATIC_ROOT. STATIC_URL is the url base for creating paths for the webserver to the static files. Usually you just leave this at '/static/' - however you could also set this to a completely different domain (if for example you were serving

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Andreas Kuhne
Hi, You will have to follow the following information: https://docs.djangoproject.com/en/1.10/howto/static-files/ Make sure that the css files and js files are in the static directory. Then you can use {% static "css/bootstrap.min.css" %} for the filepath to the static files. The static files

Re: Moving from django 1.3 to 1.9

2017-01-27 Thread Andreas Kuhne
I second this. Having moved from 1.3 to 1.9 in stages - I think this is the best way to do it. Upgrade one minor version at a time and it will probably be easiest. Regards, Andréas 2017-01-27 10:55 GMT+01:00 ludovic coues : > You might have an easier time upgrading from one

Re: Django and timezones ... how to initialize a field to now() in the in clients time zone?

2017-01-22 Thread Andreas Kuhne
Hi, The problem here is as you say, your server doesn't know the clients timezone. This isn't trivial to find out either. I can help you with some pointers though: 1. ALWAYS save all times in the database in UTC. ALWAYS - never diviate from this - one exception - if you are running a server that

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Andreas Kuhne
What does the project structure look like? Is Stranvr the name of the project? It looks to me like you haven't created an app - or have you called your app "db_testing" and the project "Stranvr"? Because you first have to create you project with "django-admin.py startproject " and then within

Re: Problem in django tutorial 5 , 1044 Access denied for user @'localhost' database error

2017-01-12 Thread Andreas Kuhne
You need to have the database create permission as well. Otherwise django can't recreate the database. What happens when you start the tests is that the database is dropped and recreated each time. Regards, Andréas 2017-01-12 10:24 GMT+01:00 Shashank Yadav : >

Re: Problem with redis on AWS and transition to dynamodb

2016-12-06 Thread Andreas Kuhne
equest to redis.example.com and > this something is what gives you timeouts and connection errors. > > On 6 Dec 2016, at 17:41, Andreas Kuhne <andreas.ku...@suitopia.com> wrote: > > Hi, > > Thanks for you answer - I don't think the problem is with django either, > but tho

Re: Problem with redis on AWS and transition to dynamodb

2016-12-06 Thread Andreas Kuhne
he for my project and it works fine. Here're the docs about > session engines: https://docs.djangoproject.com/en/1.10/ > topics/http/sessions/#using-cached-sessions > > On 6 Dec 2016, at 15:55, Andreas Kuhne <andreas.ku...@suitopia.com> wrote: > > Hi, > > We are h

Problem with redis on AWS and transition to dynamodb

2016-12-06 Thread Andreas Kuhne
Hi, We are having a strange problem with our redis elasticache instances on AWS. We have our sessions stored in a redis cluster on AWS. Our webservers sometimes get a: * Error connecting to redis.example.com:6379. timed out * Timeout reading from socket (I haven't included our real domain for

Re: External access

2016-11-07 Thread Andreas Kuhne
Do you have "ALLOWED_HOSTS" correclty configured in django settings? Regards, Andréas 2016-11-07 14:48 GMT+01:00 bob gailer : > I am running a the django server, listening at port 8000. I can access the > server using localhost. When I try using my external ip address I get

Re: Django FORM for India Postal Address

2016-11-06 Thread Andreas Kuhne
Hi, There is a plugin called django-smart-selects, that enables you to get information from the server based on information in a select field. You could try that? The form_valid() method and clean methods where you can VALIDATE such information is only called when posting the form (as you have

Re: can't create django project using Windows command prompt!

2016-10-05 Thread Andreas Kuhne
Hi, First make sure that you have a valid virtual environment - it's the easiest way to run python code. When that is working, you can just write : "python django-admin.py startproject mySite" - your problem is that .py files have been associated with notepad ++, and therefore it opens the file

Re: django group authentication

2016-09-20 Thread Andreas Kuhne
2016-09-20 1:36 GMT+02:00 sum abiut : > Hi, > i am building an app using django, on login i want django to check for > users in a group before login users. > For example, i want to redirect users from a group to page when they > login. > > please advise the best way to

Re: A public cloud with django backend

2016-09-16 Thread Andreas Kuhne
2016-09-15 9:21 GMT+02:00 Rahul Doshi : > Hi ,I want to setup a dropbox like server with django. So far i have > achieved uploading files onto a location .I want these files to show up on > browser which they do(while saving file to the location I indexed an entry > in

Re: Maintaining old django code

2016-09-06 Thread Andreas Kuhne
2016-09-06 16:07 GMT+02:00 Andromeda Yelton : > +1 to Erik's plan. > > In deciding whether to stop at 1.8 or go all the way to 1.10 I'd ask > myself the following questions: > > * Are there features from 1.10 (that aren't in 1.8) that I'd really like > to have?

Re: Maintaining old django code

2016-09-06 Thread Andreas Kuhne
2016-09-06 10:57 GMT+02:00 Erik Cederstrand : > > > Den 6. sep. 2016 kl. 10.20 skrev Lekan Wahab : > > > > Good morning guys. > > I was handed a project at work which was written as far back as 2012. > > Quiet a lot of the packages used in the

Re: Clarifying Project vs Apps

2016-08-24 Thread Andreas Kuhne
2016-08-24 21:09 GMT+02:00 Andromeda Yelton : > My feeling/practice on apps is: each app is a one-word informative noun. > It contains the models that are logically grouped under that noun (and the > views, urls, etc required to interact with those models on the front

Re: Running Django Project Locally

2016-08-24 Thread Andreas Kuhne
2016-08-24 17:54 GMT+02:00 Michael Macdonald : > Interestingly enough, just this morning, after a couple times being bitten > with differences in behavior between use of runserver in development vs. > wsgi in production, I've decided to do all development on my

Re: Clarifying Project vs Apps

2016-08-24 Thread Andreas Kuhne
2016-08-24 19:12 GMT+02:00 Lee Hinde : > On Wed, Aug 24, 2016 at 9:23 AM, Rich Shepard > wrote: > >> On Wed, 24 Aug 2016, Lee Hinde wrote: >> >> My tuppence. >>> >> >> Lee, >> >> Before or after Brexit? The value might change. :-) >> >> No, an app

Re: Launching websites

2016-08-09 Thread Andreas Kuhne
Hi, I don't know what level you are interested in, but I think this course will be interesting: https://www.kickstarter.com/projects/mikeckennedy/python-for-entrepreneurs-video-course It'll probably contain some of the items you are requesting. Regards, Andréas 2016-08-09 12:59 GMT+02:00

Re: Please another problem

2016-08-08 Thread Andreas Kuhne
Hi Timothy, There aren't any errors in the trace you are showing. There is a missing file however (404 error), that is the favicon.ico, which browsers try to fetch from the root URL if nothing is set in your html header. To resolve that, all you have to do is add a link to a favicon file. Check

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
doc = etree.HTML(response.content) > > self.assertEqual(len(doc.findall('.//input[@name="username"]')), 1) > > > > 2016-07-31 17:46 GMT+02:00 Andreas Kuhne <andreas.ku...@suitopia.com>: > > 2016-07-31 15:59 GMT+02:00 ludovic coues <cou...@gmail

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
the current state of the application. > > 2016-07-31 14:46 GMT+02:00 Andreas Kuhne <andreas.ku...@suitopia.com>: > > 2016-07-31 13:56 GMT+02:00 ludovic coues <cou...@gmail.com>: > >> > >> First, thanks for the suggestion. > >> > >> I just tried

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
> I could copy/past the input directly in my test but if the maxlength > or class attribute change, the test will break. Taking the input > directly from the django form will test if the django form is rendered > in the view, not if the view is displaying a suitable form. > > 20

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
2016-07-31 12:38 GMT+02:00 ludovic coues : > Hello, > > I am trying to test if a view is displaying a form with an input > element with name=username. > > Currently, I have tried a lot of variation around > `self.assertContains( response, "", > html=True)` but none work. > I

Re: Deploy Django to Heroku - Push rejected

2016-03-19 Thread Andreas Kuhne
Hi, You haven't created the app in the correct heroku way. You have to have a base django project structure. So the following changes I would suggest: 1. Use the standard layout for settings. So a settings.py file with the PRODUCTION settings in and it will find that file. Also make sure you

Re: NAS using Django

2016-03-09 Thread Andreas Kuhne
Hi Vayuj, I think you have to be a bit more specific. Django is a web framework, used for creating web applications and websites. A NAS is usually an array of harddrives that has different file sharing protocols attached (for example SMB or NFS). It would be possible to implement something like

Re: Home Page

2016-02-24 Thread Andreas Kuhne
Malik, I find that in many of your questions you are thinking a bit too hard. If you want to have a view for the default page (home page) on a website, just create an app that will handle those pages. In one project that I am currently working on, we created an app called website. In that app we

Re: context dictionary

2016-02-23 Thread Andreas Kuhne
True, didn't know that it was active in that way nowadays. To Malik: Don't use user as a key in the dictionary. Regards, Andréas 2016-02-23 16:01 GMT+01:00 : > Wouldn't including the name 'user' in your context dictionary override the > authenticated user object in your

Re: context dictionary

2016-02-23 Thread Andreas Kuhne
Hi, All you have to do is add what you want to the dictionary that you need for your template. There isn't anything "magic" about the context. So for example, if you want to have a model called "user" in the template, you can add it by writing: context = {} context['user'] =

Re: Migrate Data from Django 1.4 to Django 1.8

2016-02-22 Thread Andreas Kuhne
Hi, I did that a while back, I wrote my own SQL migration script that we tested with the production database in development. I think that would be the only way. Django doesn't know of the changes that you have made in your database models. However if you had started with the production database

Re: Bug or unaccepted behaviour

2016-02-14 Thread Andreas Kuhne
Hi, Would need to see more of you code to understand exactly what you want to do. Regarding your question. It doesn't make sense, but I think you are asking the difference between "u.theme_id = self.id" and "u.theme = self"? I don't know exactly the difference, but I do know that you shouldn't

Re: Django Multiple User Login

2016-02-11 Thread Andreas Kuhne
You can't? Not without logging out the previous user. The session itself is used to contain a reference to the current user. You can only have one session to a certain domain (for example www.example.com and app.example.com are 2 different domains). The only way for the other user to login is to

Re: How to update a live / deployed Django project?

2016-02-10 Thread Andreas Kuhne
The thing is, you should be able to catch those issues when migrating locally on you development machines. In that case, just fix the migration and then it should work perfectly in production. You can always add certain values in the migration scripts themselves. Regards, Andréas 2016-02-10

Re: How to update a live / deployed Django project?

2016-02-10 Thread Andreas Kuhne
Hi, What I tend to do when deploying is: 1. Create a fabric script that contains a reference to the server that should be updated (defaults to dev server). 2. Use git archive to zip the contents of a git tag to a local file. 3. Upload the file to the server 4. Stop the uwsgi process 5. Update

Re: django admin objectaction confirmation

2016-01-18 Thread Andreas Kuhne
Hi, Check how actions work in the admin interface. You should be able to create something that works the same by clicking on a button. See here: https://docs.djangoproject.com/en/1.9/ref/contrib/admin/actions/ The main point is that if you do a http get, you should show the confirmation page,

Re: Django Admin

2016-01-18 Thread Andreas Kuhne
Hi Rafael, I would use a plugin for django admin that creates an autocomplete field (django-selectable works). Then when the user chooses something in the autocomplete list, I would populate the other fields via ajax with the values that you need. That way you don'ẗ need a foreign key field (even

Re: Execute code which runs on the database only when the server is running - and doesn't need users to view pages.

2016-01-11 Thread Andreas Kuhne
Oh ok, Sorry I misunderstood your problem. How about running the celery task and then checking if http://localhost is up? Regards, Andréas 2016-01-11 13:31 GMT+01:00 Tony Flury : > Andreas, > > Thanks for your answer. Certainly it looks like running celery might

Re: Execute code which runs on the database only when the server is running - and doesn't need users to view pages.

2016-01-11 Thread Andreas Kuhne
Hi, Wouldn't it be possible to use celery and tasks for this purpose? http://www.celeryproject.org/ You could have it running all the time and have a flag in the database for when the server is running? Regards, Andréas 2016-01-11 9:59 GMT+01:00 Tony Flury : > I

Re: Drop down dependent on two other form fields

2016-01-04 Thread Andreas Kuhne
Hi Arindam, I didn't find any really good solution, however, googling for "django dropdown dynamic", should point you in the right direction. Hope that helps. Regards, Andréas 2016-01-05 7:07 GMT+01:00 Arindam sarkar : > Hello, > In my project I have a from in which

Re: possible to setup old project (different dependencies) as a library ?

2016-01-04 Thread Andreas Kuhne
As a person who has done this on 2 separate occasions, I also think that the best way would be to start a rewrite and upgrade ASAP. However, having said that. I think you COULD be able to run the old code in a django 1.9 environment, by checking for different methods. For example in django 1.4 a

Re: Guidelines For A Newbie

2016-01-04 Thread Andreas Kuhne
Hi Jay, What I would recommend is that you go throught the django tutorials and just "do" the js parts regardless of what they say - you will then get a bit of understanding for the django MVC concept and also how the django backend works and what goes where in django. The other issues you are

Re: Admin debugging delete

2015-12-18 Thread Andreas Kuhne
Hi, Are you working in django admin and using the delete checkbox to delete a child record? If so, it is not a javascript event, but it is handled by when you save to the parents form (it's a formset with child forms). I would follow where the django code stops executing. Regards, Andréas

Re: update Django

2015-12-15 Thread Andreas Kuhne
Hi, As previously stated. Give us some more details and we can probably help you. I have done upgrades from 1.3 to 1.8 and 1.5 to 1.8 in different projects, we can probably help if we get some more information :-) Regards, Andréas 2015-12-15 16:55 GMT+01:00 Ovnicraft : >

Re: How to search by country using django-countries?

2015-11-23 Thread Andreas Kuhne
HI Jorge, What do you mean you want to search by country? I think the easiest way would be to add a filter for the country field in admin. The thing is with the countries plugin, you only save the 2-letter version of the country (for example GB for Great Britain, ES for Spain, SE for Sweden and

Re: Custom user model password is not hashed

2015-11-12 Thread Andreas Kuhne
t_password(password). > But I am getting the same result. > > On Thu, Nov 12, 2015 at 8:57 PM, Andreas Kuhne <andreas.ku...@suitopia.com > > wrote: > >> As aRkadeFR says, you seam to have mixed code there >> >> The row: >> user.set_password(self.cleaned_dat

Re: Custom user model password is not hashed

2015-11-12 Thread Andreas Kuhne
As aRkadeFR says, you seam to have mixed code there The row: user.set_password(self.cleaned_data["password"]) is taken from a form somewhere and won't work. It should instead be : user.set_password(password) I suppose the password is going through to the create method via the kwargs

Re: How to get logged username in template

2015-11-12 Thread Andreas Kuhne
Hi, First of all, you are using request.user.username and not username in your template. If you want the username to be accessed via the "username" variable. You should write this in your view: def profile(request): return render_to_response('accounts/profile.html', {'username':

Re: Just starting, cannot create Password for superuser

2015-11-11 Thread Andreas Kuhne
Hi Raja, What do you mean it doesn't allow you to type anything at all? It shouldn't echo anything. The prompt doesn't move when inputing the password and that's the way it should be. Try to add a password and the press enter. You should then be prompted to re-enter the password. Without echoing

Re: Where does the static files reside

2015-11-08 Thread Andreas Kuhne
Hi Gary, You can certainly setup a global static files location. All you need to do is add a path to STATICFILES_DIRS in your settings file. However, that is not really necessary. All files that are in a static directory in one app are accessible in other apps. You can create an app that contains

Re: django admin - You don't have permission to edit anything

2015-11-06 Thread Andreas Kuhne
y > provided neither in the User models or in the User manager. Therefore, I > just copied the example from the django doc and tried running it. After > creating the superuser, I can edit the models. I have no Idea what I am > mission now. > > > On Fri, Nov 6, 2015 at 11

Re: django admin - You don't have permission to edit anything

2015-11-05 Thread Andreas Kuhne
Hi, You don't have permissions to edit anything, because you haven't created a superuser. The superuser in django has a property that is called "is_superuser" and should be set to True. If you don't have that property (and your createsuperuser sets some other property), you will have the same

Re: Django admin multipleselect filter

2015-11-04 Thread Andreas Kuhne
HI! Thanks for the pointers. I actually was able to solve it by myself. What I did was create a multichoice checkbox field in a form. Then I used a bit of javascript just to reformat the parameters in a way that I wanted then. Works very good actually. :-) Med vänliga hälsningar, Andréas Kühne

Re: return values from static files to django admin

2015-11-02 Thread Andreas Kuhne
Hi, Yes you could just populate the dropdown list with javascript. Regards, Andréas 2015-11-02 17:27 GMT+01:00 dc : > Thanks a lot. Let me look into it. > > Is there any other way I can populate my choice list with user input? > > On Monday, November 2, 2015 at 10:19:22 AM

Re: return values from static files to django admin

2015-11-02 Thread Andreas Kuhne
Hi, What you are suggesting doesn't work. You can't communicate with the django backend via javascript if you don't use a lot of ajax requests. I would check django-smart-selects and see if you could use that? Regards, Andréas 2015-11-02 15:57 GMT+01:00 dc : > Any lead will be

Django admin multipleselect filter

2015-11-02 Thread Andreas Kuhne
Hi all, I have a django site that displays the change list for a class called Order. The Order class has a property called status. I would like to be able to filter the change list by multiple statuses. So a user should be able to check several statuses and show all orders that have one of the

Re: Translation is not working for Template even though po and mo files are created

2015-11-02 Thread Andreas Kuhne
Hi, I am unsure about the project level translations path, if they should be found as well. I have added them manually to settings, but only that path. Application paths get imported automatically. Regards, Andréas 2015-11-02 6:38 GMT+01:00 Sean Xu : > Sorry, > >

Re: Translation is not working for Template even though po and mo files are created

2015-11-01 Thread Andreas Kuhne
Hi Sean, That's interesting. You shouldn't have to add the locale paths explicitly. Good that it's wokring, but as long as you put the locale files in a directory named locale under each app and also under the project, it should just work (as long as all apps are included in the config). Just

Re: Django templates

2015-10-31 Thread Andreas Kuhne
Hi, There aren't any specific templates for windows or any other operating system. Django runs on a webserver and is compatible regardless of OS. I would recommend that you look at the tutorial and see how to get started: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ Regards, Andréas

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Andreas Kuhne
Hmmm I'm a bit at a loss here. But does Django know where to find the .mo files? Is it only your template that isn't getting translated, because you said that the form itself is? Regards, Andréas 2015-10-30 12:45 GMT+01:00 Sean Xu : > Now I have corrected the orders

Re: Translation is not working on ModelForm when widget is specified for form field

2015-10-30 Thread Andreas Kuhne
Hi, The problem is that you are redifining the fields, the fields then don't get any labels (because you haven't specified them). You can achieve what you want in two ways: Either add the following to your modelform: start_time = forms.DateTimeField(label=_("start time"),

Re: Translation is not working for Template even though po and mo files are created

2015-10-30 Thread Andreas Kuhne
Hi, Have you made sure that you have activated the languages you want in your application? Also, how is the current language being selected? See: https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#how-django-discovers-language-preference Regards, Andréas 2015-10-30 7:45 GMT+01:00

Re: Starting a .py file from a Button in my Template

2015-10-19 Thread Andreas Kuhne
Hi, You can't do it that way. If you want to run a python file on the server, you can do it in several ways: 1. Create a view that runs all the code inside the refresh.py file. This could take an amount of time, so I wouldn't do it that way. 2. Create a view that calls a celery task to run the

Re: Logout implementation Django

2015-10-14 Thread Andreas Kuhne
Hi, You should be able to access the website without logging in? Or do you mean that the user has access to protected pages? If you have added the login_required decorator ( https://docs.djangoproject.com/en/1.8/topics/auth/default/#the-login-required-decorator) on your view functions that

Re: Method call at end of Django session

2015-10-03 Thread Andreas Kuhne
Hi again, What I would do is create a django management command (see https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/) and then use cron to call it a regular intervals (5-10 minute intervals for example). Another way to do it would be to use celery, which is a delayed job

Re: Method call at end of Django session

2015-10-02 Thread Andreas Kuhne
Hi, I don't think you can reliably do that. Django never knows when the user closes his browser window. Because a session is stateless (there is only a connection to the server when it responds to a request). However you could do this via a bit of ajax or a pretty unreliable javascript event.

Re: Why should we use Django Rest Framework?

2015-10-02 Thread Andreas Kuhne
Hi Robert, The main reason for using django rest framework is if you need a backend to communicate with one or more rich frontends. An example could be if you have a website running django and you want to create a mobile application for iOS or android. You can then create an API that will

Re: Django clustering - How to manage Image uploading

2015-09-09 Thread Andreas Kuhne
I would use something like Amazon S3 to store the images. I think that's the easiest way to do it. If you use the django-storages plugin, you can configure your servers to talk to S3 just like they were using local storage. You will never have any problems with diskspace and all of your servers

Re: Django - Website Bootstrap Design Breaks For Production

2015-07-17 Thread Andreas Kuhne
Hi, There is a difference to running the runserver in development and production mode. In development mode the server automatically serves all of you static files (JS and CSS). In production mode you should have a webserver in front of the uwsgi server that serves the python code. For example you

Re: Installing Django and Python 3.4 on a freshly registered Debian VPS

2015-07-04 Thread Andreas Kuhne
2015-07-04 14:19 GMT+02:00 Christian Kleineidam < christian.kleinei...@gmail.com>: > I want to install Django and Python 3.4 on a freshly registered Debian > server. > What are the steps I have to take given that I want to use Python 3.4 and > not the debian default of 2.7? > I expect I also need

Manually add image to filefield in save method on modelform

2015-06-22 Thread Andreas Kuhne
Hi all, I have created a modelform that has an Imagefield in it. I want to override the save function and manually create a filefield with an image that already exists in the file storage (S3). So the things I have to do would be: * Download the image from S3 and save it to a temporary file *

Django plugin

2015-06-11 Thread Andreas Kuhne
Hi all, I was wondering if there is a plugin application for Django. What I want to accomplish is react to different kinds of events on my models and then create plugins on the fly for them. The system I am working on has for example an Order model. When a new Order is created, I want to send a

Re: Implementing multiple user types with Django 1.7

2015-06-05 Thread Andreas Kuhne
groups. >> >> Em sex, 5 de jun de 2015 às 11:24, Andreas Kuhne <andrea...@suitopia.com> >> escreveu: >> >>> Hi Marcelle, >>> >>> You should not use the user profile solution anymore, because you can >>> now create a custom User mo

Re: Implementing multiple user types with Django 1.7

2015-06-05 Thread Andreas Kuhne
Hi Marcelle, You should not use the user profile solution anymore, because you can now create a custom User model instead. Check for example: http://www.lasolution.be/blog/creating-custom-user-model-django-16-part-1.html This way you can add fields that are needed for your user solutions in your

Re: need to upgrade django1.4.5-->django1.5, but apt-get install django tells me i'm running latest version

2015-06-01 Thread Andreas Kuhne
2015-06-01 19:17 GMT+02:00 arthur sherman : > i get the following errors in the apache2 error.log: > > VersionConflict: (Django 1.4.5 (/usr/lib/python2.7/dist-packages), > Requirement.parse('Django>=1.5')) > > but when i attempt upgradinging django apt-get install

Re: "&" string to template adds "" in the html

2015-05-21 Thread Andreas Kuhne
2015-05-21 18:35 GMT+02:00 dk : > I am creating a string inside the view that will be use in the template on > the javascript. > my string in python contains & and I print the view and works fine, but > when is send to the template I don get > > is there something magical

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-05-15 Thread Andreas Kuhne
You are getting it because someone has come to your server by entering www.g3suprimentos.com.br in a browser. If you don't have that address in the allowed hosts setting, you will get the error you have received. If you don't want your server to show something for www.g3suprimentos.com.br, then

Re: Version

2015-04-21 Thread Andreas Kuhne
Hi, First of all, don't use apt-get to install django, you will never get the version you want. Use a virtualenv instead: Google virtualenv install ubuntu (and your ubuntu version). Create a virtualenvironment and install django with pip. Using pip you can install whatever version of django you

Re: csrf_exempt decorator and class based views

2015-04-15 Thread Andreas Kuhne
First of all, why are you not using the default views that django provides? In your case all you have to do is subclass the View class (django.views.generic.View) to get all the functionality that you require (i.e. you get a post and get method that will automatically be called). Second of all,

Re: image handling

2015-03-25 Thread Andreas Kuhne
the function save will > called.Will it be called automatically when i edit image. > > I have used upload function to call a function which change the name of > the image and save it to the database. > > On Wed, Mar 25, 2015 at 1:44 PM, Andreas Kuhne <andreas.ku..

Re: image handling

2015-03-25 Thread Andreas Kuhne
=models.CharField(verbose_name = >> "Pincode",max_length=20,blank=True) >> country=models.CharField(verbose_name = >> "Country",max_length=30,blank=True) >> comment=models.CharField(verbose_name = >> "Comment",max_length=200,bla

Re: Image resizing

2015-03-25 Thread Andreas Kuhne
ResponseRedirect('/index/') > else: > return > render_to_response("edit_profile.html",{"form":regform,}) > else: > > > regform=Edit_Registration(instance=usr_obj) > return > render_to_response("

Re: image handling

2015-03-24 Thread Andreas Kuhne
h=30,blank=True) > comment=models.CharField(verbose_name = > "Comment",max_length=200,blank=True) > sex=models.CharField(verbose_name = "Sex *",max_length=5,blank=False) > image=models.FileField(verbose_name = "Image(limit 1Mb) > *",blank

Re: image handling

2015-03-24 Thread Andreas Kuhne
will you please tell me how to use above mentioned function in > edit_profile function in view, Can i call another function from another > function in views.py, if yes please tell me > > On Tue, Mar 24, 2015 at 6:11 PM, Andreas Kuhne <andreas.ku...@suitopia.com > > wrote: >

Re: Image resizing

2015-03-24 Thread Andreas Kuhne
er answer... > > On Tue, Mar 24, 2015 at 6:13 PM, Andreas Kuhne <andreas.ku...@suitopia.com > > wrote: > >> Hi, >> >> Check out the easy_thumbnails plugin. >> http://easy-thumbnails.readthedocs.org/en/2.1/ >> >> It automatically resizes all images

Re: Re-run only tests that failed last time

2015-03-24 Thread Andreas Kuhne
If you have created packages for your tests, you can run all tests in a package. If the tests aren't in the same package, it won't help you however. Regards, Andréas 2015-03-24 11:27 GMT+01:00 Gergely Polonkai : > Hello, > > I have a pretty extended test suite for my

Re: Image resizing

2015-03-24 Thread Andreas Kuhne
Hi, Check out the easy_thumbnails plugin. http://easy-thumbnails.readthedocs.org/en/2.1/ It automatically resizes all images to the size you want if you use it correctly. Regards, Andréas 2015-03-24 11:07 GMT+01:00 : > Hi.. > can anyone please tell me how to resize

Re: image handling

2015-03-24 Thread Andreas Kuhne
Hi, Ok, so what you should do is add a signal to pre save and then delete the old image if the new image is attached. Something like this should work: from django.core.files.storage import default_storage as storage from django.db.models.signals import pre_save def image_delete(sender,

Re: image handling

2015-03-24 Thread Andreas Kuhne
Hi, I think you'll have to be more specific, what do you want to do with the old image? Delete it? Use it again? Regards, Andréas 2015-03-24 10:08 GMT+01:00 : > hi.. > Can anyone please tell me how to handle old image after uploading new > image. > > -- > You received

Re: Maximum database connections exceeded

2015-03-20 Thread Andreas Kuhne
Hi Hans, I know this isn't really solving your issue, but it can remove a symptom. I have successfully used pgBouncer to pool the connections, so that connections aren't handled by django directly, but you connect to a connection pool, so that it can create and reuse connections more efficiently.

How to track number of visitors on django site

2015-03-12 Thread Andreas Kuhne
Hi all, I would like to be able to track the number of visitors on our website. We previously had django-tracking installed and a munin node that tracked the information. Unfortunately we weren't able to continue using it because it broke our website somehow (I don't remember how). Does anyone

Re: Django 1.6's lifespan for security updates?

2015-03-11 Thread Andreas Kuhne
2015-03-11 13:28 GMT+01:00 Stephen Gallagher : > > On Tuesday, March 10, 2015 at 6:01:28 PM UTC-4, Carl Meyer wrote: >> >> I sympathize with your situation, but Python 2.6 reached end-of-life on >> October 29, 2013 (a year and a half ago now), and since then has been >>

Re: How to track number of visitors on django site

2015-03-10 Thread Andreas Kuhne
ourselves somehow. Regards, Andréas 2015-03-10 21:40 GMT+01:00 Vijay Khemlani <vkhem...@gmail.com>: > Hmmm... what about the classic Google Analytics? > > On Tue, Mar 10, 2015 at 5:04 PM, Andreas Kuhne <andreas.ku...@suitopia.com > > wrote: > >> Hi all, >&

Re: RoR dev having trouble with finding best-packages for Django

2015-03-04 Thread Andreas Kuhne
Hi, I'll give you answers to the questions I know, the others you'll have to wait for others more knowledgable. 1. User authentication, django has django.contrib.auth built in. Checkout https://docs.djangoproject.com/en/1.7/topics/auth/ 2. User authorization, also in the auth package. You can

Re: OperationalError: ORA-03114: not connected to ORACLE.

2015-02-25 Thread Andreas Kuhne
Hi Alex, Correct. There seems to be something wrong with the configuration of mod_wsgi, because you are able to connect via dbshell (which loads all of your environment variables and is able to connect). The same thing with runserver. Check for a good tutorial on how to configure apache +

Re: OperationalError: ORA-03114: not connected to ORACLE.

2015-02-24 Thread Andreas Kuhne
The file you wrote connects to the database itself, it doesn't use djangos connection, so the only thing you are testing is if you can connect to the database. And that we know (because you are able to do it with ./manage.py dbshell). What you need to check is if the settings.py file used by

Re: OperationalError: ORA-03114: not connected to ORACLE.

2015-02-24 Thread Andreas Kuhne
Hmmm You can use ./manage.py dbshell, so your configuration is correct in THAT case, however, have you set all the variables correctly for django when running apache + mod_wsgi? Has the connection ever worked there? What do the config files for mod_wsgi look like and are all of the paths

  1   2   3   >