Change link on img in template using forms

2016-07-09 Thread Dariusz Mysior
How in template.html change link on . Zdjecie: Teraz: avatar/n.jpg In forms.py like below I see that I can change label name, but how can I do this with ??? class MysiteUserForm(forms.ModelForm): #age =

Try delete image file

2016-06-15 Thread Dariusz Mysior
I want change image and delete this changed when i save this new. I write delete method like below but it is not work, what is wrong? models.py from django.db import models from django.contrib.auth.models import AbstractUser from django.core.validators import MaxValueValidator,

UpdateView - problem with change model

2016-05-28 Thread Dariusz Mysior
I have that problem when I change model in view class EditView on PersonalInfo I have response that "Not found personal info that meet your criteria" when I have model = MysiteUser than it is ok but when I change on model = PersonalInfo than it's a problem. views.py from

Re: UpdateView not saved

2016-05-27 Thread Dariusz Mysior
Yes it help :), thanks! W dniu piątek, 27 maja 2016 16:29:37 UTC+2 użytkownik Dariusz Mysior napisał: > > I try update my photo in avatar field but it not save changes, please look > on it > > update_form.html > > {% extends 'base.html' %} > {% block title %}E

UpdateView not saved

2016-05-27 Thread Dariusz Mysior
I try update my photo in avatar field but it not save changes, please look on it update_form.html {% extends 'base.html' %} {% block title %}Edycja profilu{% endblock %} {% if user.is_authenticated %} {% block top_menu %} {{ user.username }} Wyloguj się {% endblock %} {%

Re: template not see img from Imagefiles

2016-05-13 Thread Dariusz Mysior
, 13 maja 2016 21:46:03 UTC+2 użytkownik Dariusz Mysior napisał: > > I can't find where is a problem, I try show in template image and he don't > show it. Please help... > > my code > > models > > from django.db import models > from django.contrib.a

template not see img from Imagefiles

2016-05-13 Thread Dariusz Mysior
I can't find where is a problem, I try show in template image and he don't show it. Please help... my code models from django.db import models from django.contrib.auth.models import AbstractUser ## class MysiteUser(AbstractUser): avatar =

Re: Add id to url after login user

2016-04-30 Thread Dariusz Mysior
= MysiteUser form_class = AuthenticationForm def form_valid(self, form): x = form.get_user_id() return x def get_success_url(self): x = self.x success_url = '/users/profile/{}'.format(x) return success_url W dniu piątek, 29 kwietnia 2016 09:36:30 UTC+2 użytkownik Dariusz Mys

Re: Add id to url after login user

2016-04-29 Thread Dariusz Mysior
Sory I thought that You are from Poland like I :) Hmm I try Your code but there is comment name 'request' is not defined W dniu piątek, 29 kwietnia 2016 09:36:30 UTC+2 użytkownik Dariusz Mysior napisał: > > I use FormView do login user, but I don't know how I should add his ID &g

Re: Add id to url after login user

2016-04-29 Thread Dariusz Mysior
Hej ja po angielsku słabo piszę, chciałem się nauczyć Class Based View i na tym zrobić system rejestracji, masz pomysł jak to dalej zrobić? Chciałbym wyciagnąć pk i dodać do adresu succes_url... W dniu piątek, 29 kwietnia 2016 09:36:30 UTC+2 użytkownik Dariusz Mysior napisał: > >

Re: Add id to url after login user

2016-04-29 Thread Dariusz Mysior
Hi I try learn Django, and I want do authenticated system in CBV. My nxt try is that I wright it like below but in url adrees instead of id number I have "None" :/ success_url = '/users/profile/'+ str(MysiteUser.pk) W dniu piątek, 29 kwietnia 2016 09:36:30 UTC+2 użytkownik Dari

Add id to url after login user

2016-04-29 Thread Dariusz Mysior
I use FormView do login user, but I don't know how I should add his ID number to success url that when he will log in adres will be users/profile/id urls.py from users.views import RegisterView, LoginView, ProfileView urlpatterns = [ url(r'^register/$', RegisterView.as_view(),

Pycharm and DJANGO_SETTINGS_MODULE

2016-04-07 Thread Dariusz Mysior
Hi in linux console it's ok but in Pycharm in IPython console when I execute f.e. from django.contrib.auth.models import AbstractUser i have bug like below django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but > settings are not configured. You must either define the

Re: Problem with create new instance

2016-03-09 Thread Dariusz Mysior
Ok I have it. I put it to starting scripts W dniu środa, 9 marca 2016 18:48:15 UTC+1 użytkownik Dariusz Mysior napisał: > > I have Django 1.8 Python 3.4 > > My app contact. I have model and form like below and when I run command > > > >> from contact.forms import

Re: Problem with create new instance

2016-03-09 Thread Dariusz Mysior
I found that when I write import django and next django.setup() to terminal than it works. But next question, when I put it to automaticly run it... W dniu środa, 9 marca 2016 18:48:15 UTC+1 użytkownik Dariusz Mysior napisał: > > I have Django 1.8 Python 3.4 > > My app contact.

Problem with create new instance

2016-03-09 Thread Dariusz Mysior
I have Django 1.8 Python 3.4 My app contact. I have model and form like below and when I run command > from contact.forms import MessageForm > and next > form = MessageForm() > I have error In[2]: from contact.forms import MessageForm >> In[3]: form = MessageForm() >> Traceback (most

Re: Problem with DJANGO_SETTINGS_MODULE

2016-03-07 Thread Dariusz Mysior
UTC+1 użytkownik Dariusz Mysior napisał: > > I use Django 1.8 Python 3.4.3 and I have problem when i go to Ipython or > Python and I try use command from contact.forms import MessageForm2 I have > a error like below. I add that in wsgi.py and manage.py I have line > > os.

Problem with DJANGO_SETTINGS_MODULE

2016-03-07 Thread Dariusz Mysior
I use Django 1.8 Python 3.4.3 and I have problem when i go to Ipython or Python and I try use command from contact.forms import MessageForm2 I have a error like below. I add that in wsgi.py and manage.py I have line os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblio.settings") where

How change info about register user

2015-12-30 Thread Dariusz Mysior
In Django\contrib\auth\forms.py I have clas like below. When I use it and create a form to register a user with fields user, password, confirm password I have also info about correct characters to register user. How can I change this info? class UserCreationForm(forms.ModelForm): """ A

Where can I write subclass to oryginal form

2015-12-19 Thread Dariusz Mysior
I want manage form's properties. I have a question, where I must write a subclass to UserCreationForm. In oryginal file "form" i directory ...site-packages\django\contrib\auth ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Problem with a view - MultiValueDictKeyError

2015-12-18 Thread Dariusz Mysior
Hmm I split index view on two views index and register_user and now it is ok heh. W dniu czwartek, 17 grudnia 2015 22:16:33 UTC+1 użytkownik Dariusz Mysior napisał: > > I have this view and I have a bug why? > > def index(request): > # jezeli formularz coś wysłał >

Re: Problem with a view - MultiValueDictKeyError

2015-12-18 Thread Dariusz Mysior
}} {% endif %} {% endblock %} {% endblock %} copyright Dariusz Mysior W dniu czwartek, 17 grudnia 2015 22:16:33 UTC+1 użytkownik Dariusz Mysior napisał: > > I have this view and I have a bug why? > > def index(request): > # jezeli formularz coś wysłał >

Problem with a view - MultiValueDictKeyError

2015-12-17 Thread Dariusz Mysior
I have this view and I have a bug why? def index(request): # jezeli formularz coś wysłał if request.method == 'POST': form_r = UserCreationForm(request.POST) username = request.POST['username'] password = request.POST['password'] user =

Re: Problem with login and register form

2015-11-25 Thread Dariusz Mysior
Before template access_ownsite.html I had separated on few templates like login, register etc .html and it work's but now when I split it, a form is not forward to access_ownsite.html W dniu wtorek, 24 listopada 2015 21:34:30 UTC+1 użytkownik Dariusz Mysior napisał: > > Hi I had a p

Re: Problem with login and register form

2015-11-25 Thread Dariusz Mysior
It's not fix a problem. W dniu wtorek, 24 listopada 2015 21:34:30 UTC+1 użytkownik Dariusz Mysior napisał: > > Hi I had a problem with display a form of login and register, please look > on it. > > my template access_ownsite.html > > {% load staticfiles %} > >

Re: Problem with login and register form

2015-11-25 Thread Dariusz Mysior
cause > d by not using RequestContext. > "A {% csrf_token %} was used in a template, but the context " > > W dniu wtorek, 24 listopada 2015 21:34:30 UTC+1 użytkownik Dariusz Mysior napisał: > > Hi I had a problem with display a form of login and register, ple

Problem with login and register form

2015-11-24 Thread Dariusz Mysior
%} {% if user.is_authenticated == False %} Register {% csrf_token %} {{form.as_p}} {% endif %} copyright Dariusz Mysior {% endblock %} my view.py from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from

Re: I had proglem with .css file loaded to template

2015-11-21 Thread Dariusz Mysior
Ok it's ok already, but I don't know how :/ thanks! W dniu sobota, 21 listopada 2015 14:21:36 UTC+1 użytkownik Dariusz Mysior napisał: > > > I have a problem with loading the css file, after calling index.html who > inherits base_ownsite.html which reads css page will not sho

Re: I had proglem with .css file loaded to template

2015-11-21 Thread Dariusz Mysior
dniu sobota, 21 listopada 2015 14:21:36 UTC+1 użytkownik Dariusz Mysior napisał: > > > I have a problem with loading the css file, after calling index.html who > inherits base_ownsite.html which reads css page will not show background > color or font color ... > > base_own

I had proglem with .css file loaded to template

2015-11-21 Thread Dariusz Mysior
I have a problem with loading the css file, after calling index.html who inherits base_ownsite.html which reads css page will not show background color or font color ... base_ownsite.html {% load staticfiles %}{% block title %}{% endblock %}{% block content %} {% endblock %}

Re: Problem with static folder

2015-11-20 Thread Dariusz Mysior
Thanks! W dniu środa, 18 listopada 2015 22:02:26 UTC+1 użytkownik Dariusz Mysior napisał: > > I had a static folder nr 1 in app accounts and my templates see it, but > when I create folder static nr 2 in my project directory tempalates > dosn't see it. I copy this static folder n

Problem with static folder

2015-11-18 Thread Dariusz Mysior
I had a static folder nr 1 in app accounts and my templates see it, but when I create folder static nr 2 in my project directory tempalates dosn't see it. I copy this static folder nr 2 and past to accounts folder next to this static folder nr 1 and it is visible. Why in project directory

Re: Problem with seassion

2015-11-13 Thread Dariusz Mysior
zalogowany {{ user.username }} {% else %} Strona główna logowanie rejestracja {% endif %} {% endblock %} W dniu piątek, 13 listopada 2015 09:59:04 UTC+1 użytkownik Dariusz Mysior napisał: > > In the application accounts have everything that regards registration and &

Problem with seassion

2015-11-13 Thread Dariusz Mysior
In the application accounts have everything that regards registration and login and beyond this application in the project folder I have index.html to the home page where I have links to login and registration forms, I would like to index.html in some way to provide request.user.username that

Re: How to get logged username in template

2015-11-12 Thread Dariusz Mysior
Thanks for both advice. I am not advanced programmer sow I use the simplest solution on this moment this first one Andréas Kühne. Thanks it works! W dniu czwartek, 12 listopada 2015 08:46:06 UTC+1 użytkownik Dariusz Mysior napisał: > > I am using Django 1.8 with Python 3.4 I had no idea

How to get logged username in template

2015-11-11 Thread Dariusz Mysior
I am using Django 1.8 with Python 3.4 I had no idea why my template doesn't show my username on template profile.html :/ profile.py {% load staticfiles %} {% block content %} My profile {{ request.user.username }} {% endblock %} views.py from django.contrib.auth.forms import

Re: coding in template

2015-11-09 Thread Dariusz Mysior
Thank's i set it in PyCharm on encoding utf-8 like You said and it's work! W dniu sobota, 7 listopada 2015 21:44:25 UTC+1 użytkownik Dariusz Mysior napisał: > > I try use polish letters in my template index.html but I had an error > > > utf-8' codec can't decode byte 0xb3

Re: coding in template

2015-11-07 Thread Dariusz Mysior
How can I save in other coding, I had only option "save as" and name of file index.html W dniu sobota, 7 listopada 2015 21:44:25 UTC+1 użytkownik Dariusz Mysior napisał: > > I try use polish letters in my template index.html but I had an error > > > utf-8' cod

coding in template

2015-11-07 Thread Dariusz Mysior
I try use polish letters in my template index.html but I had an error utf-8' codec can't decode byte 0xb3 in position 149: invalid start byte > > How can I fix it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Form to login

2015-11-05 Thread Dariusz Mysior
Thank's I have it! W dniu środa, 4 listopada 2015 06:51:02 UTC+1 użytkownik Dariusz Mysior napisał: > > I try do login view and I find it on > > https://docs.djangoproject.com/en/1.8/topics/auth/default/ > > from django.contrib.auth import authenticate, login >

Form to login

2015-11-03 Thread Dariusz Mysior
I try do login view and I find it on https://docs.djangoproject.com/en/1.8/topics/auth/default/ from django.contrib.auth import authenticate, login def my_view(request): username = request.POST['username'] password = request.POST['password'] user = authenticate(username=username,

Re: install gettext tools 0.15

2015-10-31 Thread Dariusz Mysior
_win64.zip <https://download.gnome.org/binaries/win64/dependencies/gettext-tools_0.18.1.1-1_win64.zip> create folder in path C:\Program Files\gettext-utils and extract this 2 files there. There isn't msgfmt.exe file W dniu piątek, 30 października 2015 21:33:52 UTC+1 użytkownik Dariusz My

Re: install gettext tools 0.15

2015-10-30 Thread Dariusz Mysior
I do this and I have msfgmt is not recognized as an internal or external command, operable program or a batch file. W dniu piątek, 30 października 2015 21:33:52 UTC+1 użytkownik Dariusz Mysior napisał: > > I use Windows 8 Python 3.4 Django 1.8 and I try > > I set settings and a

install gettext tools 0.15

2015-10-30 Thread Dariusz Mysior
I use Windows 8 Python 3.4 Django 1.8 and I try I set settings and add: USE_I18N = True add to MIDDLEWARE_CLASSES django.middleware.locale.LocaleMiddleware like in describe in link below https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#gettext-on-windows I download

Re: How extract from list with BooleanVar objects each object

2015-07-25 Thread Dariusz Mysior
In this group last posta are from 2013 year :/ W dniu sobota, 25 lipca 2015 18:04:50 UTC+2 użytkownik Dariusz Mysior napisał: > > I want from list (1) with BoolenVar objects (2) extract this objects in > "from" loop (3)...How can I do it... > > def createCheckButton(sel

How extract from list with BooleanVar objects each object

2015-07-25 Thread Dariusz Mysior
I want from list (1) with BoolenVar objects (2) extract this objects in "from" loop (3)...How can I do it... def createCheckButton(self): y=3 for x in range(self.lp): self.chooseButton=BooleanVar() #(2) Checkbutton(variable=self.chooseButton,

How can I share attribute in other class

2015-04-18 Thread Dariusz Mysior
I have two class, and I want use in method first_distribution_cards self.players from first class how can I do this? class Game(object): def __init__(self,name): self.players=[] self.dealer=Person("Dealer") self.name=name class Deck(object): def first_distribution_cards(self): for player

[Python] Problem with arguments given

2015-03-14 Thread Dariusz Mysior
Mam jeden problem nie wiem dlaczego mam bład I have problem with this bug :/ Traceback (most recent call last): > File "C:\Python31\makao.py", line 23, in > nr_players=Hand.ask_number("Ilu graczy ma wziąść udział w grze > (2-5):",low=2,high=5) > TypeError: ask_number() takes exactly 4

Re: Problem with for and if

2015-01-05 Thread Dariusz Mysior
n2()])) W dniu poniedziałek, 5 stycznia 2015 16:45:19 UTC+1 użytkownik Zoltán Bege napisał: > > You should use the string's count method: zmienna.count(szukana) > > See help("string.count") > > On Monday, January 5, 2015 4:32:06 PM UTC+2, Dariusz Mysior wrote: >>

Problem with for and if

2015-01-05 Thread Dariusz Mysior
I want search count of szukana in zmienna but code below counting all 12 letters from "traktorzysta" word szukana="t" zmienna="traktorzysta" def gen(): count=int(0) for a in zmienna: if szukana in zmienna: count+=1 else: continue

Re: Random row

2014-12-20 Thread Dariusz Mysior
gt;> W dniu sobota, 20 grudnia 2014 22:37:23 UTC+1 użytkownik Dariusz Mysior napisał: > > Why I get only last row from my csv file, why I don't get in any time > ranom row :/ > > import csv, random > > def new_name(): > with open('PL_surnames.csv', newline='') a

Random row

2014-12-20 Thread Dariusz Mysior
Why I get only last row from my csv file, why I don't get in any time ranom row :/ import csv, random def new_name(): with open('PL_surnames.csv', newline='') as csvfile: namesreader = csv.reader(csvfile, delimiter=' ', quotechar='|') for row in namesreader: #print

Re: how add path to open()

2014-11-30 Thread Dariusz Mysior
gin, "wb") > > Collin > > > On Saturday, November 29, 2014 2:35:31 PM UTC-5, Dariusz Mysior wrote: >> >> I join to topic with my problem >> >> I want to create new file with login and password in new file and I can >> do it with code below, but I don't k

how add path to open()

2014-11-29 Thread Dariusz Mysior
I join to topic with my problem I want to create new file with login and password in new file and I can do it with code below, but I don't know how save this new files in one folder users def rejestracja(login, haslo): save=None login_tmp=login haslo_tmp=haslo save={login_tmp:haslo_tmp}

Re: View didn't return an HttpResponse object

2014-10-24 Thread Dariusz Mysior
%} {% block content %} Logowanie na stronie Managera Piłkarskiego GoalKick *{{ message}}* {% csrf_token %} {{ form.as_p }} {% endblock %} {% block footer %} Strona główna {% endblock %} What I do wrong, this message is not show :/ W dniu wtorek, 7 października 2014 20:37:49 UTC+

Re: View didn't return an HttpResponse object

2014-10-21 Thread Dariusz Mysior
Thank You, once again it help :) W dniu poniedziałek, 20 października 2014 23:55:28 UTC+2 użytkownik Collin Anderson napisał: > > Hello, > > from django.contrib.auth import logout,login,authenticate,password_change > I think you want: > from django.contrib.auth import logout,login,authenticate >

Re: View didn't return an HttpResponse object

2014-10-20 Thread Dariusz Mysior
st URL: http://darmys.pythonanywhere.com/ Django > Version: 1.6.5 Exception Type: ImportError Exception Value: > > cannot import name password_change > > Exception Location: /home/darmys/dom/dom/views.py in , line 7 W dniu wtorek, 7 października 2014 20:37:49 UTC+2 użytkownik Dariusz Mysior napisał

Re: View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
") else: form = FormularzPasswordChange() return render(request, 'registration/change_password.html', {'form': form}) W dniu wtorek, 7 października 2014 20:37:49 UTC+2 użytkownik Dariusz Mysior napisał: > > I have form to change password like below, and

Re: View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
It was like You said, now I see form and when I write password and submit I have KeyError at /password_change/ 'username' Request

Re: View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
It's : ef password_change_dom(request): if request.method == 'POST': form = FormularzPasswordChange(request.POST) if form.is_valid(): user = authenticate(username=form.cleaned_data['username']) #user =

View didn't return an HttpResponse object

2014-10-07 Thread Dariusz Mysior
I have form to change password like below, and when I try to display it I have an bug: ValueError at /password_change/ The view dom.views.password_change_dom didn't return an HttpResponse object.

Re: static files

2014-09-04 Thread Dariusz Mysior
Ok I set it :) W dniu środa, 3 września 2014 20:01:26 UTC+2 użytkownik Dariusz Mysior napisał: > > I have my path like below: > > home <https://www.pythonanywhere.com/user/darmys/files/home> > darmys > <https://www.pythonanywhere.com/user/darmys/files/h

Re: static files

2014-09-04 Thread Dariusz Mysior
I dont't understand Now I have like You said and it's not work. I try with app name and without. W dniu środa, 3 września 2014 20:01:26 UTC+2 użytkownik Dariusz Mysior napisał: > > I have my path like below: > > home <https://www.pythonanywhere.com/user/darmys/files/home>

static files

2014-09-03 Thread Dariusz Mysior
I have my path like below: home > darmys > dom > player

Re: where is base_site.html

2014-06-30 Thread Dariusz Mysior
Yes I have it! Thank You Andreas!!! W dniu poniedziałek, 30 czerwca 2014 18:10:07 UTC+2 użytkownik Dariusz Mysior napisał: > > I use virtualenv with Django 1.6 Python 2.7 and I am use tutorial > https://docs.djangoproject.com/en/1.6/intro/tutorial02/ and I had a > problem becouse

where is base_site.html

2014-06-30 Thread Dariusz Mysior
I use virtualenv with Django 1.6 Python 2.7 and I am use tutorial https://docs.djangoproject.com/en/1.6/intro/tutorial02/ and I had a problem becouse I don't know where I can find file base_site.html from django/contrib/admin/templates where I can't find this place :/ -- You received this

Re: Upgrade Mysql

2014-06-20 Thread Dariusz Mysior
But in mysite-mysite-settings.py in DATABASES I dont't have CONN_MAX_AGE and in don't have in my general directory file my.cnf :/ W dniu piątek, 20 czerwca 2014 17:31:10 UTC+2 użytkownik Dariusz Mysior napisał: > > I use pythonanywhere.com Django 1.6 and Python 2.7 I > > and

Upgrade Mysql

2014-06-20 Thread Dariusz Mysior
I use pythonanywhere.com Django 1.6 and Python 2.7 I and when I write p.save() I had error like below. It says something about updating mysql to fix it, but I don't know what code or shell commands I need to write. Can you help me? One person post that he upgrade MySQL to 5.0.27 but I don't

Re: Problem with runserver

2014-06-18 Thread Dariusz Mysior
*your-username.pythonanywhere.com/admin* and see the admin site up and running... W dniu środa, 18 czerwca 2014 12:43:38 UTC+2 użytkownik Dariusz Mysior napisał: > > I use pythonanywhere.com and now I install Python 2.7 and Django 1.6 with > virtualenv > > My settings.py is > > D

Re: Problem with runserver

2014-06-18 Thread Dariusz Mysior
It,s work but another message with port :/ Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Error: That port is already in use. W dniu środa, 18 czerwca 2014 12:43:38 UTC+2 użytkownik Dariusz Mysior napisał: > > I use pythonanywhere.com and now I i

Problem with runserver

2014-06-18 Thread Dariusz Mysior
I use pythonanywhere.com and now I install Python 2.7 and Django 1.6 with virtualenv My settings.py is DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'daro822$db1', 'USER': 'daro822', 'PASSWORD': '*', 'HOST':