Re: Regarding the Django ImportError Issue

2023-08-25 Thread ivan harold
I think it is better if you reply to the specific thread that has this 
issue. So that the concerned person will be able to see your reply 
immediately.

On Saturday, August 26, 2023 at 1:29:58 AM UTC+8 abhijeet tripathi wrote:

>
>
> Hello,
>
> I hope this message finds you well. I wanted to let you know that I've 
> taken a look at the error message you shared:
>
> ```
> Aug 25 12:28:30 AM  ImportError: Couldn't import Django. Are you sure it's 
> installed and available on your PYTHONPATH environment variable? Did you 
> forget to activate a virtual environment?
> Aug 25 12:28:30 AM  ==> Build failed
> ```
>
> To better assist you in resolving this issue, could you kindly provide me 
> with some additional details? This information will help me gain a clearer 
> understanding of your setup and the potential causes of the error:
>
> 1. **Operating System:** Please let me know the operating system you're 
> using (e.g., Windows, macOS, Linux).
>
> 2. **Python Version:** What version of Python is installed on your system? 
> You can find this information by running the command `python --version` in 
> your terminal.
>
> 3. **Virtual Environment:** Are you working within a virtual environment? 
> If so, have you activated the virtual environment before attempting to run 
> the project?
>
> 4. **Project Configuration:** Could you share any relevant configuration 
> details related to your project setup? This could include how your project 
> is structured and any configuration files that may be relevant.
>
> 5. **Django Installation:** Confirm whether Django is installed in your 
> virtual environment. You can use the command `pip show django` to check its 
> status.
>
> 6. **PYTHONPATH:** If you've made any modifications to the PYTHONPATH 
> environment variable, please share the details of those changes.
>
> 7. **Build Process:** Briefly describe the steps you take leading up to 
> encountering the error. This could include any commands you run or actions 
> you perform.
>
> By providing these details, I'll be able to narrow down the potential 
> causes of the ImportError and offer more precise guidance to help you 
> resolve it.
>
> Thank you for your cooperation. I look forward to receiving more 
> information from you so that we can work together to address this issue 
> effectively.
>
> Best regards,
> [Abhijit]
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4f27972f-7831-49e9-b74d-14312b268820n%40googlegroups.com.


Re: Help on Error while deploying a django app on render.

2023-08-25 Thread ivan harold

Try following these

https://www.freecodecamp.org/news/deploying-a-django-app-to-render/
On Friday, August 25, 2023 at 9:00:08 PM UTC+8 Abdulrahman Abbas wrote:

> Are you using virtual environment?
>
> On Thu, Aug 24, 2023, 22:37 ALINDA Fortunate  
> wrote:
>
>> Hello family some help i have this error
>>
>> Aug 25 12:28:30 AM  ImportError: Couldn't import Django. Are you sure 
>> it's installed and available on your PYTHONPATH environment variable? Did 
>> you forget to activate a virtual environment?
>> Aug 25 12:28:30 AM  ==> Build failed 
>>
>> Yet this is my requirements file and django is installed
>> asgiref==3.6.0
>> dj-database-url==2.1.0
>> Django==4.2.1
>> gunicorn==21.2.0
>> packaging==23.1
>> psycopg2==2.9.7
>> python-dotenv==1.0.0
>> sqlparse==0.4.4
>> typing_extensions==4.7.1
>> tzdata==2023.3
>> whitenoise==6.5.0
>>
>>
>> Kindly help me.
>> --
>>
>> ALINDA Fortunate
>> Graduate Of Computer Science
>> Gulu University
>> Passionate about Software Development in Python
>> If you can't explain it simply, you don't understand it well enough.
>> alindafo...@gmail.com.
>> +256 774339676 <+256%20774%20339676> / +256 702910041 
>> <+256%20702%20910041>
>> Kagadi.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAPifpCvYY%3D%2BFuNAYKXgoikghEYGCB90iw_24S1Ctye%3DZEJdNqg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2dda8d5e-4f1b-4784-acaa-a44ed555e0cen%40googlegroups.com.


Re: Help on Error while deploying a django app on render.

2023-08-25 Thread ivan harold

https://www.freecodecamp.org/news/deploying-a-django-app-to-render/
On Friday, August 25, 2023 at 9:00:08 PM UTC+8 Abdulrahman Abbas wrote:

> Are you using virtual environment?
>
> On Thu, Aug 24, 2023, 22:37 ALINDA Fortunate  
> wrote:
>
>> Hello family some help i have this error
>>
>> Aug 25 12:28:30 AM  ImportError: Couldn't import Django. Are you sure 
>> it's installed and available on your PYTHONPATH environment variable? Did 
>> you forget to activate a virtual environment?
>> Aug 25 12:28:30 AM  ==> Build failed 
>>
>> Yet this is my requirements file and django is installed
>> asgiref==3.6.0
>> dj-database-url==2.1.0
>> Django==4.2.1
>> gunicorn==21.2.0
>> packaging==23.1
>> psycopg2==2.9.7
>> python-dotenv==1.0.0
>> sqlparse==0.4.4
>> typing_extensions==4.7.1
>> tzdata==2023.3
>> whitenoise==6.5.0
>>
>>
>> Kindly help me.
>> --
>>
>> ALINDA Fortunate
>> Graduate Of Computer Science
>> Gulu University
>> Passionate about Software Development in Python
>> If you can't explain it simply, you don't understand it well enough.
>> alindafo...@gmail.com.
>> +256 774339676 <+256%20774%20339676> / +256 702910041 
>> <+256%20702%20910041>
>> Kagadi.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAPifpCvYY%3D%2BFuNAYKXgoikghEYGCB90iw_24S1Ctye%3DZEJdNqg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e95a3141-fa1c-4247-86fb-16b8886beeccn%40googlegroups.com.


Re: I can1t install django-allauth

2023-08-25 Thread ivan harold

Try following this steps

https://hyperhost.ua/en/wiki/ustanovka-i-zapusk-python-django-v-cpanel
On Thursday, August 24, 2023 at 3:23:47 AM UTC+8 Juhász Tamás wrote:

> Hello,
> django-allauth is well installed and working in my development environment.
> But I can't install it on the live server (cPanel). pip is good, django is 
> installed. Allauth refuses, in every case it stops with so many errors that 
> I can't even look back in the cPanel terminal, what could have been the 
> first.
> Anyone who can help ... thx 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05963b71-66af-497e-9215-72688df51360n%40googlegroups.com.


Re: I Want To Save The Data In My Database Depending On The Catgory Of Data Chosen by User Like I Have 4 Lisitings Like APparetements, Food And Life, Car And Travelling if User Selects Appartements Th

2023-08-23 Thread ivan harold
You should prepare a different form that will submit the post to a specific 
table or database. you have to specify where the table or database the post 
will go.

On Sunday, August 20, 2023 at 11:29:57 AM UTC-5 Hamza Bilal wrote:

> {% extends 'home.html' %}
> {% load static %}
> {% block content %}
>
> 
> 
>   
> 
>   
> Add Plots In Your Listing
> If You Want To Buy The Plot Then Add It In Your Listing h2>
>   
> 
>   
> 
> 
>
> 
> 
>   
> 
>   
> 
>   
>   
>  "multipart/form-data">
>   
> {% csrf_token %}
> 
> Listing Type
> {{ form.listing_type }}
> Area
> {{ form.area }}
> Location
> {{ form.location }}
>
> Price
> {{ form.price }}
> Title
> {{ form.title }}
> Upload An Image
> {{ form.image }}
> 
> 
> 
>   
>  class="main-button 
> ">Add Your Listing!
>   
> 
>   
> 
>   
> 
>   
> 
>   
> 
> 
>
> 
> 
> 
> 
> 
>
> {% endblock content %}
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e83ef63c-42cd-42d7-bae8-3f099bfd6de4n%40googlegroups.com.


Re: ANYONE TO HELP ME ON HOW TO CREATE AN AUTOMATIC NOTIFICATION SYSTEM THAT SENDS A MESSAGE WHENEVER AN OBJECT IS CREATED OR MODIFIED

2023-08-23 Thread ivan harold
https://stackoverflow.com/questions/14543824/django-get-notified-of-all-changes-in-database

check this one out, you might find some hints or answers.

On Tuesday, August 22, 2023 at 9:03:12 AM UTC-5 Byansi Samuel wrote:

> My views 
> from django.shortcuts import render def auto_notification(request): return 
> render (request, "user/dashboard.html")
>
> My models 
> from django.db import models from django.contrib.auth.models import User
>
> #articles model 
>
> class Articles(models.Model): 
> title = models.CharField(max_length=300) date= models.DateField() 
> author=models.ForeignKey(User, on_delete=models.CASCADE) 
> body=models.TextField() 
>
> def __str__(self) -> str:
> return self.title 
>
> #games model
>
> GAME_TYPE=( ("action", "action"), ("adventure", "adventure"), ("racing", 
> "racing"), ("puzzle", "puzzle"), )
>
> MOV_TYPE=( ("action", "action"), ("adventure", "adventure"), ("sci-fi", 
> "sci-fi"), ("horror", "horror"), ("drama", "drama"), ) 
>
> GAME_OS=( ("Windows", "Windows"), ("Android", "Android"), ) 
>
> class Games(models.Model): name=models.CharField(max_length=50) 
> type=models.CharField(max_length=40, choices=GAME_TYPE) 
> os=models.CharField(max_length=15, choices=GAME_OS) img=models.ImageField() 
> developer=models.CharField(max_length=50) 
> version=models.CharField(max_length=10) 
> ratings=models.CharField(max_length=10) description=models.TextField() 
>
> def __str__(self) -> str: 
> return self.name class
>
> Movies(models.Model): name=models.CharField(max_length=50) 
> type=models.CharField(max_length=40, choices=MOV_TYPE) 
> description=models.TextField() released=models.DateField() 
>
> def __str__(self) -> str: 
> return self.name 
>
> I have three models below, but l like to create a Notification System to 
> send a message to a User whenever ; 
> 1. An object is created in all those models 
> 2. An object is modified in all those models 
>
> And l would like to add trick that it sends the Notification Message after 
> 15 minutes of publiction or creation.
>
> And I would like to pass the following data if available in the object ;
> 1. the Name of the Object,
> 2. the Image of the Object, and 
> 3. the type of the Object. 
>
> Lastly I would like to add a : 
> 1. Notification DELETE function, that gives User a way to delete that 
> Message , not to appear in his or notification section again. 
>
> 2. Mark as Read function, that changes the Massage Div Color 
>
> 3. A notification Barge that displays the UNREAD Messages. 
>
> Am requesting anyone to help me Because Am stuck , I have no where to 
> Start from. I will be on waiting your guidelines. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aecadf6d-3bc4-4e9c-a1e7-5b43003ee737n%40googlegroups.com.


Re: Connect::: frontend react and backend django

2023-08-23 Thread ivan harold
check this one out

https://forum.djangoproject.com/t/tutorial-how-to-combine-frontend-and-backend-for-python-web-developers/15214

On Wednesday, August 23, 2023 at 6:50:22 AM UTC-5 Muhammad Juwaini Abdul 
Rahman wrote:

> Please delete this. You just exposed your DB host, name, and password.
>
> On Wed, 23 Aug 2023 at 17:58, Kani Sbt  wrote:
>
>> HI sir , 
>> Please Help me to how to solve this problem , 
>>
>>
>> this is settings.py :
>> import os
>> from pathlib import Path
>> from datetime import timedelta
>>
>> BASE_DIR = Path(__file__).resolve().parent.parent
>>
>>
>> SECRET_KEY = 
>> 'django-insecure-ihofv8tmht)!q**8efqqr1t+#(a$71s080zs^x*s#w5#sx!4'
>>
>> DEBUG = True
>>
>> ALLOWED_HOSTS = ['*']
>>
>>
>> # Application definition
>> THIRD_PARTY_APPS = (
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'rest_framework',
>> 'corsheaders',
>> 'rest_framework.authtoken',
>> 'rest_framework_simplejwt.token_blacklist',
>> 'drf_yasg',
>> 'import_export', # import and export db data
>>
>> 'django_crontab', # periodical task trigger
>> 'dbbackup',  # django-dbbackup
>> 'django_celery_beat',
>> 'django_extensions',
>> # 'storages',
>> # 'gdstorage'
>> 
>> 
>> )
>>
>> OUR_APPS = (
>> 'employee',
>> 'configuration',
>> 'attendance',
>> 'audit',
>> 'master',
>> )
>>
>> INSTALLED_APPS = OUR_APPS + THIRD_PARTY_APPS
>>
>> MIDDLEWARE = [
>> 'server.middleware.UserIpMiddleware',
>> 'django.middleware.security.SecurityMiddleware',
>> 'django.contrib.sessions.middleware.SessionMiddleware',
>> "corsheaders.middleware.CorsMiddleware",
>> 'django.middleware.common.CommonMiddleware',
>> 'django.middleware.csrf.CsrfViewMiddleware',
>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> 'django.contrib.messages.middleware.MessageMiddleware',
>> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> ]
>>
>> ROOT_URLCONF = 'server.urls'
>>
>> TEMPLATES = [
>> {
>> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> 'DIRS': [BASE_DIR / 'templates'],
>> 'APP_DIRS': True,
>> 'OPTIONS': {
>> 'context_processors': [
>> 'django.template.context_processors.debug',
>> 'django.template.context_processors.request',
>> 'django.contrib.auth.context_processors.auth',
>> 'django.contrib.messages.context_processors.messages',
>> ],
>> },
>> },
>> ]
>>
>> # WSGI_APPLICATION = 'server.wsgi.application'
>> ASGI_APPLICATION = 'server.asgi.application'
>>
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': 'sbthrmodule_y0ltln',
>>  'USER': 'sbthrmodule_mmsv7',
>> 'PASSWORD': '17mBxjt6sercIAyw',
>> 'HOST': 'localhost',
>> 'PORT': '3306',
>> },
>> 'attendance_db': {
>> 'ENGINE': 'django.db.backends.mysql',
>> 'NAME': 'skylab',
>> 'USER': 'admin',
>> 'PASSWORD': 'kJsgwek8488!ghf^$%',
>> 'HOST': 'spt-hrm-db.cdhbi944avx7.ap-south-1.rds.amazonaws.com',
>> 'PORT': '3306',
>> },
>> }
>>
>>
>> AUTH_PASSWORD_VALIDATORS = [
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.MinimumLengthValidator',
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.CommonPasswordValidator',
>> },
>> {
>> 'NAME': 
>> 'django.contrib.auth.password_validation.NumericPasswordValidator',
>> },
>> ]
>>
>>
>>
>> LANGUAGE_CODE = 'en-us'
>>
>> TIME_ZONE =  'UTC'
>>
>> USE_I18N = True
>>
>> USE_TZ = True
>>
>>
>>
>> STATIC_URL = '/static/'
>> MEDIA_URL = '/media/'
>> # STATICFILES_DIRS = os.path.join(BASE_DIR, "static"),
>>
>> if DEBUG:
>> STATIC_ROOT = os.path.join(BASE_DIR,'static')
>> MEDIA_ROOT =  os.path.join(BASE_DIR, 'media') 
>> else:
>> STATIC_ROOT = '/var/www/server/static/'
>> MEDIA_ROOT =  '/var/www/server/media/' 
>>
>> DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
>> AUTH_USER_MODEL = 'configuration.User'
>>
>> CORS_ORIGIN_ALLOW_ALL = True
>> CORS_ORIGIN_WHITELIST = (
>> 'http://localhost:3000',
>> 'http://127.0.0.1:3000',
>> 'https://sbthrmodule.in',
>> "https://sbthrmodule.in;,
>> 'http://hrmodule.sbthrmodule.in:8084',
>>'http://hrmodule.sbthrmodule.in:8084',
>> 'http://127.0.0.1:8000',
>> )
>> # CORS_ALLOW_CREDENTIALS = True
>>
>> CSRF_TRUSTED_ORIGINS = ['http://127.0.0.1:8000',"http://localhost:3000;,'
>> https://sbthrmodule.in',
>> "https://sbthrmodule.in;,
>> 'http://hrmodule.sbthrmodule.in/',
>> 

Re: Unable to display records in form

2023-08-23 Thread ivan harold
Maybe this could help you.

https://www.geeksforgeeks.org/django-crud-create-retrieve-update-delete-function-based-views/

On Monday, August 21, 2023 at 2:19:37 PM UTC-5 GLOBAL ENGINEERING ACADEMY 
wrote:

> Hai, 
> I am trying to learn django on my own. I have created a small project of a 
> shop. I am able to insert items but when i try to fetch items for updating 
> / deleting, the form is not populated . only the primary key is shown.
>  def updatedeleteitem(request):
> item=None
> updatedeleteform=None
> if request.method=='POST':
> keysearchform=KeysearchForm(request.POST)
> if keysearchform.is_valid():
> itemcode=keysearchform.cleaned_data['itemcode']
> try:
> item=Item.objects.get(itemcode=itemcode)
> updatedeleteform=UpdatedeleteForm(request.POST, 
> instance=item)
>
> if updatedeleteform.is_valid():
> updatedeleteform.save()
> transaction.commit()
> return redirect('itemlist')
> except Item.DoesNotExist:
> pass
> else:
> keysearchform=KeysearchForm()
> 
> return render(request,'updatedeleteitem.html',
>   {'keysearchform' : keysearchform,
>'updatedeleteform' : updatedeleteform, 'item' : item})
> ___
> class UpdatedeleteForm(forms.ModelForm):
> class Meta:
> model=Item
> fields=['itemcode', 'itemname', 'unitpr', 'qty']
> 
> class KeysearchForm(forms.Form):
> itemcode=forms.CharField(label='item code', max_length=5)
>
>
> These are the view & Forms I am using. Please help.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04afb3db-c300-4267-9c29-d326eab0433fn%40googlegroups.com.


Re: table bank_app_bank has no column named DOB

2023-08-19 Thread ivan harold
https://stackoverflow.com/questions/68269165/why-django-is-not-detecting-my-table-column

Try reading this article, it may help you.

On Saturday, August 19, 2023 at 3:05:57 AM UTC+8 meenu loranz wrote:

> from django.contrib.auth.models import User
> from django.db import models
> from django.urls import reverse
> # Create your models here.
>
> class bank(models.Model):
> name = models.CharField(max_length=255)
> DOB = models.DateField()
> age = models.IntegerField()
> gender = models.CharField(max_length=10)
> phone_no = models.CharField(max_length=10)
> mail_id = models.EmailField(max_length=25)
> address = models.CharField(max_length=255)
> district = models.CharField(max_length=100)
> branch = models.CharField(max_length=100)
> account_type = models.CharField(max_length=100)
> # materials_provided = models.CharField(max_length=100)
>
>
> def __str__(self):
> return self.name
>
> This is my model.py page. And i can see this table and all fields in my 
> database. But while running show me the operational error that no column 
> named DOB. How can i fix this?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1aaf9e41-e11c-43bb-bda9-17b609814059n%40googlegroups.com.


Re: hello forks, i need help

2023-08-17 Thread ivan harold
https://www.w3schools.com/django/django_admin_include_members.php
explore the site maybe what you are ooking for is in there 
check this one. 

On Thursday, August 17, 2023 at 11:53:00 AM UTC-5 Abdoulaye SENE wrote:

> the problem is i don't see users  in admin.i only see groups. do not know 
> why.
>
>
> Le jeu. 17 août 2023 à 16:48, Abdoulaye SENE  a 
> écrit :
>
>> thanks a lot
>>
>>
>> Le jeu. 17 août 2023 à 16:38, ivan harold  a 
>> écrit :
>>
>>> https://www.w3schools.com/django/django_admin_create_user.php 
>>> check this one out.
>>>
>>> On Thursday, August 17, 2023 at 8:26:29 AM UTC-5 Abdoulaye SENE wrote:
>>>
>>>> i have created a group named adminis. how to create users in the group 
>>>> using django admin
>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/78b972b4-dee8-4a69-bc40-fd804f3dc4d3n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/django-users/78b972b4-dee8-4a69-bc40-fd804f3dc4d3n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5a1d8fa0-8eeb-4502-a9dc-b6b3abbfe3f0n%40googlegroups.com.


Re: hello forks, i need help

2023-08-17 Thread ivan harold
https://www.w3schools.com/django/django_admin_create_user.php 
check this one out.

On Thursday, August 17, 2023 at 8:26:29 AM UTC-5 Abdoulaye SENE wrote:

> i have created a group named adminis. how to create users in the group 
> using django admin
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/78b972b4-dee8-4a69-bc40-fd804f3dc4d3n%40googlegroups.com.


Re: Road Map for a newbie

2023-08-17 Thread ivan harold
try learning by going to certain websites that offer to learn, such as 
w3schools.com . 

On Thursday, August 17, 2023 at 10:15:03 AM UTC-5 Tesfaye Yimam wrote:

> Hello all,
>
> This is my second day of learning Django. I am comfortable with python 
> (the basics and the OOP).
> I wanted to have some guidance from this community to learn Djanog by 
> taking small steps in a consistent way. 
> Any one who has a road-map, especially if you tried it and worked for 
> you,  that will greatly help me in the learning process of Django. So, 
> please drop me a message here. 
> I'm happy to be here.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0012d78-357a-4135-81e4-e42fd8a207f7n%40googlegroups.com.


Re: Timezone issue in when storing in DB

2023-08-16 Thread ivan harold
I recommend you reading 
this https://docs.djangoproject.com/en/4.2/topics/i18n/timezones/.

On Wednesday, August 16, 2023 at 12:46:53 PM UTC-5 Madhusudhan Reddy wrote:

> But I am using only fast api for APIs
>
> On Wed, 16 Aug 2023 at 3:45 PM, Ruby  wrote:
>
>> You seem to be reinventing the wheel, Django already has timezone support 
>> when you set USE_TZ 
>>  to 
>> True, 
>> Note that your TIME_ZONE 
>>  
>> would 
>> be the default timezone for your project.
>>
>> With everything set, you can now use .activate() 
>> 
>>  available 
>> in `django.utils.timezone` to get the current time in your preferred 
>> timezone.
>>
>> I hope this answers your question.
>>
>> Best regards
>> Reuben Sunday 
>>
>> On Wed, Aug 16, 2023 at 3:35 AM Madhusudhan Reddy  
>> wrote:
>>
>>> Hi All,
>>>
>>> I am trying to store the date with the timezone. 
>>> for example, my servers are in Mumbai, when my servers are trying to get 
>>> the time of America/Detroit. it is not able to get proper time
>>>
>>> Here is the snippet and details
>>> [image: Screenshot from 2023-08-16 08-00-21.png]
>>> def get_created_at(timezone):
>>> local_tz = pytz.timezone(timezone)
>>> print(datetime.utcnow())
>>> created_at = local_tz.localize(datetime.utcnow()).astimezone(tz=pytz.
>>> timezone(timezone))
>>> return created_at
>>>
>>>
>>> -- 
>>> Best regards,
>>> Madhusudhan
>>> +91 90007 79457 <+91%2090007%2079457>
>>> Gmail | LinkedIn 
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAFwQctLvw9KinV8a%3DVTysi_NSNJfu3rodBoBPCY5Cih_ih-DGQ%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAPUD46vztpvyb8P21vnBf9Wt2d2r6NQ-hgPDD3kyCc%2BpZu3siA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a82a86a8-1ef6-480e-a8dd-5ef65476a78en%40googlegroups.com.


Re: How is Django For Api book

2023-08-16 Thread ivan harold
*William S. **Vincent - REST APIs with Django*

*I second this one this is a good read to boost your knowledge and  
learnings.*

On Tuesday, August 15, 2023 at 4:30:50 PM UTC-5 Roy Lagg wrote:

>
> You could check out *William S. Vincent - REST APIs with Django. *The 
> book is easy to read and has industry-standard tips and guides.
> On Tuesday, August 15, 2023 at 1:59:53 AM UTC+3 abu yahya Diab wrote:
>
>> I have good knowledge in API, you can say beginner knowledge in API.
>> I'm trying to delve deeper in API, when I check the Django For Api book 
>> content, I noticed .that its not that professional book
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4facb3b0-6c39-465d-bb24-18948a44b2c9n%40googlegroups.com.


Re: How to upload a folder in django?

2023-08-16 Thread ivan harold
just make sure to ink the path correctly.
iex: ../page/page1/pag2/ etc..

On Monday, August 14, 2023 at 5:59:54 PM UTC-5 abu yahya Diab wrote:

> Hi guys, I have a task to upload a folder in django.
> So, what is the right way to do that?
> and what if this folder has subfolder and these subfolders have subfolders.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3d1b1ae2-1adc-48c1-9bc1-28baed3573ben%40googlegroups.com.


Re: i learnt django basics but i want to learn django for become a master in django where can i get resourse

2023-08-12 Thread ivan harold
try different approach and then test them you'll earn quickly if you do 
simultaneous task at once.
On Saturday, August 12, 2023 at 11:20:57 AM UTC-5 Obam Olohu wrote:

> YouTube and chatGPT
>
> On Thu, Aug 10, 2023, 6:05 PM Peter Benjamin Ani  
> wrote:
>
>> Try getting the ebook (Django 4 by example) and build projects in it, 
>> from there u are good to go 
>>
>> On Thu, 10 Aug 2023 at 18:01, Basith  wrote:
>>
>>> Any sample projects? any free resources?
>>>
>>> On Thursday, 10 August 2023 at 22:25:30 UTC+5:30 John Ayodele wrote:
>>>
 Build a good portfolio and push them to GitHub

 On Thu, 10 Aug 2023 14:23 Peram Ashokkumar,  
 wrote:

> i have been  learning python fullstack since in the 3 months  in our 
> institute that mentor tought only basic  but i want to get job as 
> experience candidate because i have three years of gap please  any 
> respond 
> to this 
>
> -- 
>
 You received this message because you are subscribed to the Google 
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to django-users...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3d1a0e32-5417-42c9-a2ec-c3caee1e24f7n%40googlegroups.com
>  
> 
> .
>
 -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/ddfe7754-9b56-4664-9154-84d26a51fc53n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAPxt_2XZnUk4cjnS%2BgdxAT6%3DuPsDb3qZqozCYx022ANA7uVpEw%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a9af0a57-e087-4229-8866-f9db8423n%40googlegroups.com.


Re: Django dynamic multiple databases

2023-08-12 Thread ivan harold
you can check this one 
out https://docs.djangoproject.com/en/4.2/topics/db/multi-db/

On Saturday, August 12, 2023 at 9:44:08 AM UTC-5 pankaj palmate wrote:

> I want to creating  saas based application containing one super admin and 
> rest will be customers where each customer will have their own database 
> .want multiple database with dynamic credentials based on request.I want 
> the database to be identified from the subdomain provided.Is this possible 
> using django ? If yes how ? If not what's the option? 
> I did read about the django tenants but it is schema based but I want 
> multiple database approach while creating tenants.(database must be 
> identified from subdomains ) 
>
> Thanks and regards,
> Pankaj palmate 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/25e13400-be07-48da-85f6-a3b9f2d12b78n%40googlegroups.com.


Re: i learnt django basics but i want to learn django for become a master in django where can i get resourse

2023-08-12 Thread ivan harold
there are a lot of free learning website googe them and then learn from 
them do the small activities and try to create small projects.

On Friday, August 11, 2023 at 11:42:03 AM UTC-5 ASAMOAH EMMANUEL wrote:

> Here are premium resources for you: https://t.me/+VXTu7RXQ47VlM2Q0
>
> On Thu, Aug 10, 2023 at 8:36 PM Chisom Iheanacho  
> wrote:
>
>> hello chief..  I have Django 3 by example, can I follow the projects in 
>> it too? 
>> pls can I get your WhatsApp number too? 
>>
>> On Thu, Aug 10, 2023, 6:05 PM Peter Benjamin Ani  
>> wrote:
>>
>>> Try getting the ebook (Django 4 by example) and build projects in it, 
>>> from there u are good to go 
>>>
>>> On Thu, 10 Aug 2023 at 18:01, Basith  wrote:
>>>
 Any sample projects? any free resources?

 On Thursday, 10 August 2023 at 22:25:30 UTC+5:30 John Ayodele wrote:

> Build a good portfolio and push them to GitHub
>
> On Thu, 10 Aug 2023 14:23 Peram Ashokkumar,  
> wrote:
>
>> i have been  learning python fullstack since in the 3 months  in our 
>> institute that mentor tought only basic  but i want to get job as 
>> experience candidate because i have three years of gap please  any 
>> respond 
>> to this 
>>
>> -- 
>>
> You received this message because you are subscribed to the Google 
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3d1a0e32-5417-42c9-a2ec-c3caee1e24f7n%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/ddfe7754-9b56-4664-9154-84d26a51fc53n%40googlegroups.com
  
 
 .

>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAPxt_2XZnUk4cjnS%2BgdxAT6%3DuPsDb3qZqozCYx022ANA7uVpEw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAFX7pJ0zACL%3Dpv9ENfBcGpGDA2UpneP1rMZBRt43mOzHxVHAYA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1b64eb0a-b456-4045-be4c-2a75648302c0n%40googlegroups.com.


Re: CreateView for non default database

2023-08-09 Thread ivan harold
Did you try what  David Nugent suggested? Did it worked?

On Thursday, July 27, 2023 at 6:31:33 PM UTC+8 David Nugent wrote:

> Database Router is the trick for this. Django calls this function to 
> determine which database the transaction will use based on the type of 
> operation requested, so you can separate which database is selected for 
> reads, writes and migrations.
>
> Regards,
> David
>
> On Wed, Jul 26, 2023 at 1:11 PM Muhammad Juwaini Abdul Rahman <
> juw...@gmail.com> wrote:
>
>> Hi all,
>>
>> I have two different databases as below:
>>
>> DATABASES = {
>> 'tvet': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': BASE_DIR / 'db.sqlite3',
>> },
>> 'default': {
>> 'ENGINE': 'django.db.backends.mysql',
>> 'NAME': 'jpk',
>> 'USER': 'jpkuser',
>> 'PASSWORD': 'jpkpassword',
>> 'HOST': 'localhost', # Or an IP Address that your DB is hosted on
>> 'PORT': '3306',
>> }
>> }
>>
>> When I want to create a CreateView, I am unable to save it.
>>
>> This is my CreateView:
>>
>> class BiodataCreateView(CreateView):
>> template_name = 'bio_create.html'
>>
>> # model = Biodata.objects.using('tvet').all()
>> def get_queryset(self):
>> return Biodata.objects.using('tvet').all()
>>
>> fields = 'name', 'hobby'
>>
>> def get_success_url(self):
>> return reverse('biodata-list')
>>
>> Any idea on how to do it?
>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4985efd7-437c-432e-86c8-9a902430513fn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ef988bc0-20e3-4e9b-90e5-b7d1d8abf5b3n%40googlegroups.com.


Re: DAILY,MONTHLY AND ANNUAL REPORTS

2023-08-09 Thread ivan harold
is this thread closed? resolved?


On Saturday, July 22, 2023 at 8:08:48 AM UTC+8 Ryan Nowakowski wrote:

> Check out the Sum() aggregate:
>
> https://docs.djangoproject.com/en/4.2/topics/db/aggregation/
>
>
> On July 21, 2023 12:41:48 PM CDT, Abdou KARAMBIZI  
> wrote:
>
>> Hello Friends,
>>
>> How can I get weekly,Monthly and annual reports? from the following model.
>> I want to get the total amount paid in the week,month and year 
>>
>>
>> class Payments(models.Model):
>> id = models.AutoField(primary_key = True)
>> amount = models.IntegerField()
>> paidon = models.DateField(auto_now=True)
>>
>> def __str__ (self):
>> return self.id
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f84c4fd-0c83-463a-a39f-ff089b233211n%40googlegroups.com.


Re: honest reviews

2023-08-09 Thread ivan harold
Put a little more details on the site and instead of putting a screenshot 
on the my project page you can photoshopped an image to make it look more 
dynamic and enhanced.

On Monday, July 31, 2023 at 9:51:49 PM UTC+8 oluwafemi damilola wrote:

> It'll advice that you add some extra informations to the page, also the 
> image takes at least 5 seconds to load and the icon is tiny on mobiles 
>
> On Mon, 31 Jul 2023, 14:48 marvelous,  wrote:
>
>> Oh ok then I will put that into consideration thank you very much
>>
>>  
>>
>> Sent from Mail  for 
>> Windows
>>
>>  
>>
>> *From: *Ogunlade Stephen Olayide
>> *Sent: *Monday, July 31, 2023 2:11 PM
>> *To: *django...@googlegroups.com
>> *Subject: *Re:
>>
>>  
>>
>> I will prefer you make the About page the home/landing page
>>
>>  
>>
>> On Mon, Jul 31, 2023 at 2:00 PM marvelous  wrote:
>>
>>  
>>
>> Hello guys I just finished building out my portfolio and I would 
>> appreciate if you give me your honest reviews heres the link 
>>
>>  
>>
>> https://marvel-9gdg.onrender.com/
>>
>>  
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/D11D5F79-FE3E-43CC-B82F-FA665B0E4414%40hxcore.ol
>>  
>> 
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CANyXpooYQoA2tuytkCFUj1KEpeZOfF5Gcc37cVWHY2eTgHV45w%40mail.gmail.com
>>  
>> 
>> .
>>
>>  
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3FA1C223-C03A-483B-9604-9A682730D0C4%40hxcore.ol
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05d29578-475d-495d-85a9-dec5568cee72n%40googlegroups.com.


Re: Post multiple data

2023-08-09 Thread ivan harold
maybe this will help 

" from django.conf import settings 
 class Design(models.Model): 
 human_readable_id = models.CharField(max_length=10, default=id_generator, 
db_index=True) 
 manager = models.CharField(max_length=40) 
 worker = models.ForeignKey( 
 settings.AUTH_USER_MODEL, 
 on_delete=models.CASCADE, 
*to_field='username'* ) "

On Wednesday, August 9, 2023 at 6:11:59 AM UTC+8 Hendry Revenus wrote:

> Thank you 
>
> On Tue, 8 Aug 2023, 14:57 Prashanth Patelc,  wrote:
>
>> I'm not able to send multiple data in front -end .
>>
>> On Tue, Aug 8, 2023, 5:21 PM Mz Gz  wrote:
>>
>>> Check the object sent from frontend using developer tools in browser.
>>>
>>> If the object is sent correctly to backend.
>>>
>>> Just access is from POST dict
>>>
>>> On Tue, 8 Aug 2023, 1:19 pm Prashanth Patelc,  
>>> wrote:
>>>
 Hi all, 

 I'm sending multiple rows data through html but I'm unable to save data 
 in django I'm not receiving proper data.how to send multiple shifts names 
 and times through ajax or html in django.

 I'm adding multiple shift name and in-time out-time .

 Please find the attached screenshot 

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/CAMCU6CqWJme8fg-JuZJ%2BQnTBk63_f4%3DZMYTO7GFnRChOMt1teQ%40mail.gmail.com
  
 
 .

>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAHV4E-fOikH7dWcJYkjyOQobj57%2BJ5Zef0y3PzfsoJN0gVgEhQ%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAMCU6CrNoyoRykrSmABgwWwpWL5o-bhqpcMpL4YPj-v%3D%2BsA0tA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7974823-dfa3-4a36-9c15-1ea91ba875dan%40googlegroups.com.


Re: Logout time

2023-08-09 Thread ivan harold
Maybe this will help, check out this code.

def login (): login_time = time.time() def logout (): logout_time = 
time.time() #To get the number of seconds the user spent on the platform, 
#subtract 
login_time from logout_time

On Monday, July 31, 2023 at 6:12:23 PM UTC+8 Prashanth Patelc wrote:

> Thank you all.
>
>  Thank you # madhusudan (I got on idea through you shared the code)
>
> On Fri, Jul 28, 2023, 8:16 PM Madhusudhan Reddy  
> wrote:
>
>> To get Logout time based on login time,
>>
>> login time = some thing
>>
>> logout time = login time + 8 hours
>>
>> use datetime timedelta module in python, 
>>
>> >>> CODE <<<
>> from datetime import datetime, timedelta
>> login_time = datetime.now()
>> logout_time = login_time + timedelta(hours=8)
>> >>> CODE <<<
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Fri, 28 Jul 2023 at 20:05, Prashanth Patelc  
>> wrote:
>>
>>> Hi all,
>>>
>>> How to get logout time based on login time in python?
>>>
>>> I'm storing hour in one column
>>> Eg ; hour
>>> 8
>>> Based on 8 Calculate logout time
>>>
>>> My login time 10:00:00
>>>
>>> I need 6: 00:00 (based 8)
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/CAMCU6Cpe32Pcs5PAmbx8LDcJzqqPwuhJVzrz%2B%3D67-tEMBychOw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Best regards,
>> Madhusudhan
>> +91 90007 79457 <+91%2090007%2079457>
>> Gmail | LinkedIn 
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAFwQctLwNxagOX-QKVUdp58gk4px0M_qftqU3rnHayGaJ9BjAw%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c727f577-f89c-4a28-bef9-072093667f41n%40googlegroups.com.


Re: APP DEPLOYMENT

2023-08-09 Thread ivan harold
Maybe this will help.
https://docs.djangoproject.com/

On Sunday, August 6, 2023 at 5:09:29 AM UTC+8 Dennis Kinanga wrote:

> Someone to give me instructions on how to go about it please 
>
> On Aug 6, 2023 00:07, "John McClain"  wrote:
>
> Heroku is easy to implement and offers free tier
>
> On Thu 20 Jul 2023 at 10:57, Abdou KARAMBIZI  wrote:
>
>>
>> Hello friends,
>>
>>
>> I want to know where I can upload my django projects for the reason of 
>> showing them as my technical experience.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CABnE44xYg2JqtHVUHMkBkpS81jmQyqfehid3q-%2BnEJe532mrhA%40mail.gmail.com
>>  
>> 
>> .
>>
> -- 
> John McClain
>
> Cell: 085-1977-823
> Skype: jmcclain0129
> Email: jmccla...@gmail.com
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAN-hv_qV59Y_pKbGZzccO3AjKsH0hM1vZtE4fj2U0nK6yc_XWQ%40mail.gmail.com
>  
> 
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4783de91-6ed9-42dc-997d-9e009cf9b9ecn%40googlegroups.com.


Re: Django context to React component

2020-08-03 Thread jose ivan perez diaz
Thanks for your advice 

Sent from my iPhone

> On 3/08/2020, at 4:07 AM, Yemin Sajid  wrote:
> 
> 
> On idea could be serializing the context and setting as in a global `var` in 
> javascript code in the templates. Then you should be able to access those in 
> from React code.
> But tbh, I would not recommend that. This type of integration may create 
> unnecessary complexities.
> 
> Better to work with the API workflow.
> 
>> On Sunday, August 2, 2020 at 11:02:10 PM UTC+6, jose ivan perez diaz wrote:
>> Hi Everyone, 
>> Where can I found a guide to combine django and React? I mean, what I want 
>> is passing the context to a React component, any clue?, I know that is 
>> possible combine them throw django rest framework through an API, but is it 
>> possible work with the context from django in React, thaks for your help.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/b5113d31-9279-4670-a731-071633ff0cf2o%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/FD9346B8-51AB-4A7E-B0C8-72C837F27A0C%40gmail.com.


Django context to React component

2020-08-02 Thread jose ivan perez diaz
Hi Everyone,
Where can I found a guide to combine django and React? I mean, what I want is 
passing the context to a React component, any clue?, I know that is possible 
combine them throw django rest framework through an API, but is it possible 
work with the context from django in React, thaks for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2733197f-1851-44a3-9a03-b585551ab6a6o%40googlegroups.com.


Re: My first django website

2019-10-06 Thread Ivan Kasvan
Hi,
This is cool. I tried it and loved it.
I will also try doing the same.

Regards.

On Sun, 6 Oct 2019 at 03:15, Ehab Al-Qabbani  wrote:

> https://my-private-blog.herokuapp.com/
>
> Please try it
>
>
>
> Warmest Regards,
> Ehab
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/DB7PR07MB388428ECD7DB6A10C8221A41AB980%40DB7PR07MB3884.eurprd07.prod.outlook.com
> 
> .
>


-- 

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB8EzMHSvZVKy1JxgOLgD732hon8bbBnZSo_2r%2Bc_jafgLS54A%40mail.gmail.com.


Query on 2 non related models

2019-05-20 Thread Ivan Martić
Hi guys, hope you can help me. 
I have 2 models and i want to make a count query on them. I need a count on 
how many articles i have in every category.

Models:
class Vendors(models.Model):
id = models.AutoField(db_column='id', primary_key=True, blank=False, 
unique=True)
name = models.CharField(db_column='name', max_length=150, blank=True, 
null=True)
groupid = models.IntegerField(db_column='groupid', blank=True, 
null=True)


class VendorGroup(models.Model):
id = models.AutoField(db_column='ID', primary_key=True, null=False, 
max_length=255, blank=True)
vendor_group = models.CharField(db_column='Vendor Group', 
max_length=255, blank=True, null=True)

view:
def vendorsgrouping_view(request):
list_vendor = VendorGroup.objects.all().order_by('vendor_group')

context = {
'lista_vendora':lista_vendora, 
}
return render(request, "templates/vendorgroup.html", context)

I have list of vendors listed in template:
{% for item in lista_vendora %}
{{ item.vendor_group }}
{% endfor %}

Prefetch, annotate, select related dont work since they are not connected. 
I know it is easier to give foreign key to fields but what about this?

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f0413341-91b2-4308-afd5-ae486b09a71e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Passing values

2019-02-13 Thread Ivan Martić
In first page(form), i want to search for vendor. Afterwords when i click
on one we go into another page. On this page we have performance form where
we need to give ratings from 1 to 5 for that particular vendor.
So when I rate all the fields and press save, i want to store all rating
data in sql together with vendor name, timestamp and username who saved tha
data.

That was all working fine in for loop(except vendor part, needed to enter
data in input field myself), but when i divide performance form into
separate fields in HTML all crashed. Please see txt enclosed.
Thank you for your response.


sri, 13. velj 2019. u 11:48 Mohammad Etemaddar 
napisao je:

> Dear Ivan,
> If I get you right, You have a page with form, and you want to post it to
> another page. so, fill the "action" part of html form with the second
> page's url.
>
> Also the timezone.now is allways available in any python file you are
> working on it, and also request and request.user
>
> What do you want to do exactly?
>
> On Wednesday, February 13, 2019 at 1:45:46 PM UTC+3:30, Ivan Martić wrote:
>>
>> Hi all,
>>
>> where can i find more info regarding passing values in views/forms/url.
>> What I need is to pass value from form in previous url page to the form
>> in next url page(also prefilling with data like timezone.now, request,user)
>>
>> Thank you in advance.
>> Ivan
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5eb3df26-ae0d-44c7-8f4b-e7b0b6e5e01e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5eb3df26-ae0d-44c7-8f4b-e7b0b6e5e01e%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C_HtQsH7%3Dq0%3D4vYtRHN%3D5RKO0qhNow%3Degosk0RLfbdUSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
from __future__ import unicode_literals
from django.db import models, connection
from django.utils import timezone
from datetime import date
from django.forms import widgets


GRADE_CHOICES = (
('1', 'Excellent'),
('2', 'Very good'),
('3', 'Good'),
('4', 'Adequate'),
('5', 'Poor')
)


class Performance(models.Model):
id = models.AutoField(db_column='ID', primary_key=True, blank=False, 
unique=True)
supplier_name = models.CharField(db_column='Supplier name',max_length=9, 
blank=True, null=True)
deliverability = models.CharField(db_column='Deliverability', max_length=1, 
blank=True, null=True, choices=GRADE_CHOICES)
goodwill = models.CharField(db_column='Goodwill', blank=True, max_length=1, 
null=True, choices=GRADE_CHOICES)
certification = models.CharField(db_column='Certification', max_length=1, 
blank=True, null=True, choices=GRADE_CHOICES)

compliance_with_spec_field = models.CharField(db_column='Compliance with 
spec#', max_length=1, blank=True, null=True, choices=GRADE_CHOICES)
quality_of_the_delivery = models.CharField(db_column='Quality of the 
Delivery', max_length=1, blank=True, null=True, choices=GRADE_CHOICES)
quantity_reliability = models.CharField(db_column='Quantity reliability', 
max_length=1, blank=True, null=True, choices=GRADE_CHOICES)
fulfilment_of_deadlines = models.CharField(db_column='Fulfilment of 
deadlines', max_length=1, blank=True, null=True, choices=GRADE_CHOICES)

reaction_time = models.CharField(db_column='Reaction time', max_length=1, 
blank=True, null=True, choices=GRADE_CHOICES)
flexibilty = models.CharField(db_column='Flexibilty', max_length=1, 
blank=True, null=True, choices=GRADE_CHOICES)
economical_offer = models.CharField(db_column='Economical offer', 
max_length=1, blank=True, null=True, choices=GRADE_CHOICES)
price_performance_ratio = models.CharField(db_column='Price-performance 
ratio', max_length=1, blank=True, null=True, choices=GRADE_CHOICES)

credit = models.CharField(db_column='Credit', max_length=1, blank=True, 
null=True, choices=GRADE_CHOICES)
rating = models.CharField(db_colu

Passing values

2019-02-13 Thread Ivan Martić
Hi all,

where can i find more info regarding passing values in views/forms/url.
What I need is to pass value from form in previous url page to the form in 
next url page(also prefilling with data like timezone.now, request,user)

Thank you in advance.
Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53f99288-1b18-4c4a-8a1a-92b465519d87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The database driver doesn't support modern datatime types.

2019-02-11 Thread Ivan Martić
resolved.

Microsoft ODBC driver was missing, download it from MS official web page 
and all is working perfect now

On Monday, February 11, 2019 at 11:21:37 AM UTC+1, Ivan Martić wrote:
>
> Hi all, 
>
> I am migrating to from development to prod server and getting this error 
> app.
>
> Error started to show after installation of allauth library.
> I cant find anything on google related to this topic so I hope you can 
> help me out.
>
> Traceback is saying:
> Exception Type: ImproperlyConfigured at /accounts/login/
> Exception Value: The database driver doesn't support modern datatime types.
>
> DB is MSSQL and I should have all neccesery installation because it worked 
> previously (on local server - pyodbc, azure...)
>
> Thank you in advance
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f46f35b0-0dcf-4355-bc40-64f5463465d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


The database driver doesn't support modern datatime types.

2019-02-11 Thread Ivan Martić
Hi all, 

I am migrating to from development to prod server and getting this error 
app.

Error started to show after installation of allauth library.
I cant find anything on google related to this topic so I hope you can help 
me out.

Traceback is saying:
Exception Type: ImproperlyConfigured at /accounts/login/
Exception Value: The database driver doesn't support modern datatime types.

DB is MSSQL and I should have all neccesery installation because it worked 
previously (on local server - pyodbc, azure...)

Thank you in advance


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7a36a458-7a3e-446a-b224-a5b2d4cd0ff8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at - Reverse with arguments '('',)' not found

2019-02-07 Thread Ivan Martić
Problem solved, I had a null value in the db so listing couldnt work..

On Monday, February 4, 2019 at 6:59:09 PM UTC+1, B.navya spoorthi Sweety 
wrote:
>
> hi all , 
> i just started with django. i am following this document
> https://docs.djangoproject.com/en/2.1/intro/tutorial01/ 
> here database used is sqlite. but i want to try out  django+mongodb
> what all changes i can made so that django uses mongodb database 
> where should i create database and use with django.
>
> i knew Regular Mongo Db operations 
>
> but not able to do from Django 
>
>
> thanks in advance.
> waiting for a reply
>
> On Mon, Feb 4, 2019 at 5:18 PM Ivan Martić  > wrote:
>
>> Hi all,
>>
>> I need help.
>> I keep getting this issue, NoReverseMatch at /
>> Reverse for 'productsgrouping-update' with arguments '('',)' not found. 1 
>> pattern(s) tried: ['update/(?P[0-9]+)/$']
>>
>> not sure what am doing wrong. Any time I put url tag {% url 
>> 'productsgrouping-update' lista.id%} in html i get the error.
>> Both url work as stand alone,* /index* and */index/update/1/* but when i 
>> put url tag all hell break loose.. I strugling for a week now. Thank you 
>> all in advance.
>>
>> **
>> from django.shortcuts import render, redirect
>> from django.http import HttpResponse
>> from .models import Material4, MaterialGroup
>> from django.db import connection
>> from .forms import ProductgroupinputForm, MaterialGroupForm
>> from django.conf import settings
>>
>> def productsView(request):
>> lista = MaterialGroup.objects.all() 
>> #text5 = MaterialGroup.objects.get(id=url_id)
>> #return redirect(reverse('productsgrouping_update', kwargs=('id':url_id)))
>> return render(request, "productsgroup.html", {"lista" : lista})
>>
>> def productsUpdateView(request, url_id):
>> text5 = MaterialGroup.objects.get(id=url_id)
>> form5 = ProductgroupinputForm(request.POST or None, instance=text5)
>>
>> context1 = {'text5': text5,'form5': form5}
>>
>> if form5.is_valid():
>> form5.save()
>> return render(request, 'productsgroup-update.html', context1)
>>
>> **
>> from django.urls import path
>> from . import views
>>
>> urlpatterns = [
>> path('', views.productsView, name='productsgrouping'),
>> path('update//', views.productsUpdateView, 
>> name='productsgrouping-update'),
>> ]
>>
>> **
>> from django.contrib import admin
>> from django.urls import path, include
>> from django.contrib.staticfiles.urls import staticfiles_urlpatterns
>>
>> urlpatterns = [
>> path('admin/', admin.site.urls),
>> path('', include('product.urls')),
>> ]
>>
>>
>> **
>> from __future__ import unicode_literals
>> from django.db import models, connection
>> from django.utils import timezone
>> from datetime import date
>> from django.urls import reverse
>>
>> class Material4(models.Model):
>> id = models.IntegerField(db_column='ID', primary_key=True, 
>> blank=False, unique=True)
>> bukrs = models.CharField(db_column='BUKRS', max_length=3)
>> materialid = models.CharField(db_column='MaterialID', max_length=50)
>> maktx = models.CharField(db_column='MAKTX', max_length=150)
>> input_group = models.IntegerField(db_column='Input_group')
>>
>> class Meta:
>> managed = False
>> db_table = 'Material4'
>>
>> def __str__(self):
>> return '%s %s %s %s' % (self.id, self.materialid, self.maktx, 
>> self.input_group)
>>
>>
>> **
>> from django import forms
>> from .models import Material4, MaterialGroup
>>
>> class ProductgroupinputForm(forms.ModelForm):
>>
>> class Meta:
>> model = Material4
>> fields = ['materialid', 'input_group', 'id', 'input_group']
>>
>> class MaterialGroupForm(forms.ModelForm):
>>
>> class Meta:
>> model = MaterialGroup
>> fields = ['material_group', 'id']
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0f15b6d

NoReverseMatch at - Reverse with arguments '('',)' not found

2019-02-04 Thread Ivan Martić
Hi all,

I need help.
I keep getting this issue, NoReverseMatch at /
Reverse for 'productsgrouping-update' with arguments '('',)' not found. 1 
pattern(s) tried: ['update/(?P[0-9]+)/$']

not sure what am doing wrong. Any time I put url tag {% url 
'productsgrouping-update' lista.id%} in html i get the error.
Both url work as stand alone,* /index* and */index/update/1/* but when i 
put url tag all hell break loose.. I strugling for a week now. Thank you 
all in advance.

**
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Material4, MaterialGroup
from django.db import connection
from .forms import ProductgroupinputForm, MaterialGroupForm
from django.conf import settings

def productsView(request):
lista = MaterialGroup.objects.all() 
#text5 = MaterialGroup.objects.get(id=url_id)
#return redirect(reverse('productsgrouping_update', kwargs=('id':url_id)))
return render(request, "productsgroup.html", {"lista" : lista})

def productsUpdateView(request, url_id):
text5 = MaterialGroup.objects.get(id=url_id)
form5 = ProductgroupinputForm(request.POST or None, instance=text5)

context1 = {'text5': text5,'form5': form5}

if form5.is_valid():
form5.save()
return render(request, 'productsgroup-update.html', context1)

**
from django.urls import path
from . import views

urlpatterns = [
path('', views.productsView, name='productsgrouping'),
path('update//', views.productsUpdateView, 
name='productsgrouping-update'),
]

**
from django.contrib import admin
from django.urls import path, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('product.urls')),
]


**
from __future__ import unicode_literals
from django.db import models, connection
from django.utils import timezone
from datetime import date
from django.urls import reverse

class Material4(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True, blank=False, 
unique=True)
bukrs = models.CharField(db_column='BUKRS', max_length=3)
materialid = models.CharField(db_column='MaterialID', max_length=50)
maktx = models.CharField(db_column='MAKTX', max_length=150)
input_group = models.IntegerField(db_column='Input_group')

class Meta:
managed = False
db_table = 'Material4'

def __str__(self):
return '%s %s %s %s' % (self.id, self.materialid, self.maktx, 
self.input_group)


**
from django import forms
from .models import Material4, MaterialGroup

class ProductgroupinputForm(forms.ModelForm):

class Meta:
model = Material4
fields = ['materialid', 'input_group', 'id', 'input_group']

class MaterialGroupForm(forms.ModelForm):

class Meta:
model = MaterialGroup
fields = ['material_group', 'id']


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0f15b6d9-4dec-4ef9-b79a-643fc37a8781%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Passing pk arguments from a URL into another view

2019-02-04 Thread Ivan Martić
Can you elaborate a bit, i have the same issue with noreverse error

ned, 3. velj 2019. u 15:08 poOya mOsaddegh 
napisao je:

> Hi
> You may use include in urls.py
>
> urlpatterns = [
> path('', views.club_home, name='club_home'),
> path('/', include(club_home_urls, namespace='club_home')),
> ]
>
>
>
> On Sat, Feb 2, 2019 at 8:20 PM GavinB841  wrote:
>
>> *Hi all,*
>>
>> *I am having issues using arguments from a URL in another view, I have
>> reached out on stackover flow with no success, i believe i am wording this
>> question poorly.*
>>
>> *To quickly explain *
>>
>>- *I have a main site which shows a list of sports clubs. When the
>>user selects on one it renders that specific club home page using the PK
>>passed in the template.*
>>- *Once I get to this home page
>>e.g. http://127.0.0.1:8000/club_home/2/
>>  .  I have many sub-pages which a 
>> user
>>can select but I have no idea how I can use that same PK to filter data in
>>the other pages to only show details based on that club.*
>>- *I would also like to include that PK in the rest of the URLs.
>>e.g. http://127.0.0.1:8000/club_home/2/teams/
>>*
>>
>>
>> *Code:*
>>
>> *index.html:*
>>
>> Our Clubs
>> {% for club in all_clubs %}
>> 
>> {{ club.club_name }}
>> 
>>   {% endfor %}
>>
>>
>> *urls.py*
>>
>> I understand I must include the / before teams in the URL but
>> I am unsure how to pass in that argument
>>
>> urlpatterns = [
>> path('', views.club_home, name='club_home'),
>> path('/', views.club_home, name='club_home_with_pk'),
>> path('teams/', views.TeamInfo.as_view(), name='teams'),
>> ]
>>
>>
>>
>>
>>
>> *views.py *
>>
>>
>>
>> def club_home(request, pk=None):
>> if pk:
>> club = ClubInfo.objects.filter(pk=pk)
>> club_posts = ClubPosts.objects.filter(club_id=club[0])
>> elif request.user.is_authenticated:
>> club = ClubInfo.objects.filter(user=request.user)
>> club_posts = ClubPosts.objects.filter(club_id=club[0])
>> # photo = model.club_logo.ImageField(storage=profile_pics)
>> args = {'club': club,
>> 'club_posts': club_posts
>> }
>> return render(request, 'club_home_page.html', args)
>>
>>
>>
>> class TeamInfo(APIView):
>> renderer_classes = [TemplateHTMLRenderer]
>> template_name = 'teams.html'
>>
>> def get(self, request):
>> serializer = TeamSerializer()
>> user = ClubInfo.objects.filter(user=request.user).first()
>> teams = Team.objects.filter(club_id=user.pk)
>> return Response({'serializer': serializer,
>>  'teams': teams,
>>  })
>>
>>
>>
>> *club_main_page.html*
>>
>>
>> navbar on club home page to get to other pages, I know I need to include 
>>  into the **URL and** I need to pass this argument into the href of this 
>> URL but as need to figure out the view before adding this 
>>
>>
>>
>> Team
>>
>>
>>
>> *Any idea what I need to add into the view to allow for this. I would really 
>> appreciate any help as I've been stuck on this for weeks now. *
>>
>>
>> *Thanks *
>>
>>
>> *Gavin*
>>
>>
>>
>> *Séanadh Ríomhphoist/Email DisclaimerTá an ríomhphost seo agus aon
>> chomhad a sheoltar leis faoi rún agus is lena úsáid ag an seolaí agus sin
>> amháin é. Is féidir tuilleadh a léamh anseo.
>> 
>> This e-mail and any
>> files transmitted with it are confidential and are intended solely for use
>> by the addressee. Read more here.
>>  *
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/3465a2fc-347a-4096-b037-83be9b57d8a2%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-02-01 Thread Ivan Martić
i think i found the issue, problem was in the html url tag..
i should look like this
href="{ url 'update_group' list_all.url_id }">

not like this
href="{ url 'update_group' item.id }">

thank you all

pet, 1. velj 2019. u 09:26 Ivan Martić  napisao je:

> Hi guys, any help on this matter? i still have noreverse issue. There is
> something wrong with my url nameing
>
> sri, 30. sij 2019. u 10:55 Ivan Martić  napisao je:
>
>> Bok Nebojša, jel možeš uletit i pogledati molim te što radim krivo.
>>>>
>>>> Znači, imam 2 aplikacije, prva abc radi a druga product groups ne radi..
>>>> Sve je kopirano u 2 privitka.
>>>>
>>>> Da li imaš vremena pogledati pliz?
>>>>
>>> Šta god napravim, No reverse mi se javlja...
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C8vxGNnJ1N8cJ%3D1nsuAD306TY9s46TuObJs-%2BsvnVP0eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-02-01 Thread Ivan Martić
Hi guys, any help on this matter? i still have noreverse issue. There is
something wrong with my url nameing

sri, 30. sij 2019. u 10:55 Ivan Martić  napisao je:

> Bok Nebojša, jel možeš uletit i pogledati molim te što radim krivo.
>>>
>>> Znači, imam 2 aplikacije, prva abc radi a druga product groups ne radi..
>>> Sve je kopirano u 2 privitka.
>>>
>>> Da li imaš vremena pogledati pliz?
>>>
>> Šta god napravim, No reverse mi se javlja...
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C_5O6w3sL7dZJJqFGkKz1rK_7sqor%3DpvEeEz5iXR2EYXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django channels daphne static files

2019-01-31 Thread Ivan M
I'm on the latest Django 2.1.5, channels 2.1.6, daphne 2.2.4

Trying to get the static file to route through daphne.  I've tried using 
the default 'AsgiHandler' and tried both 'StaticFilesHandler' and 
'StaticFilesWrapper'.  Here's my settings.py, routing.py setup and output:

My code works using 'python manage.py runserver'

import os

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

--


from django.conf.urls import url

from channels.http import AsgiHandler
from channels.routing import ProtocolTypeRouter, URLRouter

application = ProtocolTypeRouter({
# Channels will do this for you automatically. It's included here as an 
example.
"http": URLRouter([
# AsgiHandler is "the rest of Django" - send things here to have 
Django
# views handle them.
url(r"^", AsgiHandler),
]),
})



--

from django.conf.urls import url

from channels.staticfiles import StaticFilesHandler
from channels.routing import ProtocolTypeRouter, URLRouter

application = ProtocolTypeRouter({
# Channels will do this for you automatically. It's included here as an 
example.
"http": URLRouter([
# AsgiHandler is "the rest of Django" - send things here to have 
Django
# views handle them.
url(r"^", StaticFilesHandler),
]),
})

2019-01-31 10:31:57,386 ERRORException inside application: 
'static_base_url'
  File "c:\python37\lib\site-packages\channels\http.py", line 202, in 
__call__
await self.handle(body)
  File "c:\python37\lib\site-packages\asgiref\sync.py", line 108, in 
__call__
return await asyncio.wait_for(future, timeout=None)
  File "C:\Python37\Lib\asyncio\tasks.py", line 388, in wait_for
return await fut
  File "C:\Python37\Lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
  File "c:\python37\lib\site-packages\asgiref\sync.py", line 123, in 
thread_handler
return self.func(*args, **kwargs)
  File "c:\python37\lib\site-packages\channels\http.py", line 233, in handle
response = self.get_response(request)
  File "c:\python37\lib\site-packages\channels\staticfiles.py", line 68, in 
get_response
return self.serve(request)
  File "c:\python37\lib\site-packages\channels\staticfiles.py", line 60, in 
serve
return serve(request, self.file_path(request.path), insecure=True)
  File "c:\python37\lib\site-packages\channels\staticfiles.py", line 53, in 
file_path
relative_url = url[len(self.scope["static_base_url"][2]) :]
  'static_base_url'


-

from django.conf.urls import url

from channels.staticfiles import StaticFilesWrapper
from channels.routing import ProtocolTypeRouter, URLRouter

application = ProtocolTypeRouter({
# Channels will do this for you automatically. It's included here as an 
example.
"http": URLRouter([
# AsgiHandler is "the rest of Django" - send things here to have 
Django
# views handle them.
url(r"^", StaticFilesWrapper),
]),
})

2019-01-31 10:36:28,617 ERRORTraceback (most recent call last):
  File "c:\python37\lib\site-packages\daphne\http_protocol.py", line 179, 
in process
"server": self.server_addr,
TypeError: __call__() got an unexpected keyword argument 'receive'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3020c698-4cb3-4a29-8b65-d6f1e833aa9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-30 Thread Ivan Martić
>
> Bok Nebojša, jel možeš uletit i pogledati molim te što radim krivo.
>>
>> Znači, imam 2 aplikacije, prva abc radi a druga product groups ne radi..
>> Sve je kopirano u 2 privitka.
>>
>> Da li imaš vremena pogledati pliz?
>>
> Šta god napravim, No reverse mi se javlja...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C8%2BhPxKUsLah%3D%3DtOrn8ro8-DgA3GFhy8%2Bz99kF4r80tog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
app 1
view:
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import AbcClassification
from django.db import connection
from .forms import AbcForm
from django.core.mail import send_mail
from django.conf import settings
from django.core.mail import send_mail
from django.contrib import messages
import time
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import user_passes_test, login_required

def check_user(user):
if user.groups.filter(name='abc_all').count() == 1:
return True
return False

@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def abc_view(request):
queryset = AbcClassification.objects.all()
context = {
"lista" : queryset,
}
return render(request, "qif/abc.html", context)

@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def abc_update_view(request, url_id):
abc_lista = AbcClassification.objects.get(id=url_id)
abc_url_id = AbcForm(request.POST or None, instance=abc_lista)
context1 = {'abc_url_id': abc_url_id, 'abc_lista': abc_lista}

if abc_url_id.is_valid():
abc_url_id.save()
messages.success(request, 'Your entry has been saved. Relevant 
persons will be informed of this change.')
return render(request, 'qif/abc-update.html', context1)

url:
from django.urls import path
from . import views


urlpatterns = [
path('', views.abc_view, name='abc'),
path('update//', views.abc_update_view, name='update_abc'),
]


model:
from __future__ import unicode_literals
from django.db import models, connection
from django.utils import timezone
from simple_history.models import HistoricalRecords
from django.contrib.auth.models import User




class AbcClassification(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True)
class_field = models.CharField(db_column='Class', max_length=1)
value = models.SmallIntegerField(db_column='Value')

history = HistoricalRecords()


class Meta:
managed = False
db_table = 'ABC_Classification'

def __str__(self):
return '%s %s' % (self.class_field, self.value, self.id)


app2

view:
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import Material4, MaterialGroup
from django.db import connection
from .forms import ProductgroupinputForm, MaterialGroupForm
from django.core.mail import send_mail
from django.conf import settings
from django.core.mail import send_mail
from django.contrib import messages
from django.db.models import Q
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import user_passes_test, login_required
from django.shortcuts import get_object_or_404

def check_user(user):
if user.groups.filter(name='productsgrouping_all').count() == 1:
return True
return False


#novi views
@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def productsgrouping_view(request):
queryset = MaterialGroup.objects.all()
#not_assigned = 
Material4.objects.filter(input_group__isnull=True).count()
context = {
"lista" : queryset, 
#"not_assigned":not_assigned
}

return render(request, 'qif/productsgrouping/productsgroup.html', 
context)

@login_required(login_url='/accounts/login/')
@user_passes_test(check_user, login_url='/denied')

def productsgrouping_update_view(request, url_id):
#assigned = get_object_or_404(id=url_id)
assigned = Material4.objects.filter(input_group=url_id)
not_assigned = None
search = request.GET.get("search", None)

if search:
not_assigned = 
Material4.objects.filter(Q(materialid__icontains=search) | 
Q(maktx__icontains=search))


product_lista = MaterialGroup.objects.get(id=url_id)
#product_lista = get_object_or_404(MaterialGroup, 

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
ok, pokušat ću. ak neuspijem posaljem ti sta god ti treba da pokusas sam
rekreirati...ovo je zaista zeznuto

uto, 29. sij 2019. u 13:56 Nebojsa Hajdukovic 
napisao je:

> To je greška zato što ne može da nađe url_id ajd ako ne uspeš pogledaću
> večeras detaljno šta si radio pa da vidim gde je greška
>
> уто, 29. јан 2019. у 13:51 Ivan Martić  је
> написао/ла:
>
>> napravio sam točno kako si rekao i dalje nece, isti error ...vec danima
>> se mucim sa ovime..nešto drugo je posrijedi.
>>
>>
>>
>>
>>
>> uto, 29. sij 2019. u 12:16 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> neće raditi ali ne zbog html već zbog greške u views
>>> probaj ovako
>>>
>>> def productsgrouping_update_view(request, url_id):
>>> assigned = get_object_or_404(Material, pk=url_id)
>>>
>>>
>>> naravno prvo moraš da importuješ get object or 404:
>>>
>>> from django.shortcuts import get_object_or_404
>>>
>>>
>>> уто, 29. јан 2019. у 12:00 Ivan Martić  је
>>> написао/ла:
>>>
>>>> Bok Nebojša,
>>>>
>>>> mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
>>>> jednom trenu je puknula veza. Neznam točno kada.
>>>> Znači, da odem na url *productsgrouping *prikaze sve grupe, kad
>>>> kliknem na grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u
>>>> url dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
>>>> nastavi sve kako treba.
>>>> Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku
>>>>
>>>> hvala ti za pomoć
>>>>
>>>>
>>>> uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic <
>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>
>>>>> A što ne uradiš update preko class based view daleko je lakše?
>>>>>
>>>>> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>>>>>
>>>>> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
>>>>> def productsgrouping_update_view(request, url_id):
>>>>> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>>>>>
>>>>>
>>>>> уто, 29. јан 2019. у 10:20 Ivan Martić  је
>>>>> написао/ла:
>>>>>
>>>>>> not sure what to say
>>>>>>
>>>>>> čet, 24. sij 2019. u 13:53 Ivan Martić 
>>>>>> napisao je:
>>>>>>
>>>>>>> Hi  Andréas,
>>>>>>> sorry for misspeling in codes. All is working ok except when i try
>>>>>>> to put url tag for 'update_productsgrouping'.
>>>>>>> I need to update group with new products but It does not argument
>>>>>>> for group id.
>>>>>>> What do you think i am doing wrong...?
>>>>>>>
>>>>>>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>>>>>>> napisao je:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> The reason you are getting this is that you are adding an argument
>>>>>>>> to the productsgrouping url - which doesn't take any arguments.
>>>>>>>>
>>>>>>>> In your code you have:
>>>>>>>> 
>>>>>>>> (Which by the way isn't correct either, I think you mean: >>>>>>> href="{% url 'productsgrouping' item.id%}">{{ item }} - {{item.id}}
>>>>>>>> )
>>>>>>>>
>>>>>>>> If you look at the url for the producsgrouping view, you have:
>>>>>>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>>>>>>>
>>>>>>>> Which doesn't take any arguments, when you then add an argument
>>>>>>>> django can't find the right URL.
>>>>>>>>
>>>>>>>> You may mean:
>>>>>>>> {{ item }} -
>>>>>>>> {{item.id}} 
>>>>>>>> ?
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> Andréas
>>>>>>>>
>>>>>>>>
>>>>>>>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić <
>>>>>>>> ma

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
napravio sam točno kako si rekao i dalje nece, isti error ...vec danima se
mucim sa ovime..nešto drugo je posrijedi.





uto, 29. sij 2019. u 12:16 Nebojsa Hajdukovic 
napisao je:

> neće raditi ali ne zbog html već zbog greške u views
> probaj ovako
>
> def productsgrouping_update_view(request, url_id):
>   assigned = get_object_or_404(Material, pk=url_id)
>
>
> naravno prvo moraš da importuješ get object or 404:
>
> from django.shortcuts import get_object_or_404
>
>
> уто, 29. јан 2019. у 12:00 Ivan Martić  је
> написао/ла:
>
>> Bok Nebojša,
>>
>> mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
>> jednom trenu je puknula veza. Neznam točno kada.
>> Znači, da odem na url *productsgrouping *prikaze sve grupe, kad kliknem
>> na grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u url
>> dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
>> nastavi sve kako treba.
>> Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku
>>
>> hvala ti za pomoć
>>
>>
>> uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> A što ne uradiš update preko class based view daleko je lakše?
>>>
>>> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>>>
>>> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
>>> def productsgrouping_update_view(request, url_id):
>>> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>>>
>>>
>>> уто, 29. јан 2019. у 10:20 Ivan Martić  је
>>> написао/ла:
>>>
>>>> not sure what to say
>>>>
>>>> čet, 24. sij 2019. u 13:53 Ivan Martić  napisao
>>>> je:
>>>>
>>>>> Hi  Andréas,
>>>>> sorry for misspeling in codes. All is working ok except when i try to
>>>>> put url tag for 'update_productsgrouping'.
>>>>> I need to update group with new products but It does not argument for
>>>>> group id.
>>>>> What do you think i am doing wrong...?
>>>>>
>>>>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>>>>> napisao je:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> The reason you are getting this is that you are adding an argument to
>>>>>> the productsgrouping url - which doesn't take any arguments.
>>>>>>
>>>>>> In your code you have:
>>>>>> 
>>>>>> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>>>>>>
>>>>>> If you look at the url for the producsgrouping view, you have:
>>>>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>>>>>
>>>>>> Which doesn't take any arguments, when you then add an argument
>>>>>> django can't find the right URL.
>>>>>>
>>>>>> You may mean:
>>>>>> {{ item }} - {{
>>>>>> item.id}} 
>>>>>> ?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Andréas
>>>>>>
>>>>>>
>>>>>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić <
>>>>>> martic.i...@gmail.com>:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> i am having issue with url tag, every time i put url tag like --{%
>>>>>>> url 'productsgrouping' item.id%}-- i get no reverse error.
>>>>>>> Can you help me figure it out on what am i doing wrong?
>>>>>>>
>>>>>>> view:
>>>>>>> def productsgrouping_view(request):
>>>>>>> queryset = MaterialGroup.objects.all()
>>>>>>> context = {"list" : queryset}
>>>>>>> return render(request, 'qif/productsgrouping/productsgroup.html',
>>>>>>> context)
>>>>>>>
>>>>>>> def productsgrouping_update_view(request, url_id):
>>>>>>> product_lista = MaterialGroup.objects.get(id=url_id)
>>>>>>> product_url_id = ProductgroupinputForm(request.POST or None,
>>>>>>> instance=product_lista)
>>>>>>> context1 = {'product_url_id': product_url_id, 'product_lista':
>>>>>>> product_lista}
>>>>>>>
>>

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
Bok Nebojša,

mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
jednom trenu je puknula veza. Neznam točno kada.
Znači, da odem na url *productsgrouping *prikaze sve grupe, kad kliknem na
grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u url
dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
nastavi sve kako treba.
Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku

hvala ti za pomoć


uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic 
napisao je:

> A što ne uradiš update preko class based view daleko je lakše?
>
> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>
> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
> def productsgrouping_update_view(request, url_id):
> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>
>
> уто, 29. јан 2019. у 10:20 Ivan Martić  је
> написао/ла:
>
>> not sure what to say
>>
>> čet, 24. sij 2019. u 13:53 Ivan Martić  napisao
>> je:
>>
>>> Hi  Andréas,
>>> sorry for misspeling in codes. All is working ok except when i try to
>>> put url tag for 'update_productsgrouping'.
>>> I need to update group with new products but It does not argument for
>>> group id.
>>> What do you think i am doing wrong...?
>>>
>>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>>> napisao je:
>>>
>>>> Hi,
>>>>
>>>> The reason you are getting this is that you are adding an argument to
>>>> the productsgrouping url - which doesn't take any arguments.
>>>>
>>>> In your code you have:
>>>> 
>>>> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>>>>
>>>> If you look at the url for the producsgrouping view, you have:
>>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>>>
>>>> Which doesn't take any arguments, when you then add an argument django
>>>> can't find the right URL.
>>>>
>>>> You may mean:
>>>> {{ item }} - {{
>>>> item.id}} 
>>>> ?
>>>>
>>>> Regards,
>>>>
>>>> Andréas
>>>>
>>>>
>>>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić >>> >:
>>>>
>>>>> Hi all,
>>>>>
>>>>> i am having issue with url tag, every time i put url tag like --{% url
>>>>> 'productsgrouping' item.id%}-- i get no reverse error.
>>>>> Can you help me figure it out on what am i doing wrong?
>>>>>
>>>>> view:
>>>>> def productsgrouping_view(request):
>>>>> queryset = MaterialGroup.objects.all()
>>>>> context = {"list" : queryset}
>>>>> return render(request, 'qif/productsgrouping/productsgroup.html',
>>>>> context)
>>>>>
>>>>> def productsgrouping_update_view(request, url_id):
>>>>> product_lista = MaterialGroup.objects.get(id=url_id)
>>>>> product_url_id = ProductgroupinputForm(request.POST or None,
>>>>> instance=product_lista)
>>>>> context1 = {'product_url_id': product_url_id, 'product_lista':
>>>>> product_lista}
>>>>>
>>>>> if product_url_id.is_valid():
>>>>> product_url_id.save()
>>>>>
>>>>> return render(request, 'productsgroup-update.html', context1)
>>>>>
>>>>> url:
>>>>> urlpatterns = [
>>>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>>>> path('update//', views.productsgrouping_update_view,
>>>>> name='update_productsgrouping'),
>>>>> path('new/', views.creategroup_view, name='create_group'),
>>>>> ]
>>>>>
>>>>> html:
>>>>> {% extends 'base.html' %}
>>>>> {% block content %}
>>>>> 
>>>>> {% for item in list %}
>>>>> 
>>>>> 
>>>>> {{ item }} - {{item.id}}
>>>>> 
>>>>> {% endfor %}
>>>>> {% endblock %}
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>&

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
not sure what to say

čet, 24. sij 2019. u 13:53 Ivan Martić  napisao je:

> Hi  Andréas,
> sorry for misspeling in codes. All is working ok except when i try to put
> url tag for 'update_productsgrouping'.
> I need to update group with new products but It does not argument for
> group id.
> What do you think i am doing wrong...?
>
> čet, 24. sij 2019. u 13:43 Andréas Kühne 
> napisao je:
>
>> Hi,
>>
>> The reason you are getting this is that you are adding an argument to the
>> productsgrouping url - which doesn't take any arguments.
>>
>> In your code you have:
>> 
>> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>>
>> If you look at the url for the producsgrouping view, you have:
>> path('', views.productsgrouping_view, name='productsgrouping'),
>>
>> Which doesn't take any arguments, when you then add an argument django
>> can't find the right URL.
>>
>> You may mean:
>> {{ item }} - {{
>> item.id}} 
>> ?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić :
>>
>>> Hi all,
>>>
>>> i am having issue with url tag, every time i put url tag like --{% url
>>> 'productsgrouping' item.id%}-- i get no reverse error.
>>> Can you help me figure it out on what am i doing wrong?
>>>
>>> view:
>>> def productsgrouping_view(request):
>>> queryset = MaterialGroup.objects.all()
>>> context = {"list" : queryset}
>>> return render(request, 'qif/productsgrouping/productsgroup.html',
>>> context)
>>>
>>> def productsgrouping_update_view(request, url_id):
>>> product_lista = MaterialGroup.objects.get(id=url_id)
>>> product_url_id = ProductgroupinputForm(request.POST or None,
>>> instance=product_lista)
>>> context1 = {'product_url_id': product_url_id, 'product_lista':
>>> product_lista}
>>>
>>> if product_url_id.is_valid():
>>> product_url_id.save()
>>>
>>> return render(request, 'productsgroup-update.html', context1)
>>>
>>> url:
>>> urlpatterns = [
>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>> path('update//', views.productsgrouping_update_view,
>>> name='update_productsgrouping'),
>>> path('new/', views.creategroup_view, name='create_group'),
>>> ]
>>>
>>> html:
>>> {% extends 'base.html' %}
>>> {% block content %}
>>> 
>>> {% for item in list %}
>>> 
>>> 
>>> {{ item }} - {{item.id}}
>>> 
>>> {% endfor %}
>>> {% endblock %}
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C8HUsxdpqz-MGqcpw0ZwgFOvrYZ-RJte6-H5x38b97ciQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-24 Thread Ivan Martić
Hi  Andréas,
sorry for misspeling in codes. All is working ok except when i try to put
url tag for 'update_productsgrouping'.
I need to update group with new products but It does not argument for group
id.
What do you think i am doing wrong...?

čet, 24. sij 2019. u 13:43 Andréas Kühne 
napisao je:

> Hi,
>
> The reason you are getting this is that you are adding an argument to the
> productsgrouping url - which doesn't take any arguments.
>
> In your code you have:
> 
> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>
> If you look at the url for the producsgrouping view, you have:
> path('', views.productsgrouping_view, name='productsgrouping'),
>
> Which doesn't take any arguments, when you then add an argument django
> can't find the right URL.
>
> You may mean:
> {{ item }} - {{
> item.id}} 
> ?
>
> Regards,
>
> Andréas
>
>
> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić :
>
>> Hi all,
>>
>> i am having issue with url tag, every time i put url tag like --{% url
>> 'productsgrouping' item.id%}-- i get no reverse error.
>> Can you help me figure it out on what am i doing wrong?
>>
>> view:
>> def productsgrouping_view(request):
>> queryset = MaterialGroup.objects.all()
>> context = {"list" : queryset}
>> return render(request, 'qif/productsgrouping/productsgroup.html', context)
>>
>> def productsgrouping_update_view(request, url_id):
>> product_lista = MaterialGroup.objects.get(id=url_id)
>> product_url_id = ProductgroupinputForm(request.POST or None,
>> instance=product_lista)
>> context1 = {'product_url_id': product_url_id, 'product_lista':
>> product_lista}
>>
>> if product_url_id.is_valid():
>> product_url_id.save()
>>
>> return render(request, 'productsgroup-update.html', context1)
>>
>> url:
>> urlpatterns = [
>> path('', views.productsgrouping_view, name='productsgrouping'),
>> path('update//', views.productsgrouping_update_view,
>> name='update_productsgrouping'),
>> path('new/', views.creategroup_view, name='create_group'),
>> ]
>>
>> html:
>> {% extends 'base.html' %}
>> {% block content %}
>> 
>> {% for item in list %}
>> 
>> 
>> {{ item }} - {{item.id}}
>> 
>> {% endfor %}
>> {% endblock %}
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C9Vn0x87bxxBShySUfcC6mQvxZD%3D_f-ej67eWMhWQ9TQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-24 Thread Ivan Martić
Hi all,

i am having issue with url tag, every time i put url tag like --{% url 
'productsgrouping' item.id%}-- i get no reverse error.
Can you help me figure it out on what am i doing wrong?

view:
def productsgrouping_view(request):
queryset = MaterialGroup.objects.all()
context = {"list" : queryset}
return render(request, 'qif/productsgrouping/productsgroup.html', context)

def productsgrouping_update_view(request, url_id):
product_lista = MaterialGroup.objects.get(id=url_id)
product_url_id = ProductgroupinputForm(request.POST or None, 
instance=product_lista)
context1 = {'product_url_id': product_url_id, 'product_lista': 
product_lista}

if product_url_id.is_valid():
product_url_id.save()

return render(request, 'productsgroup-update.html', context1)

url:
urlpatterns = [
path('', views.productsgrouping_view, name='productsgrouping'),
path('update//', views.productsgrouping_update_view, 
name='update_productsgrouping'),
path('new/', views.creategroup_view, name='create_group'),
]

html:
{% extends 'base.html' %}
{% block content %}

{% for item in list %}


{{ item }} - {{item.id}}  
 
{% endfor %}
{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Environment:


Request Method: GET
Request URL: http://localhost:8000/productsgrouping/

Django Version: 2.1.4
Python Version: 3.7.1
Installed Applications:
['main',
 'abcclass',
 'performance',
 'productsgrouping',
 'vendorsgrouping',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'crispy_forms',
 'multiselectfield',
 'sortedm2m',
 'simple_history']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'simple_history.middleware.HistoryRequestMiddleware']


Template error:
In template C:\Users\martici\QIF\qif\templates\qif\base.html, error at line 8
   Reverse for 'productsgrouping' with arguments '('1',)' not found. 1 
pattern(s) tried: ['productsgrouping/$']
   1 : {% load staticfiles %}
   2 : 
   3 : 
   4 : 
   5 : 
   6 :   
   7 : 
   8 : 
   9 : 
   10 : 
   11 : 
   12 : Carousel Template · Bootstrap
   13 : 
   14 : 
   15 : 
   16 : 
   17 : 
   18 : 

Re: Matching query does not exist

2019-01-18 Thread Ivan Martić
Hi,

im not sure that i understand "specifying your database columns explicitly".
I have connected to existing MSSQL database so i had to adapt my model due
to that. Just copied model from inspectdb and added:
- def __str__
-ForeignKey(class name, on delete=models.CASCADE)xtimes for materialid
and group.

I am not so experience  as you :) but i think you are on the good lead.
I am watching this case :
https://stackoverflow.com/questions/44107021/django-admin-doesnt-display-value
Seems like same issue, same error occured.
What do you think?

pet, 18. sij 2019. u 11:16 Kasper Laudrup  napisao
je:

> Hi Ivan,
>
> On 1/18/19 10:59 AM, Ivan Martić wrote:
> > Thank you Kasper,
> >
>
> You're welcome.
>
> > i have copied that model after doing inspectdb. So it should be set by
> > default from django that way. Usually all was ok..
> > Also, i have tried that  change now and got the same result.
> >
> > Any other idea where i gone wrong?
> >
>
> Sorry, not really. I'm wondering why you are specifying your database
> columns explicitly though? I've never had a need for that, but I'm far
> from being very experienced with Django.
>
> Hopefully someone else can help you.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/54b11d43-d6c5-dcff-6d3d-29cbeca2ef43%40stacktrace.dk
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C-2tbFNeo_JJV7tt8LYPP%3DP%3DKJXbEXjfQuLFEQgMP86-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Matching query does not exist

2019-01-18 Thread Ivan Martić
Thank you Kasper, 

i have copied that model after doing inspectdb. So it should be set by 
default from django that way. Usually all was ok..
Also, i have tried that  change now and got the same result.

Any other idea where i gone wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/836e1018-233d-4eb4-9f24-39dd321ce253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Matching query does not exist

2019-01-18 Thread Ivan Martić
Hi all,
 i am having trouble to get this query on db table right. 
I am always getting error.

Please check shell erorr attached.

I appreciate your help!




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca5a10a1-b8ea-4950-89b7-6806a4682ef8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#models

from __future__ import unicode_literals
from django.db import models, connection
from django.utils import timezone
from datetime import date



class Material(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True, blank=False, 
unique=True)
bukrs = models.CharField(db_column='Bukrs', max_length=4)
materialid = models.CharField(db_column='MaterialID', max_length=10)
material_name = models.CharField(db_column='Material_name', max_length=7)

class Meta:
managed = False
db_table = 'Material'

def __str__(self):
return '%s %s %s' % (self.bukrs, self.materialid, self.material_name)


class MaterialGroup(models.Model):
id = models.CharField(db_column='ID', max_length=255, blank=False, 
primary_key=True)
material_group = models.CharField(db_column='Material Group', 
max_length=255, blank=True, null=True)

class Meta:
managed = False
db_table = 'Material Group'

def __str__(self):
return '%s' % (self.material_group)


class Productgroupinput(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True, blank=False, 
unique=True)
bukrs = models.CharField(db_column='Bukrs', max_length=4)
materialid = models.ForeignKey(Material, on_delete=models.CASCADE, 
db_column='Materialid', max_length=10)
material_group = models.ForeignKey(MaterialGroup, on_delete=models.CASCADE, 
db_column='Material_group', max_length=2)

class Meta:
managed = False
db_table = 'ProductGroupInput'

def __str__(self):
return '%s %s %s' % (self.bukrs, self.materialid, self.material_group)>>> from productsgrouping.models import Material, MaterialGroup, 
>>> Productgroupinput
>>> test = Productgroupinput.objects.all()
>>> test
Traceback (most recent call last):
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\related_des
criptors.py", line 163, in __get__
rel_obj = self.field.get_cached_value(instance)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\mixins.py",
 line 13, in get_cached_value
return instance._state.fields_cache[cache_name]
KeyError: 'materialid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\query.py",
 line 24
7, in __repr__
return '<%s %r>' % (self.__class__.__name__, data)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\base.py",
 line 503
, in __repr__
return '<%s: %s>' % (self.__class__.__name__, self)
  File "C:\Users\martici\QIF\qif\productsgrouping\models.py", line 45, in 
__str__
return '%s %s %s' % (self.bukrs, self.materialid, self.material_group)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\related_des
criptors.py", line 177, in __get__
rel_obj = self.get_object(instance)
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\fields\related_des
criptors.py", line 144, in get_object
return qs.get(self.field.get_reverse_related_filter(instance))
  File 
"C:\Users\martici\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\models\query.py",
 line 39
9, in get
self.model._meta.object_name
productsgrouping.models.Material.DoesNotExist: Material matching query does not 
exist.>>> query = Material.objects.all()
>>> query
, , , , ]>
>>>

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
hvala Nebojša, to je to!!!
Kralj si

uto, 15. sij 2019. u 15:34 Nebojsa Hajdukovic 
napisao je:

> e izvini kao što sam ti rekao bio sam u gužvi, pa sam napamet pisao i
> zaboravio glupost da dodam. Evo ga.
>
> def prepoznaj(request):
> prepoznaj_form = PrepoznajForm(request.POST or None, 
> initial={'supplier_name':request.user})
> if prepoznaj_form.is_valid():
> prepoznaj_form.save()
>
> context = {
> 'prepoznaj_form': prepoznaj_form
> }
>
> return render(request, 'prepoznaj/forma.html', context)
>
>
> уто, 15. јан 2019. у 13:03 Ivan Martić  је
> написао/ла:
>
>> Nema greški ali save ne prolazi..
>>
>> System check identified no issues (0 silenced).
>> January 15, 2019 - 13:01:29
>> Django version 2.1.4, using settings 'qif.settings'
>> Starting development server at http://127.0.0.1:8000/
>> Quit the server with CTRL-BREAK.
>> [15/Jan/2019 13:01:31] "GET / HTTP/1.1" 200 8939
>> [15/Jan/2019 13:01:33] "GET /performance/ HTTP/1.1" 200 14799
>> [15/Jan/2019 13:01:39] "POST /performance/ HTTP/1.1" 200 14811
>>
>> Da li ovi podaci mogu što pomoći?
>>
>> uto, 15. sij 2019. u 12:54 Ivan Martić  napisao
>> je:
>>
>>> Nažalost, iz nekog razloga ne prolazi save ni poruka nakog save...
>>>
>>>
>>> uto, 15. sij 2019. u 12:52 Nebojsa Hajdukovic 
>>> napisao je:
>>>
>>>> view:
>>>> def performance_view(request):
>>>> form = PerformanceForm( {'supplier_name':request.user}  )
>>>> if request.method == "POST":
>>>> form = PerformanceForm[request.POST]
>>>> if form.is_valid():
>>>> form.save()
>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>
>>>> ovako nekako bi trebalo da radi
>>>>
>>>> уто, 15. јан 2019. у 12:49 Ivan Martić  је
>>>> написао/ла:
>>>>
>>>>> Ej hvala ti, puno mi je jasnije.. razumijem da si u gužvi, idem dalje
>>>>> sam pa ako zapnem javim se...
>>>>>
>>>>> 5 Star for support!!
>>>>>
>>>>> uto, 15. sij 2019. u 12:45 Nebojsa Hajdukovic <
>>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>>
>>>>>> moras da dodas
>>>>>> if request.method == "POST"
>>>>>> form = PerformanceForm[request.POST]
>>>>>> izvini sad sam u nekoj bas velikoj guzvi, evo ti otprilike kako sam
>>>>>> ja na drugoj formi uradio, ako ne uspes ispisacu ti malo kasnije
>>>>>> [image: image.png]
>>>>>>
>>>>>> уто, 15. јан 2019. у 12:26 Ivan Martić  је
>>>>>> написао/ла:
>>>>>>
>>>>>>> Bravo! radi!
>>>>>>> Samo što sad neradi spremanje (request.POST)...kako da to sad
>>>>>>> implementiram, jel može savjet?
>>>>>>>
>>>>>>> uto, 15. sij 2019. u 12:22 Nebojsa Hajdukovic <
>>>>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>>>>
>>>>>>>> Obrisi ovo request.post or none
>>>>>>>>
>>>>>>>> uto, 15. jan 2019. 12:19 Ivan Martić  je
>>>>>>>> napisao/la:
>>>>>>>>
>>>>>>>>> Bok Nebojsa,
>>>>>>>>>
>>>>>>>>> hvala ti na brzom odgovoru.
>>>>>>>>> napravio sam ovako i nema promjene
>>>>>>>>>
>>>>>>>>> def performance_view(request):
>>>>>>>>> * form = PerformanceForm(request.POST or None,
>>>>>>>>> {'supplier_name':request.user})*
>>>>>>>>> if form.is_valid():
>>>>>>>>> form.save()
>>>>>>>>> messages.success(request, 'Your entry has been saved. Relevant
>>>>>>>>> persons will be informed of this change.')
>>>>>>>>> #(nevezano za populate) i ovaj message.success mi se isto  javlja
>>>>>>>>> kao problem.. na performance appu mi bilježi login/logout umjesto samo
>>>>>>>>> poruka nakon uspješnog spremanja.
>>>>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>>>>
>>>>>>>>> Možda mi nešto na 

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
Nema greški ali save ne prolazi..

System check identified no issues (0 silenced).
January 15, 2019 - 13:01:29
Django version 2.1.4, using settings 'qif.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[15/Jan/2019 13:01:31] "GET / HTTP/1.1" 200 8939
[15/Jan/2019 13:01:33] "GET /performance/ HTTP/1.1" 200 14799
[15/Jan/2019 13:01:39] "POST /performance/ HTTP/1.1" 200 14811

Da li ovi podaci mogu što pomoći?

uto, 15. sij 2019. u 12:54 Ivan Martić  napisao je:

> Nažalost, iz nekog razloga ne prolazi save ni poruka nakog save...
>
>
> uto, 15. sij 2019. u 12:52 Nebojsa Hajdukovic 
> napisao je:
>
>> view:
>> def performance_view(request):
>> form = PerformanceForm( {'supplier_name':request.user}  )
>> if request.method == "POST":
>> form = PerformanceForm[request.POST]
>> if form.is_valid():
>> form.save()
>> return render(request, 'qif/performance.html', {"form" : form})
>>
>> ovako nekako bi trebalo da radi
>>
>> уто, 15. јан 2019. у 12:49 Ivan Martić  је
>> написао/ла:
>>
>>> Ej hvala ti, puno mi je jasnije.. razumijem da si u gužvi, idem dalje
>>> sam pa ako zapnem javim se...
>>>
>>> 5 Star for support!!
>>>
>>> uto, 15. sij 2019. u 12:45 Nebojsa Hajdukovic 
>>> napisao je:
>>>
>>>> moras da dodas
>>>> if request.method == "POST"
>>>> form = PerformanceForm[request.POST]
>>>> izvini sad sam u nekoj bas velikoj guzvi, evo ti otprilike kako sam ja
>>>> na drugoj formi uradio, ako ne uspes ispisacu ti malo kasnije
>>>> [image: image.png]
>>>>
>>>> уто, 15. јан 2019. у 12:26 Ivan Martić  је
>>>> написао/ла:
>>>>
>>>>> Bravo! radi!
>>>>> Samo što sad neradi spremanje (request.POST)...kako da to sad
>>>>> implementiram, jel može savjet?
>>>>>
>>>>> uto, 15. sij 2019. u 12:22 Nebojsa Hajdukovic <
>>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>>
>>>>>> Obrisi ovo request.post or none
>>>>>>
>>>>>> uto, 15. jan 2019. 12:19 Ivan Martić  je
>>>>>> napisao/la:
>>>>>>
>>>>>>> Bok Nebojsa,
>>>>>>>
>>>>>>> hvala ti na brzom odgovoru.
>>>>>>> napravio sam ovako i nema promjene
>>>>>>>
>>>>>>> def performance_view(request):
>>>>>>> * form = PerformanceForm(request.POST or None,
>>>>>>> {'supplier_name':request.user})*
>>>>>>> if form.is_valid():
>>>>>>> form.save()
>>>>>>> messages.success(request, 'Your entry has been saved. Relevant
>>>>>>> persons will be informed of this change.')
>>>>>>> #(nevezano za populate) i ovaj message.success mi se isto  javlja
>>>>>>> kao problem.. na performance appu mi bilježi login/logout umjesto samo
>>>>>>> poruka nakon uspješnog spremanja.
>>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>>
>>>>>>> Možda mi nešto na formi nedostaje?
>>>>>>>
>>>>>>> uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic <
>>>>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>>>>
>>>>>>>> Hey, based on your name I believe u speak our language, so will
>>>>>>>> switch to that : )
>>>>>>>>
>>>>>>>> Ako hoces da na primer supplier_name bude automatski popunjeno kao
>>>>>>>> koristik samo dodaj ovako u views.py:
>>>>>>>> view:
>>>>>>>> def performance_view(request):
>>>>>>>> form = PerformanceForm({'supplier_name':request.user})
>>>>>>>> if form.is_valid():
>>>>>>>> form.save()
>>>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>>>
>>>>>>>> уто, 15. јан 2019. у 09:51 Ivan Martić  је
>>>>>>>> написао/ла:
>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> can someone assist me.
>>>>>>>>> I cant get the modelform field get popula

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
Nažalost, iz nekog razloga ne prolazi save ni poruka nakog save...


uto, 15. sij 2019. u 12:52 Nebojsa Hajdukovic 
napisao je:

> view:
> def performance_view(request):
> form = PerformanceForm( {'supplier_name':request.user}  )
> if request.method == "POST":
> form = PerformanceForm[request.POST]
> if form.is_valid():
> form.save()
> return render(request, 'qif/performance.html', {"form" : form})
>
> ovako nekako bi trebalo da radi
>
> уто, 15. јан 2019. у 12:49 Ivan Martić  је
> написао/ла:
>
>> Ej hvala ti, puno mi je jasnije.. razumijem da si u gužvi, idem dalje sam
>> pa ako zapnem javim se...
>>
>> 5 Star for support!!
>>
>> uto, 15. sij 2019. u 12:45 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> moras da dodas
>>> if request.method == "POST"
>>> form = PerformanceForm[request.POST]
>>> izvini sad sam u nekoj bas velikoj guzvi, evo ti otprilike kako sam ja
>>> na drugoj formi uradio, ako ne uspes ispisacu ti malo kasnije
>>> [image: image.png]
>>>
>>> уто, 15. јан 2019. у 12:26 Ivan Martić  је
>>> написао/ла:
>>>
>>>> Bravo! radi!
>>>> Samo što sad neradi spremanje (request.POST)...kako da to sad
>>>> implementiram, jel može savjet?
>>>>
>>>> uto, 15. sij 2019. u 12:22 Nebojsa Hajdukovic <
>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>
>>>>> Obrisi ovo request.post or none
>>>>>
>>>>> uto, 15. jan 2019. 12:19 Ivan Martić  je
>>>>> napisao/la:
>>>>>
>>>>>> Bok Nebojsa,
>>>>>>
>>>>>> hvala ti na brzom odgovoru.
>>>>>> napravio sam ovako i nema promjene
>>>>>>
>>>>>> def performance_view(request):
>>>>>> * form = PerformanceForm(request.POST or None,
>>>>>> {'supplier_name':request.user})*
>>>>>> if form.is_valid():
>>>>>> form.save()
>>>>>> messages.success(request, 'Your entry has been saved. Relevant
>>>>>> persons will be informed of this change.')
>>>>>> #(nevezano za populate) i ovaj message.success mi se isto  javlja kao
>>>>>> problem.. na performance appu mi bilježi login/logout umjesto samo poruka
>>>>>> nakon uspješnog spremanja.
>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>
>>>>>> Možda mi nešto na formi nedostaje?
>>>>>>
>>>>>> uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic <
>>>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>>>
>>>>>>> Hey, based on your name I believe u speak our language, so will
>>>>>>> switch to that : )
>>>>>>>
>>>>>>> Ako hoces da na primer supplier_name bude automatski popunjeno kao
>>>>>>> koristik samo dodaj ovako u views.py:
>>>>>>> view:
>>>>>>> def performance_view(request):
>>>>>>> form = PerformanceForm({'supplier_name':request.user})
>>>>>>> if form.is_valid():
>>>>>>> form.save()
>>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>>
>>>>>>> уто, 15. јан 2019. у 09:51 Ivan Martić  је
>>>>>>> написао/ла:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> can someone assist me.
>>>>>>>> I cant get the modelform field get populated with active username.
>>>>>>>>
>>>>>>>> Does any one have a good advice?
>>>>>>>>
>>>>>>>> view:
>>>>>>>> def performance_view(request):
>>>>>>>> form = PerformanceForm(request.POST or None)
>>>>>>>> if form.is_valid():
>>>>>>>> form.save()
>>>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>>>
>>>>>>>> forms:
>>>>>>>> from django import forms
>>>>>>>> from .models import Performance
>>>>>>>>
>>>>>>>>
>>>>>>>> class PerformanceForm(forms.ModelForm):
>>>>>>>&

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
Ej hvala ti, puno mi je jasnije.. razumijem da si u gužvi, idem dalje sam
pa ako zapnem javim se...

5 Star for support!!

uto, 15. sij 2019. u 12:45 Nebojsa Hajdukovic 
napisao je:

> moras da dodas
> if request.method == "POST"
> form = PerformanceForm[request.POST]
> izvini sad sam u nekoj bas velikoj guzvi, evo ti otprilike kako sam ja na
> drugoj formi uradio, ako ne uspes ispisacu ti malo kasnije
> [image: image.png]
>
> уто, 15. јан 2019. у 12:26 Ivan Martić  је
> написао/ла:
>
>> Bravo! radi!
>> Samo što sad neradi spremanje (request.POST)...kako da to sad
>> implementiram, jel može savjet?
>>
>> uto, 15. sij 2019. u 12:22 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> Obrisi ovo request.post or none
>>>
>>> uto, 15. jan 2019. 12:19 Ivan Martić  je
>>> napisao/la:
>>>
>>>> Bok Nebojsa,
>>>>
>>>> hvala ti na brzom odgovoru.
>>>> napravio sam ovako i nema promjene
>>>>
>>>> def performance_view(request):
>>>> * form = PerformanceForm(request.POST or None,
>>>> {'supplier_name':request.user})*
>>>> if form.is_valid():
>>>> form.save()
>>>> messages.success(request, 'Your entry has been saved. Relevant persons
>>>> will be informed of this change.')
>>>> #(nevezano za populate) i ovaj message.success mi se isto  javlja kao
>>>> problem.. na performance appu mi bilježi login/logout umjesto samo poruka
>>>> nakon uspješnog spremanja.
>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>
>>>> Možda mi nešto na formi nedostaje?
>>>>
>>>> uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic <
>>>> nebojsa.zero...@gmail.com> napisao je:
>>>>
>>>>> Hey, based on your name I believe u speak our language, so will switch
>>>>> to that : )
>>>>>
>>>>> Ako hoces da na primer supplier_name bude automatski popunjeno kao
>>>>> koristik samo dodaj ovako u views.py:
>>>>> view:
>>>>> def performance_view(request):
>>>>> form = PerformanceForm({'supplier_name':request.user})
>>>>> if form.is_valid():
>>>>> form.save()
>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>
>>>>> уто, 15. јан 2019. у 09:51 Ivan Martić  је
>>>>> написао/ла:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> can someone assist me.
>>>>>> I cant get the modelform field get populated with active username.
>>>>>>
>>>>>> Does any one have a good advice?
>>>>>>
>>>>>> view:
>>>>>> def performance_view(request):
>>>>>> form = PerformanceForm(request.POST or None)
>>>>>> if form.is_valid():
>>>>>> form.save()
>>>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>>>
>>>>>> forms:
>>>>>> from django import forms
>>>>>> from .models import Performance
>>>>>>
>>>>>>
>>>>>> class PerformanceForm(forms.ModelForm):
>>>>>> class Meta:
>>>>>> model = Performance
>>>>>> fields = [
>>>>>> 'supplier_name',
>>>>>> 'deliverability',
>>>>>> 'rating',
>>>>>> 'rated_by',
>>>>>> 'date_of_entry'
>>>>>> ]
>>>>>>
>>>>>> def __init__(self, rated_by, *args, **kwargs):
>>>>>> super(PerformanceForm, self).__init__(*args, **kwargs)
>>>>>> self.fields["rated_by"].initial = rated_by
>>>>>>
>>>>>> what am i missing..
>>>>>> Thank you in advance..
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to django-users+unsubscr...@googlegroups.com.
>>>>>> To post to this group, send email to django-users@googlegroups.com.
>>>>>> Visit this group at https://groups.google.com/group/django-users.
>>>>>> To view this discussi

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
Bravo! radi!
Samo što sad neradi spremanje (request.POST)...kako da to sad
implementiram, jel može savjet?

uto, 15. sij 2019. u 12:22 Nebojsa Hajdukovic 
napisao je:

> Obrisi ovo request.post or none
>
> uto, 15. jan 2019. 12:19 Ivan Martić  je
> napisao/la:
>
>> Bok Nebojsa,
>>
>> hvala ti na brzom odgovoru.
>> napravio sam ovako i nema promjene
>>
>> def performance_view(request):
>> * form = PerformanceForm(request.POST or None,
>> {'supplier_name':request.user})*
>> if form.is_valid():
>> form.save()
>> messages.success(request, 'Your entry has been saved. Relevant persons
>> will be informed of this change.')
>> #(nevezano za populate) i ovaj message.success mi se isto  javlja kao
>> problem.. na performance appu mi bilježi login/logout umjesto samo poruka
>> nakon uspješnog spremanja.
>> return render(request, 'qif/performance.html', {"form" : form})
>>
>> Možda mi nešto na formi nedostaje?
>>
>> uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> Hey, based on your name I believe u speak our language, so will switch
>>> to that : )
>>>
>>> Ako hoces da na primer supplier_name bude automatski popunjeno kao
>>> koristik samo dodaj ovako u views.py:
>>> view:
>>> def performance_view(request):
>>> form = PerformanceForm({'supplier_name':request.user})
>>> if form.is_valid():
>>> form.save()
>>> return render(request, 'qif/performance.html', {"form" : form})
>>>
>>> уто, 15. јан 2019. у 09:51 Ivan Martić  је
>>> написао/ла:
>>>
>>>> Hi all,
>>>>
>>>> can someone assist me.
>>>> I cant get the modelform field get populated with active username.
>>>>
>>>> Does any one have a good advice?
>>>>
>>>> view:
>>>> def performance_view(request):
>>>> form = PerformanceForm(request.POST or None)
>>>> if form.is_valid():
>>>> form.save()
>>>> return render(request, 'qif/performance.html', {"form" : form})
>>>>
>>>> forms:
>>>> from django import forms
>>>> from .models import Performance
>>>>
>>>>
>>>> class PerformanceForm(forms.ModelForm):
>>>> class Meta:
>>>> model = Performance
>>>> fields = [
>>>> 'supplier_name',
>>>> 'deliverability',
>>>> 'rating',
>>>> 'rated_by',
>>>> 'date_of_entry'
>>>> ]
>>>>
>>>> def __init__(self, rated_by, *args, **kwargs):
>>>> super(PerformanceForm, self).__init__(*args, **kwargs)
>>>> self.fields["rated_by"].initial = rated_by
>>>>
>>>> what am i missing..
>>>> Thank you in advance..
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/df4ca182-fb48-4a27-a2a0-a9b20f0e6a21%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/df4ca182-fb48-4a27-a2a0-a9b20f0e6a21%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAJ60hW2jg6rAeHtX-dW8KJj3dVK5DRsYDWCT0f0eh9-tJKqTBQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAJ60hW2jg6rAeHtX-dW8KJj3dVK5DRsYDWCT0f0eh9-tJKqTBQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout

Re: Populate modelform field with username

2019-01-15 Thread Ivan Martić
Bok Nebojsa,

hvala ti na brzom odgovoru.
napravio sam ovako i nema promjene

def performance_view(request):
* form = PerformanceForm(request.POST or None,
{'supplier_name':request.user})*
if form.is_valid():
form.save()
messages.success(request, 'Your entry has been saved. Relevant persons will
be informed of this change.')
#(nevezano za populate) i ovaj message.success mi se isto  javlja kao
problem.. na performance appu mi bilježi login/logout umjesto samo poruka
nakon uspješnog spremanja.
return render(request, 'qif/performance.html', {"form" : form})

Možda mi nešto na formi nedostaje?

uto, 15. sij 2019. u 11:59 Nebojsa Hajdukovic 
napisao je:

> Hey, based on your name I believe u speak our language, so will switch to
> that : )
>
> Ako hoces da na primer supplier_name bude automatski popunjeno kao
> koristik samo dodaj ovako u views.py:
> view:
> def performance_view(request):
> form = PerformanceForm({'supplier_name':request.user})
> if form.is_valid():
> form.save()
> return render(request, 'qif/performance.html', {"form" : form})
>
> уто, 15. јан 2019. у 09:51 Ivan Martić  је
> написао/ла:
>
>> Hi all,
>>
>> can someone assist me.
>> I cant get the modelform field get populated with active username.
>>
>> Does any one have a good advice?
>>
>> view:
>> def performance_view(request):
>> form = PerformanceForm(request.POST or None)
>> if form.is_valid():
>> form.save()
>> return render(request, 'qif/performance.html', {"form" : form})
>>
>> forms:
>> from django import forms
>> from .models import Performance
>>
>>
>> class PerformanceForm(forms.ModelForm):
>> class Meta:
>> model = Performance
>> fields = [
>> 'supplier_name',
>> 'deliverability',
>> 'rating',
>> 'rated_by',
>> 'date_of_entry'
>> ]
>>
>> def __init__(self, rated_by, *args, **kwargs):
>> super(PerformanceForm, self).__init__(*args, **kwargs)
>> self.fields["rated_by"].initial = rated_by
>>
>> what am i missing..
>> Thank you in advance..
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/df4ca182-fb48-4a27-a2a0-a9b20f0e6a21%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/df4ca182-fb48-4a27-a2a0-a9b20f0e6a21%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ60hW2jg6rAeHtX-dW8KJj3dVK5DRsYDWCT0f0eh9-tJKqTBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAJ60hW2jg6rAeHtX-dW8KJj3dVK5DRsYDWCT0f0eh9-tJKqTBQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFab_C_iOye2LahEJxOArPPqyEaqEFcM_H%2B2MrDeRXHbTaYGYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Populate modelform field with username

2019-01-15 Thread Ivan Martić
Hi all,

can someone assist me.
I cant get the modelform field get populated with active username.

Does any one have a good advice?

view:
def performance_view(request):
form = PerformanceForm(request.POST or None) 
if form.is_valid():
form.save()
return render(request, 'qif/performance.html', {"form" : form})

forms:
from django import forms
from .models import Performance


class PerformanceForm(forms.ModelForm):
class Meta:
model = Performance
fields = [
'supplier_name', 
'deliverability', 
'rating', 
'rated_by', 
'date_of_entry'
]

def __init__(self, rated_by, *args, **kwargs):
super(PerformanceForm, self).__init__(*args, **kwargs)
self.fields["rated_by"].initial = rated_by

what am i missing..
Thank you in advance..

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df4ca182-fb48-4a27-a2a0-a9b20f0e6a21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to add a new record in django admin list_view, in a way similar to what extra forms do in inlines

2019-01-10 Thread Ivan Molineris
Hi,
I asked a question on stackoverflow 
 but I will ask also on this 
group just in case.

Using ModelAdmin.list_editable 

 
I can edit the fields of records listed in a list view of django admin, in 
a way similar to what is done with InlineModelAdmin.

Using InlineModelAdmin.extra 

 
I can show forms to add new records in inline models admin view.


How can I show similar empty forms in the admin list view in order to add 
new records?


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cc40e752-0b45-4392-afda-c9500ba1c0fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ms sql server connectivity to django

2019-01-07 Thread Ivan Martić
Hi mate,

I had the same issue with MS SQL.

This worked for me:
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'HOST': 'xxx',
'PORT': '1433',

'USER': 'xxx',
'PASSWORD': 'xxx',
'NAME': 'xx',#table name
'CONN_MAX_AGE': 0,
'AUTOCOMMIT': True,

'OPTIONS': {
'driver': 'ODBC Driver 17 for SQL Server',
'host_is_server': True,
'autocommit': True,
'driver_needs_utf8': True,
'use_legacy_date_fields' : True,
},
}
}

You need to have pyodbc azure installed.

GL,
Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7b00ad3b-8964-4b39-9eaa-4a204f45eb92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ms sql server connectivity to django

2019-01-07 Thread Ivan Martić
Hi Mate,

I had the same issues with connecting to MS SQL.
This is the configuration which worked for me...

DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'HOST': 'XXX',
'PORT': '1433',

'USER': 'XXX',
'PASSWORD': 'XXX',
'NAME': 'XXX', #name of your table
'CONN_MAX_AGE': 0,
'AUTOCOMMIT': True,

'OPTIONS': {
'driver': 'ODBC Driver 17 for SQL Server',
'host_is_server': True,
'autocommit': True,
'driver_needs_utf8': True,
'use_legacy_date_fields' : True,
},
}
}
You need to have pyodbc installed.

BR,
Ivan

On Sunday, January 6, 2019 at 6:56:09 PM UTC+1, Praveen Kumar wrote:
>
> Hi All,
>
> Changed DATABASE code as under in setting.py in Django project. But not 
> getting able to connect to MS SQL Server. Please suggest.
>
> ATABASES = {
> 'default': {
> 'NAME': 'APJ_AIM_LITE',
> 'ENGINE': 'sqlserver_ado',
> 'HOST': 'DB_SERVER',
> 'USER': '',
> 'PASSWORD': '',
> }
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c8366067-faf8-426a-b6d1-3b0e37a35e15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access denied for MySQL user in Django

2017-10-09 Thread Ivan Gruer
Hi,
as far as i understood cdraccess  is a DB gust user, right?

If so, from your DB admin user, grant cdraccess to access MySQL environment 
table 'mysql.user' as follow:
 
GRANT SELECT ON `mysql`.`user` TO 'user_gui'@'%';

To me it worked,
Ivan

On Monday, January 25, 2016 at 7:52:33 PM UTC+1, James Schneider wrote:
>
>
>>> And I get the usual error message:
>>>
>>> (1045, u"Access denied for user 'cdraccess'@'77.95.177.35' (using password: 
>>> NO)")
>>>
>>>
>>> I have print statements and everything looks correct. It is printed as 
>>> it is in the settings.py file.
>>>
>>> One thing I noticed is that the IP 77.95.177.35 is my machine's IP, NOT 
>>> the host's IP. For some reason the host IP (as it is given in the 
>>> settings.py file) is replaced in this error message by my machine's IP. Is 
>>> that normal?
>>>
>>
>
> Another thought. Do you manage the server/MySQL instance? Have you looked 
> at the logs for MySQL to ensure that the password is the only issue? It's 
> possible you are getting access denied for a number of reasons, including 
> the database not existing when Django tries to access it.
>
> -James
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e44f3710-d693-4f37-8a03-9eff7aebd258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access denied for MySQL user in Django

2017-10-09 Thread Ivan Gruer
Hi,
as far as i understood cdraccess  is a DB gust user, right?

If so, from your DB admin user, grant cdraccess to access MySQL environment 
table 'mysql.user' as follow:
 
GRANT SELECT ON `mysql`.`user` TO 'cdraccess'@'%';

To me it worked,
Ivan

On Thursday, January 14, 2016 at 2:27:27 PM UTC+1, Galil wrote:
>
> I have created a Django app and which uses MySQL. The settings.py file in 
> the database sections is:
>
> DATABASES = {
> 'cdraccess': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': os.environ.get('CDR_DB_NAME', 'portal2'),
> 'USER': os.environ.get('CDR_DB_USER', 'cdraccess'),
> 'HOST': os.environ.get('CDR_DB_HOST', '127.0.0.1'),
> 'CONN_MAX_AGE': 0,
> 'PASSWORD': os.environ.get('CDR_DB_PASSWORD', ''),
> },
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': 'db.sqlite3',
> }}
>
> I run the app like:
>
> CDR_DB_PASSWORD='password' CDR_DB_HOST='host_name' ./manage.py runserver
>
> but I get the following error:
>
> Access denied for user 'cdraccess'@'host_ip_here' (using password: NO)")
>
> I tried to access the database from terminal, like:
>
>$ mysql --host=[host_name] --user=cdraccess -p portal2
>
> and worked fine.
>
> What is going wrong in here? And what does this "(using password: NO)" 
> mean?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/71856d5f-d404-4637-8497-1203108d101a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Tutorial Issues

2017-05-04 Thread Ivan Cox
Hi i am new to Django and in the process of going through the django 
tutorial at https://www.djangoproject.com/ 
I have however run into problems on Part 4. I have added the following code 
to the detail.html page 

{{ question.question_text }}

{% if error_message %}{{ error_message }}{% endif %}



{% csrf_token %}
{% for choice in question.choice_set.all %}

{{ choice.choice_text 
}}
{% endfor %}




But when i click on the links on the polls home page i get the following 
error

NoReverseMatch at /polls/3/

Reverse for 'vote' with arguments '('',)' not found. 1 pattern(s) tried: 
['polls/(?P[0-9]+)/vote/$']

Request Method: GET
Request URL: http://127.0.0.1:8000/polls/3/
Django Version: 1.11
Exception Type: NoReverseMatch
Exception Value: 

Reverse for 'vote' with arguments '('',)' not found. 1 pattern(s) tried: 
['polls/(?P[0-9]+)/vote/$']

Exception Location: 
C:\Users\Echalon\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\resolvers.py
 
in _reverse_with_prefix, line 497
Python Executable: 
C:\Users\Echalon\AppData\Local\Programs\Python\Python36-32\python.exe
Python Version: 3.6.0
Python Path: 

['C:\\Web Development\\mysite',
 
'C:\\Users\\Echalon\\AppData\\Local\\Programs\\Python\\Python36-32\\python36.zip',
 'C:\\Users\\Echalon\\AppData\\Local\\Programs\\Python\\Python36-32\\DLLs',
 'C:\\Users\\Echalon\\AppData\\Local\\Programs\\Python\\Python36-32\\lib',
 'C:\\Users\\Echalon\\AppData\\Local\\Programs\\Python\\Python36-32',
 
'C:\\Users\\Echalon\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\site-packages']

Server time: Thu, 4 May 2017 06:31:28 +
Error during template rendering

In template C:\Web Development\mysite\polls\templates\polls\detail.html, 
error at line *5*
Reverse for 'vote' with arguments '('',)' not found. 1 pattern(s) tried: 
['polls/(?P[0-9]+)/vote/$']
1 {{ question.question_text }} 
2 
3 {% if error_message %}{{ error_message }}{% endif 
%} 
4 
5  
6 
7 {% csrf_token %} 
8 {% for choice in question.choice_set.all %} 
9  
10 {{ choice.choice_text 
}} 
11 {% endfor %} 
12  
13  
14

Any help would be greatly appreciated.
















































-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6e5bfaca-3726-4286-b4a6-e1faf0218d55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Admin - search_fields + related fields

2014-02-20 Thread Ivan Goncalves
I have these two models below: 

class business(models.Model):
name=models.CharField(max_length=40, blank=True, null=True)

class phone(models.Model):
business=models.ForeignKey(business, 
verbose_name='Business',blank=False)
phone=models.CharField(max_length=40, blank=True, null=True)

in the admin.py

class businessAdmin(admin.ModelAdmin):
model=business
search_fields = phone__phone

How do we make this search work fine ? Ie, bring me all companies that 
possess the phone number entered by the User in the search of the form 
(Admin). ?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ce286f0d-ece0-4897-af50-c0d9e1417f37%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Why does the startproject command open a file instead of creating project folders

2013-12-08 Thread Ivan Ramirez
I had the exact problem today when going through the first part. This 
worked for me:

python “C:\Program Files\Anaconda\Scripts\django-admin.py” startproject 
mysite

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cc056610-83d8-4d1f-a991-ad9a616d1fdd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: (3rd party app) How to safely reverse a custom user model admin url?

2013-10-28 Thread Ivan VenOsdel
No takers? Maybe I am giving everyone a case of TL;DR.

More simply, how do I put {{ app_label }}_{{ model_name }}_changelist in a 
template for a custom auth_user model without knowing the details of said 
model? 

I am guessing I don't want to refer to settings.auth_user_model in the 
template. It feels like the only way is to use the tag in that case and 
instead somehow call the changelist function (wherever that is) in the 
view. If so, anyone know how to do that?

On Friday, October 25, 2013 7:39:59 PM UTC-5, Ivan VenOsdel wrote:
>
> My project uses a custom user model and I am trying to use a 3rd party app 
> that uses the Reversing Admin 
> URLs<https://docs.djangoproject.com/en/dev/ref/contrib/admin/#reversing-admin-urls>technique
>  to enhance my administration interface.
>
> However problems arise when the app tries to make use of the url template 
> tag to do a reverse lookup on the auth user ModelAdmin instance. When 
> 'auth_user_(something)' is referenced directly the template will produce a 
> NoReverseMatch error. 
>
> I would like to produce a patch for the package maintainer but I am unsure 
> of how to reference the stand in user model without tying the app to my 
> project or doing something kludgy that goes against the spirit of the 
> django url tag.
>
> The specific app I have been working with is the django-blog-zinnia 
> application. Zinnia is using the following technique to provide changeset 
> details in a generic way through the Django admin. 
>
> The problem occurs when it tries to reverse auth_user_* when the site is 
> using a custom user model. For Zinnia it occurs in the following places.
>
>- 
>
> https://github.com/Fantomas42/django-blog-zinnia/blob/develop/zinnia/templates/admin/zinnia/widgets/_content_stats.html#L36
>- 
>
> https://github.com/Fantomas42/django-blog-zinnia/blob/develop/zinnia/templates/zinnia/entry_list.html#L84
>
> I have already 
> reported<https://github.com/Fantomas42/django-blog-zinnia/pull/217#issuecomment-26962507>this
>  issue to the Zinnia maintainer however I would like to provide 
> something more meaningful in the way of a patch. Replacing the auth_user 
> part of the offending lines with 'myapp_customuser' will fix the issue for 
> me but how do I do something that is viable for a 3rd party application?
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/64ea3064-aa5f-41f6-b02e-58e2db49798f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(3rd party app) How to safely reverse a custom user model admin url?

2013-10-25 Thread Ivan VenOsdel
My project uses a custom user model and I am trying to use a 3rd party app 
that uses the Reversing Admin 
URLstechnique
 to enhance my administration interface.

However problems arise when the app tries to make use of the url template 
tag to do a reverse lookup on the auth user ModelAdmin instance. When 
'auth_user_(something)' is referenced directly the template will produce a 
NoReverseMatch error. 

I would like to produce a patch for the package maintainer but I am unsure 
of how to reference the stand in user model without tying the app to my 
project or doing something kludgy that goes against the spirit of the 
django url tag.

The specific app I have been working with is the django-blog-zinnia 
application. Zinnia is using the following technique to provide changeset 
details in a generic way through the Django admin. 

The problem occurs when it tries to reverse auth_user_* when the site is 
using a custom user model. For Zinnia it occurs in the following places.

   - 
   
https://github.com/Fantomas42/django-blog-zinnia/blob/develop/zinnia/templates/admin/zinnia/widgets/_content_stats.html#L36
   - 
   
https://github.com/Fantomas42/django-blog-zinnia/blob/develop/zinnia/templates/zinnia/entry_list.html#L84

I have already 
reportedthis
 issue to the Zinnia maintainer however I would like to provide 
something more meaningful in the way of a patch. Replacing the auth_user 
part of the offending lines with 'myapp_customuser' will fix the issue for 
me but how do I do something that is viable for a 3rd party application?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/11e950f6-a0da-4cc5-bb9c-ea88025915f8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django South - SyntaxError: invalid syntax (, line 1)

2013-09-30 Thread Ivan Goncalves
Hi 

I'm having trouble with the South.

In the model below:

class Carrier (models.Model):
 name = models.CharField (max_length = 40, blank = False, null = False, 
verbose_name = 'Name')
 user = models.ForeignKey (User, blank = True, null = True)

 def save (self, force_insert = False, force_update = False):
 self.nome self.nome.upper = ()
 super (Carrier, self). save (force_insert, force_update)

 def __ unicode__ (self):
 return u '% s'% (self.nome)

the error occurs when i run the migrate after South on the app.
SyntaxError: invalid syntax (, line 1)

But if my model does not have the user field, then the error message does 
not occur, as shown below:

class Carrier (models.Model):
 name = models.CharField (max_length = 40, blank = False, null = False, 
verbose_name = 'Name')

 def save (self, force_insert = False, force_update = False):
 self.nome self.nome.upper = ()
 super (Carrier, self). save (force_insert, force_update)

 def __ unicode__ (self):
 return u '% s'% (self.nome)


I need the field User. What I have to do ?

Thanks a lot.

Ivan 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45f2764c-c903-41c2-b692-2afb9f9332ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django.contrib.auth and username's field size

2013-08-02 Thread Ivan Voras
On Thursday, 25 July 2013 23:36:49 UTC+2, jondbaker wrote:

> Hi Ivan, and welcome. Django >= 1.5 features custom User models, which I 
> believe would solve your problem: 
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
>

Hello,

I have looked at the documentation basically it looks like too much work 
for a simple thing. Are there any benefits to using the contrib.auth 
infrastructure instead of simply adding an e-mail and password fields to my 
existing model describing a user's profile (except for authorization in the 
contrib.admin app which is nice but will never be seen by my end users)?

In the future I'm planning on adding authentication over Facebook's and 
Google's services (OAuth) - would these kind of things be more convenient 
to do with contrib.auth or my own auth data?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.contrib.auth and username's field size

2013-07-27 Thread Ivan Voras
Thanks, everyone!

While I'm here: is there a way to create additional db objects in the
syncdb phase? Specifically, I'd like to create some database VIEWs as
a means of avoding using raw queries in my code. Ideally, I would like
a way of specifying my own SQL which creates a Model's database object
(so I can do a CREATE VIEW instead of CREATE TABLE), or something like
that.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.contrib.auth and username's field size

2013-07-25 Thread Ivan Voras
Thanks!

While I have a newbie thread going, let me ask you one more thing: I like 
the concepts behind Django models, but what are the best practices for 
organizing models into files for large-ish scale projects? Keeping all 
model classes in a single models.py file is not scalable, and I'd rather 
have a file-per-class situation, at least for some of them. The reason for 
this is that I suspect the models will grow functionalities encapsulating 
more complex behaviour than simple database operations. 

Or is the best practice to keep models simple - basically a database schema 
description - and create new, more complex classes containing specific code?



On Thursday, 25 July 2013 23:36:49 UTC+2, jondbaker wrote:
>
> Hi Ivan, and welcome. Django >= 1.5 features custom User models, which I 
> believe would solve your problem: 
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
>
>
> On Thu, Jul 25, 2013 at 3:25 PM, Ivan Voras <ivo...@gmail.com
> > wrote:
>
>> Hello,
>>
>> I'm new to Django, and still finding out how it all fits together. I've 
>> seen django.contrib.auth and I'm wondering - is it a common practice to 
>> actually use it as a basis for application authentication?
>>
>> If so, I have a question: the username field as defined (30 characters) 
>> is too short for me. Is there an easy way to override the default field 
>> size?
>>
>> What I'm actually trying to do is this: I'm thinking of using e-mail 
>> addresses for user names, with the "username" field holding a lowercase 
>> address (to make use of the unique index) and the "email" field will store 
>> the address as entered by the user. The default length of the "email" field 
>> is good enough (75) but the "username" field is too short.
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Jonathan D. Baker
> Developer
> http://jonathandbaker.com
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




django.contrib.auth and username's field size

2013-07-25 Thread Ivan Voras
Hello,

I'm new to Django, and still finding out how it all fits together. I've 
seen django.contrib.auth and I'm wondering - is it a common practice to 
actually use it as a basis for application authentication?

If so, I have a question: the username field as defined (30 characters) is 
too short for me. Is there an easy way to override the default field size?

What I'm actually trying to do is this: I'm thinking of using e-mail 
addresses for user names, with the "username" field holding a lowercase 
address (to make use of the unique index) and the "email" field will store 
the address as entered by the user. The default length of the "email" field 
is good enough (75) but the "username" field is too short.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django1.5 - url resolver vs i18n_patterns : wrong behaviour

2013-06-06 Thread Ivan Tatarchuk
Not shure if I understand you correctly, but if I use static linking all 
works fine.
Problem appears only with dynamic linking(like in admin templates).
Is this a feature or a kind of bug? 
really want to use django's i18n_patterns in my project, but can't 
understand how to escape from this case. ='(

вторник, 4 июня 2013 г., 17:38:05 UTC+3 пользователь Ramiro Morales написал:
>
> On Tue, Jun 4, 2013 at 6:23 AM, Ivan Tatarchuk 
> <ivan.v.t...@gmail.com > wrote: 
>
> > from django.conf.urls import patterns, include, url 
> > from django.conf.urls.i18n import i18n_patterns 
> > 
> > urlpatterns = patterns('', 
> > url(r'^admin/', include(admin.site.urls)), 
> > ) 
> > 
> > urlpatterns += i18n_patterns('', 
> > #   url(r'^other/', include('apps.other.urls')), 
> > } 
> > 
> > now {% url 'admin:password_change' %} resolved as 
> 'admin/password_change' 
> > (normal behaviour) 
> > but if we uncomment line in i18n_patterns it will be resolved  as 
> > 'curr_lang/admin/password_change' 
> > 
> > Can somebody explaine my why? 
>
> Can you try to isolate reduce and isolate your environment to something 
> similar 
> to a test case so we can find the reason of that behavior? 
>
> I've just added a test to our test suite exercising (correct behavior 
> in) a similar scenario: 
>
>
> https://github.com/django/django/blob/master/tests/i18n/patterns/urls/default.py#L9
>  
>
> https://github.com/django/django/blob/master/tests/i18n/patterns/urls/included.py
>  
>
> https://github.com/django/django/blob/master/tests/i18n/patterns/tests.py#L52 
>
> The only difference is that in your case you are including the admin 
> dynamic, 
> namespaced url map so laying with some variation there would be a good way 
> to 
> get further. 
>
> Regards, 
>
> -- 
> Ramiro Morales 
> @ramiromorales 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django1.5 - url resolver vs i18n_patterns : wrong behaviour

2013-06-04 Thread Ivan Tatarchuk
When I using i18n_patterns in my project urls.py I have strange behaviour 
of url resolver:
  expected behaviour: 
 - if pattern defined in django.conf.urls.patterns, url resolver 
doesn't add language prefix
- ip pattern defined in django.conf.urls.i18n.i18n_patterns, url 
resolver adds language prefix at the begining of url
 
  actual behaviour
  if NO patterns defined in i18n_patterns, all work fine
  but if some pattern defined in  i18n_patterns, url resolver add 
language prefix to ALL urls resoved by url resolver regardless of place of 
pattern defenition (django.conf.urls.patterns or 
django.conf.urls.i18n.i18n_patterns)

Example:

* urls.py *
from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns

urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
)

urlpatterns += i18n_patterns('',
#   url(r'^other/', include('apps.other.urls')),
}

now {% url 'admin:password_change' %} resolved as 'admin/password_change' 
(normal behaviour)
but if we uncomment line in i18n_patterns it will be resolved  as 
'curr_lang/admin/password_change'

Can somebody explaine my why?
Thanks


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Is file based cache is safe for concurrent process?

2013-03-26 Thread Ivan Smirnoff
Hi all.
Can anyone tell, does django.cache locks file for writing by concurrent 
process?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [offtopic] put a title

2012-12-22 Thread Ivan Ivanov
Just a little hint – it woud be good, when you put an informative title
of your emails, so the people can orient what the topic of the email is.

Best wishes!

Ivan

На Sat, 22 Dec 2012 10:16:16 +0530
vinoth kumar renganathan <vinoth.vinothre...@gmail.com> написа:

> i am new user to  django .and i don't know how to add .html
> files (template dirs ) to  the apps folders  .what are the things
> want to change in settings.py
> 
> 
> the error will be templatedoesnotexist
>/polls
>   /admin.py
>   /__init__.py
>  /models.py
>  /tests.py
>   /urls.py
>   /views.py
>   /template
>/polls
> /index.html
> and this order will be correct or not
> 
> for example this will be codings
> 
>  {% if latest_poll_list %}
> 
> {% for poll in latest_poll_list %}
>  href="/polls/{{ poll.id }}/">{{ poll.question }} {% endfor %}
> 
> {% else %}
> No polls are available.
> {% endif %}
> 
> is it necessary to add htmltag ,header tag and doctype before this
> html codings
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and LDAP

2012-09-13 Thread Ivan Pavlović
Thank you sbrandt. I found the same thing, but i don't know how to use it.
Where do i need to copy the files and do i erase some lines of the code or
not, to make them as comments. I'm trying but i am not succeeding at making
it work...

Can you help me about that?

On Thu, Sep 13, 2012 at 10:16 AM, sbrandt wrote:

> Did you know there is django-auth-ldap which is a custom backend for
> authenticating users through LDAP?
> http://pypi.python.org/pypi/django-auth-ldap/
>
> I don't see the point why you fiddle around with writing code on your own.
> I'm using django-auth-ldap since one and a half year in production and it
> works like a charm.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/4Go12iWz_pEJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and LDAP

2012-09-11 Thread Ivan Pavlović
I appreciate it Thomas :)

On Wed, Sep 12, 2012 at 12:11 AM, Ivan Pavlović
<pavlovic.ivan...@gmail.com>wrote:

> Once again, thank you. If you have some advices or pointers where to start
> (besides the ones you've already mentioned), how to develop my knowledge,
> please feel free to share with me.
>
> Grateful
> Tony
>
>
> On Wed, Sep 12, 2012 at 12:05 AM, Mike Dewhirst <mi...@dewhirst.com.au>wrote:
>
>> On 12/09/2012 7:49am, Ivan Pavlović wrote:
>>
>>> Thank you Mike for your answer. I started this topic, because i have an
>>> assignment at my Faculty, which requires connection between Django and
>>> an LDAP (assistant insisted on 389ds). I installed Django, enabled
>>> admin, logged in through Firefox. I can't make up my mind, do i need to
>>> connect Django and LDAP like so that all users from LDAP can login
>>> through e.g. localhost:8000/admin, or do i need to make a register/login
>>> page, where users from LDAP server can login and onlu admin can login
>>> from admin page? The second is mpre logical to me, but i don't know,
>>> because i am new to Django and Python.
>>>
>>
>> It is immaterial where it is hosted except localhost:8000 is usually the
>> development machine running the development server. It comes with a caveat
>> "not for production use". You really need a production web server for
>> production.
>>
>> Your other questions are unanswerable without a set of specs. You can use
>> the admin or not and you can use the login/auth with your own app and/or
>> the admin depending on the url you use. Users can be permitted to use the
>> admin or not depending on user.is_staff
>>
>> There is no substitute for getting started.
>>
>>
>>>
>>>
>>> On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst <mi...@dewhirst.com.au
>>> <mailto:mi...@dewhirst.com.au>**> wrote:
>>>
>>> On 11/09/2012 4:14am, Tony wrote:
>>>
>>> Hi everybody,
>>>
>>> I am new to Django and Python, and right now, i am going through
>>> the
>>> documentation. I have an assignment at my Faculty, where i need
>>> to
>>> install Django, 389ds LDAP server (where i have to store my
>>> users) and i
>>> need to somehow connect them two, so i can auth users from LDAP
>>> when
>>> logging into Django. i have read some documentation, and i saw a
>>> massive
>>> lines of code, add this, add that, and i don't get any of that.
>>>
>>>
>>> I think the best first step is to tightly specify your requirements.
>>> There are lots of different approaches and your choice of available
>>> open source depends a lot on what you want to do. For example, you
>>> may be interested in ldap group membership being related to Django
>>> groups.
>>>
>>> Being new to Python and Django isn't a problem. Look at Mark
>>> Pilgrim's Dive into Python (the first one which covers Python 2.x)
>>> then do the Django tutorials up to the point where the Django Admin
>>> is working for you. That will demonstrate "add this, add that" and
>>> make it easier for you. Also, install pip for fetching this and that!
>>>
>>> The Django Admin auth will happily/easily accept external auth
>>> backends.
>>>
>>> I have stopped using ldap nowadays but when I had it working the
>>> general principle employed was to query the ldap server and if it
>>> authenticated the offered userid and password AND the userid didn't
>>> exist in the Django user table, the backend inserted a new record.
>>>
>>>  >From my own experience I can recommend you start with a plan to
>>> unit test absolutely everything. The ldap side of things is tricky.
>>> Once you get your head around Python and Django you will really
>>> appreciate the nth degree of flexibility.
>>>
>>> Good luck
>>>
>>> Mike
>>>
>>>
>>>
>>> Can someone please help me with this issue, i'll be very
>>> grateful.
>>>
>>> Thank you
>>>
>>> --
>>> You received this message because you are subscribed to the
>>> Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> h

Re: Django and LDAP

2012-09-11 Thread Ivan Pavlović
Once again, thank you. If you have some advices or pointers where to start
(besides the ones you've already mentioned), how to develop my knowledge,
please feel free to share with me.

Grateful
Tony

On Wed, Sep 12, 2012 at 12:05 AM, Mike Dewhirst <mi...@dewhirst.com.au>wrote:

> On 12/09/2012 7:49am, Ivan Pavlović wrote:
>
>> Thank you Mike for your answer. I started this topic, because i have an
>> assignment at my Faculty, which requires connection between Django and
>> an LDAP (assistant insisted on 389ds). I installed Django, enabled
>> admin, logged in through Firefox. I can't make up my mind, do i need to
>> connect Django and LDAP like so that all users from LDAP can login
>> through e.g. localhost:8000/admin, or do i need to make a register/login
>> page, where users from LDAP server can login and onlu admin can login
>> from admin page? The second is mpre logical to me, but i don't know,
>> because i am new to Django and Python.
>>
>
> It is immaterial where it is hosted except localhost:8000 is usually the
> development machine running the development server. It comes with a caveat
> "not for production use". You really need a production web server for
> production.
>
> Your other questions are unanswerable without a set of specs. You can use
> the admin or not and you can use the login/auth with your own app and/or
> the admin depending on the url you use. Users can be permitted to use the
> admin or not depending on user.is_staff
>
> There is no substitute for getting started.
>
>
>>
>>
>> On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst <mi...@dewhirst.com.au
>> <mailto:mi...@dewhirst.com.au>**> wrote:
>>
>> On 11/09/2012 4:14am, Tony wrote:
>>
>> Hi everybody,
>>
>> I am new to Django and Python, and right now, i am going through
>> the
>> documentation. I have an assignment at my Faculty, where i need to
>> install Django, 389ds LDAP server (where i have to store my
>> users) and i
>> need to somehow connect them two, so i can auth users from LDAP
>> when
>> logging into Django. i have read some documentation, and i saw a
>> massive
>> lines of code, add this, add that, and i don't get any of that.
>>
>>
>> I think the best first step is to tightly specify your requirements.
>> There are lots of different approaches and your choice of available
>> open source depends a lot on what you want to do. For example, you
>> may be interested in ldap group membership being related to Django
>> groups.
>>
>> Being new to Python and Django isn't a problem. Look at Mark
>> Pilgrim's Dive into Python (the first one which covers Python 2.x)
>> then do the Django tutorials up to the point where the Django Admin
>> is working for you. That will demonstrate "add this, add that" and
>> make it easier for you. Also, install pip for fetching this and that!
>>
>> The Django Admin auth will happily/easily accept external auth
>> backends.
>>
>> I have stopped using ldap nowadays but when I had it working the
>> general principle employed was to query the ldap server and if it
>> authenticated the offered userid and password AND the userid didn't
>> exist in the Django user table, the backend inserted a new record.
>>
>>  >From my own experience I can recommend you start with a plan to
>> unit test absolutely everything. The ldap side of things is tricky.
>> Once you get your head around Python and Django you will really
>> appreciate the nth degree of flexibility.
>>
>> Good luck
>>
>> Mike
>>
>>
>>
>> Can someone please help me with this issue, i'll be very grateful.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/__**msg/django-users/-/__**
>> 7ArlkeKjY0YJ<https://groups.google.com/d/__msg/django-users/-/__7ArlkeKjY0YJ>
>> 
>> <https://groups.google.com/d/**msg/django-users/-/**7ArlkeKjY0YJ<https://groups.google.com/d/msg/django-users/-/7ArlkeKjY0YJ>
>> >.
>>
>> To post to this group, send email to
>> django-users@googlegroups.com
>> 
>> <mailto:django-users@**googlegroups.com<django-users@googlegroups.com>
>>

Re: Django and LDAP

2012-09-11 Thread Ivan Pavlović
Thank you Mike for your answer. I started this topic, because i have an
assignment at my Faculty, which requires connection between Django and an
LDAP (assistant insisted on 389ds). I installed Django, enabled admin,
logged in through Firefox. I can't make up my mind, do i need to connect
Django and LDAP like so that all users from LDAP can login through e.g.
localhost:8000/admin, or do i need to make a register/login page, where
users from LDAP server can login and onlu admin can login from admin page?
The second is mpre logical to me, but i don't know, because i am new to
Django and Python.



On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst wrote:

> On 11/09/2012 4:14am, Tony wrote:
>
>> Hi everybody,
>>
>> I am new to Django and Python, and right now, i am going through the
>> documentation. I have an assignment at my Faculty, where i need to
>> install Django, 389ds LDAP server (where i have to store my users) and i
>> need to somehow connect them two, so i can auth users from LDAP when
>> logging into Django. i have read some documentation, and i saw a massive
>> lines of code, add this, add that, and i don't get any of that.
>>
>
> I think the best first step is to tightly specify your requirements. There
> are lots of different approaches and your choice of available open source
> depends a lot on what you want to do. For example, you may be interested in
> ldap group membership being related to Django groups.
>
> Being new to Python and Django isn't a problem. Look at Mark Pilgrim's
> Dive into Python (the first one which covers Python 2.x) then do the Django
> tutorials up to the point where the Django Admin is working for you. That
> will demonstrate "add this, add that" and make it easier for you. Also,
> install pip for fetching this and that!
>
> The Django Admin auth will happily/easily accept external auth backends.
>
> I have stopped using ldap nowadays but when I had it working the general
> principle employed was to query the ldap server and if it authenticated the
> offered userid and password AND the userid didn't exist in the Django user
> table, the backend inserted a new record.
>
> From my own experience I can recommend you start with a plan to unit test
> absolutely everything. The ldap side of things is tricky. Once you get your
> head around Python and Django you will really appreciate the nth degree of
> flexibility.
>
> Good luck
>
> Mike
>
>
>
>> Can someone please help me with this issue, i'll be very grateful.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/**msg/django-users/-/**7ArlkeKjY0YJ
>> .
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@**googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/**group/django-users?hl=en
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



with/include template pattern? seeking best practices

2012-09-04 Thread Ivan Kirigin
I find myself writing things like this a lot in django templates

{% for e in some_list %}
{% with e as element %}
{% include "single_element.html" %}
{% endwith %} 
{% enfor %}

This would be in a template which shows a lists of elements, with another 
template that renders a single one. The template single_element.html uses 
element locally. I find this encapsulates my templates well, especially in 
making single_element.html far more reusable.

I've been doing this for a while and wanted to know if there is a better 
way I just don't know about. Also, I don't know the performance 
implications of so many with/include calls. This list could be very long 
(100s or 1000s).

Thanks!
Ivan Kirigin
http://kirigin.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/48yhZIb9P9MJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Models: How to allow users to select an image from a choice of 3 pictures

2012-07-15 Thread Ivan Ivanov
На Sun, 15 Jul 2012 18:26:02 -0700 (PDT)
croberts  написа:

> I am familiar with the use of Field.choices for text.
> 
> However, I'd like the same option for images.  Is this possible?  I
> want users to select one image from a list of 3 and be able to save
> this.  They can later come back in and change it if they wish.  I
> know that in order to save this, it must be in Models.
> 
> The idea:
> 
> Each day, the has the option of selecting an image: happy face, sad
> face, smiley face of how they are feeling.  Their selection is
> saved.  They can go in later to change it if they wish.
> 
> ImageField doesn't seem to do this.  It seems to only allow for
> uploaded images as opposed to a choice.
> 
Use Choice field with image in the option. You do not need FIleField,
couse you don't operate with files at all. You just want to put an
image in a select.

There are several ways to achieve this:
background image (pure html+css)
http://binnyva.blogspot.com/2006/01/icons-for-select-menu-options-in.html

Jquery UI;
or something like this:
http://www.marghoobsuleman.com/jquery-image-dropdown

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: image in browser

2012-06-14 Thread Ivan Ivanov
На Thu, 14 Jun 2012 14:21:00 +0530
Satvir Toor  написа:

> > This is a strange thing to want to do. What are you doing with
> > `img` in the template?
> I am using image_data variable as a image source in the template(html
> file).
> 
> 
>  What should i ??? Image is not displaying.

Use static files for that:
https://docs.djangoproject.com/en/dev/howto/static-files/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: image in browser

2012-06-14 Thread Ivan Ivanov
На Thu, 14 Jun 2012 11:45:19 +0530
Satvir Toor  написа:

> hello,
> 
> i wish to display the image into the browser through a template . I
> used the following code to retrieve the image from Disk and send that
> data to Html file
> 
> def my_image(request):
> image_data = open("/home/toor/Desktop/certificate/logo.png",
> "rb").read() return render_to_response('myapp/bio.html',
> {'img':image_data}, context_instance=RequestContext(request))
> 

Why don't you use static files?

> Now, The image is not availble into the html file that is displaying
> in browser, Tell me where  I m wrong.

You better show us the template too.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is Django Right for Me?

2012-05-27 Thread ivan sugiarto
er. You can also use a HTML5-based
> development approach embedded in a native app container; for example,
> tools like Phonegap [2] and Appcelerator [3] are designed to help out
> here.
>
> [2] http://phonegap.com/
> [3] http://www.appcelerator.com/
>
> I can't say I know of any libraries that can be used to address the
> synchronisation problem -- but then, I haven't really been looking for
> one either. It wouldn't surprise me if there is something out there
> that you could use, but if it does, it's got very little to do with
> the Django side of the fence -- all Django cares about is that you're
> using HTTP to communicate with the server.
>
> So - in summary:
>  * Yes, Django could be a useful part of your tech stack to do what
> you're describing
>  * However, it won't solve the problem on it's own -- you'll need to
> pick a client side framework too.
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
ketika anda mentok, anda bisa memutar atau maju terus, tapi tidak mundur

Ivan Sugiarto Widodo, ST
Commander In Chief
PT Widodo Rekayasa Komputasi
http://ivan-sugi.blogspot.com
http://wirekom.co.id

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Announcement: django-geoshortcuts - GeoJSON and GPX shortcuts for GeoDjango apps

2012-01-12 Thread Ivan Mincik
Hi,
we have created small Django application package for serving some GIS
geospatial formats from Django queryset data. Currently supported
formats are GeoJSON and GPS via 'render_to_geojson' and 'render_to_gpx
shortcuts'.

If You are interested, please have a look here [1].
Comments, patches and whatever else is welcome.



[1] -  https://github.com/gista/django-geoshortcuts


Ivan Mincik, Gista s.r.o.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Android browser and csrf protection

2011-10-20 Thread Ivan Uemlianin
Dear All

Just to follow up slightly:

- iPhone and Blackberry browsers access the site properly;
- the Android browser gets the csrf errors with django 1.2 and django
1.3
- with another site I'd developed earlier on django 1.2, the Android
browser passes csrf verification properly.
- the "failing" site is on webfaction, the Working" site is on a bare
machine (centos, nginx, etc).

Does anyone have any suggestions as to what's going on?  Why should
the Android browser be behaving differently to all the others?

Best wishes

Ivan

On Oct 19, 3:17 pm, Ivan Uemlianin <ivan.llai...@gmail.com> wrote:
> Dear All
>
> I have a django webapp with a very simple login page, a form with
> username, password and the {% csrf %} tag.  The page works as expected
> when using Chrome, Firefox and Safari, but when trying to login from
> my Android phone browser, the page returns the "CRSF verification
> failed" error page (django running debug=True for the moment).
> However, I have been logged in: if I reload the page, I get the page I
> was expecting, along with the user details.
>
> eg.com/login/  #  ok, enter username "tu01", password, send
> eg.com/profile/  #  error: csrf verification failed, reload
> eg.com/profile/  #  ok, "tu01"'s homepage
>
> Has anyone else had odd behaviour like this from the Android browser?
> Can anyone suggest what might be the problem?
>
> (Haven't tested with iPhone or Blackberry yet, will do do this
> evening).
>
> With thanks and best wishes
>
> Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Android browser and csrf protection

2011-10-19 Thread Ivan Uemlianin
Dear All

I have a django webapp with a very simple login page, a form with
username, password and the {% csrf %} tag.  The page works as expected
when using Chrome, Firefox and Safari, but when trying to login from
my Android phone browser, the page returns the "CRSF verification
failed" error page (django running debug=True for the moment).
However, I have been logged in: if I reload the page, I get the page I
was expecting, along with the user details.

eg.com/login/  #  ok, enter username "tu01", password, send
eg.com/profile/  #  error: csrf verification failed, reload
eg.com/profile/  #  ok, "tu01"'s homepage

Has anyone else had odd behaviour like this from the Android browser?
Can anyone suggest what might be the problem?

(Haven't tested with iPhone or Blackberry yet, will do do this
evening).

With thanks and best wishes

Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner a bit lost - need some pointers please

2011-10-05 Thread Ivan Ivanov
На Wed, 5 Oct 2011 15:02:13 -0500
Javier Guerra Giraldez  написа:

> about how to write, check the paragraph about the MTV architecture:

If you are familier with MVC (Model, View, Controller), MTV is the same
but with different component names.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: howto disable label for field in admin app form?

2011-10-04 Thread Ivan Ivanov
Source:
https://docs.djangoproject.com/en/dev/ref/forms/api/#configuring-html-label-tags
If auto_id is False, then the form output will not include  tags
nor id attributes:
f = ContactForm(auto_id=False)

I think, this is exactly what you want.

На Tue, 4 Oct 2011 14:34:56 +0200
Aljoša Mohorović  написа:

> On Tue, Oct 4, 2011 at 2:22 PM, BILLION Sébastien
>  wrote:
> > It's a strange question...
> > You can replace an admin template with {% extends
> > "admin/change_form.html %} for example.
> 
> i don't see why it's a strange question, i have a form field and i
> would like to disable rendering of label?
> i appreciate suggestions and did consider overriding admin templates
> but "admin/change_form.html" is messy and don't know if it's a smart
> thing to do in my case.
> i've expected some option where i can set label=None by overriding
> field/widget init and disable label.
> thanks for suggestions but i think i'll just use javascript to remove
> label.
> 
> Aljosa
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django-CMS and inherit plugin

2011-10-04 Thread Ivan Ivanov
Hi all!

It's a silly question, but I cannot get it.
What does this mean:
„The inherit plugin is currently the only core-plugin which can not be
used in non-cms placeholders.“
This is taken from the Django-CMS documentation:
http://docs.django-cms.org/en/2.2/getting_started/plugin_reference.html#inherit

The plugin is properly installed and I can add it from the admin, but
when I try to see the public page with my basic template, I've made
with the tutorial, I become the following error:

Caught AttributeError while rendering: 'NoneType' object has no
attribute 'render_plugin'

The problem is in the template on the following line:
{% placeholder "template_1_content" %} 

I know, that this has something to do with the sentence from the docs,
I cannot understand, but I am stuck...

Thanks for the help!

Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: mysql installation error

2011-09-20 Thread Ivan Ivanov
First – It's not a Django question,

and second search, read, but try:
http://www.fuyun.org/2009/12/install-mysql-for-python-on-windows/

That was the second result I found :)

I hope, it is what you need, couse I don't use windows and cannot test
the problem and its solution.

Ivan

На Tue, 20 Sep 2011 22:59:30 -0400
PremAnand Lakshmanan <prem1...@gmail.com> написа:

> Hi,
> 
> When I try to install mysql I get the following error,
> 
> Pls provide your inputs.
> 
> C:\MYSQL\MySQL-python-1.2.3\MySQL-python-1.2.3>python setup.py install
> Traceback (most recent call last):
>   File "setup.py", line 15, in 
> metadata, options = get_config()
>   File
> "C:\MYSQL\MySQL-python-1.2.3\MySQL-python-1.2.3\setup_windows.py",
> line 7 , in get_config
> serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
> options['registry_ke
> y'])
> WindowsError: [Error 2] The system cannot find the file specified
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Extending admin's index view

2011-09-02 Thread Ivan Ivanov
Hallo everybody!

I've got problem exteding the admin's index view. I need to pass
extra_context to the index of the admin, after the administrator logged
in, that's why I'm trying to extend the view. So...

What I've got is:

In the root of the project I modified urls.py like following:
   (r'^admin/$', project.admin.admin_site.index),
   (r'^admin/', include(admin.site.urls)),

Again in the root of the project I've got admin.py with the following
snippet of code:

[...]
class AdminSiteRegistryFix( object ):
'''
This fix links the '_registry' property to the orginal AdminSites
'_registry' property. This is necessary, because of the character of
the admins 'autodiscover' function. Otherwise the admin site will
say, that you havn't permission to edit anything.
'''

def _registry_getter(self):
return default_site._registry

def _registry_setter(self,value):
default_site._registry = value

_registry = property(_registry_getter, _registry_setter)


class MyAdmin(sites.AdminSite, AdminSiteRegistryFix):
@never_cache
def index(self, request, extra_context={}):
last_report_date = models.Reports.objects.latest().entry_date
now = datetime.now() 
delta = now - last_report_date
extra_context['last_report_interval'] = delta.days

return super(MyAdmin, self).index(request, extra_context)

admin_site = MyAdmin()


And it works. I've got the last_report_interval in the index.html
template and I can write my lovely message to the admin. The problem
is, that the ^admin/$ address swiches between the login and index view,
despite of users authentication status. And this is nice, but not
working after my changes, written above. Now I see only the app list of
the index. When I'm not logged in, I just see an empty list, but I've
got no login form...

Can anyone help me, understanding why has my login form disappeared?

What I can see from the django.contrib.admin.sites is that the
admin_view function is the one, calling the login view. But I have
noting to do with it, I haven't modify it and I don't understand what
disturbs it's functionallity.

Thank you in advance for your help!

Ivan Ivanov











-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-22 Thread Ivan Aleman
On 22 June 2011 08:15, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

>
> If you're interested, please reply on-list so others can see.
>
>
>
Sweet! Count me in :)


>
>
-- 
Iván

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: csrf protection and testing with tsung

2011-06-22 Thread Ivan Uemlianin
Dear Malcom

Thanks very much for your help!  You were exactly right.  The
following config works (simplified for exposition).

Best wishes

Ivan




  
  





  





On Jun 21, 5:54 pm, Malcolm Box <malcolm@gmail.com> wrote:
> On 21 June 2011 16:48, Ivan Uemlianin <ivan.llai...@gmail.com> wrote:
>
> > With tsung you record a site visit (called a session) --- log in, view
> > various pages, do a few things, log out --- and tsung will then hit
> > the site with lots of randomised versions of this session.
>
> > Many of the views are csrf protected, and the automated requests tsung
> > generates don't get through the protection.  For the moment I'm just
> > commenting out the csrf middleware in settings.py, but this is
> > obviously inconvenient.
>
> I think you'll need to do some work with dyn_variable to pull the csrf
> token out of the original form and re-inject it into the post you send
> back. As far as I understand it, all that the csrf protection is is an
> opaque value hidden in any form that needs to be present in the
> submitted version to be valid. That stops "loose" posts fromCSRF
> attacks working as they don't know the magic key.
>
> Malcolm

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: csrf protection and testing with tsung

2011-06-21 Thread Ivan Uemlianin

Dear Malcolm

Thanks, this is a good clue.  I'll try it out tomorrow and report back.

Best wishes

Ivan


On 21/06/11 17:54, Malcolm Box wrote:

On 21 June 2011 16:48, Ivan Uemlianin<ivan.llai...@gmail.com>  wrote:

With tsung you record a site visit (called a session) --- log in, view
various pages, do a few things, log out --- and tsung will then hit
the site with lots of randomised versions of this session.




Many of the views are csrf protected, and the automated requests tsung
generates don't get through the protection.  For the moment I'm just
commenting out the csrf middleware in settings.py, but this is
obviously inconvenient.



I think you'll need to do some work with dyn_variable to pull the csrf
token out of the original form and re-inject it into the post you send
back. As far as I understand it, all that the csrf protection is is an
opaque value hidden in any form that needs to be present in the
submitted version to be valid. That stops "loose" posts from CSRF
attacks working as they don't know the magic key.

Malcolm




--
====
Ivan A. Uemlianin
Speech Technology Research and Development

i...@llaisdy.com
 www.llaisdy.com
 llaisdy.wordpress.com
 www.linkedin.com/in/ivanuemlianin

"Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
 (Schiller, Beethoven)


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



csrf protection and testing with tsung

2011-06-21 Thread Ivan Uemlianin
Dear All

I have a live(ish) django website which I'm testing with tsung.

With tsung you record a site visit (called a session) --- log in, view
various pages, do a few things, log out --- and tsung will then hit
the site with lots of randomised versions of this session.

Many of the views are csrf protected, and the automated requests tsung
generates don't get through the protection.  For the moment I'm just
commenting out the csrf middleware in settings.py, but this is
obviously inconvenient.

Has anyone used tsung on csrf-protected views?  If so, how did you do
it?

Has anyone done similar automated requests on csrf-protected views?
How?

I've read the django docs about csrf protection, but I'm not quite
clear how it works.  Can anyone point me to documentation on how it
works (and then I might be able to write something into the tsung
scripts to comply with it).

With thanks and best wishes

Ivan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problems with "Polls app"

2011-05-22 Thread Ivan Galic
What exactly is the problem? 'couldn't do it ok' isn't telling much.

You do seem to have some problems with the indentation though.

Ivan

On May 22, 2011, at 10:51 AM, abilondias wrote:

> Hello everyone,
> I was trying Django and building the first app in the tutorial so I
> couldnt do it ok
> 
> [manage.py]
> 
> import datetime
> from django.db import models
> 
> class Poll(models.Model):
>question = models.CharField(max_length=200)
>   pub_date = models.DateTimeField('date published')
>   def __unicode__(self):
>   return self.question
>   def was_published_today(self):
>   return self.pub_date.date() == datetime.date.today()
> 
> class Choice(models.Model):
>poll = models.ForeignKey(Poll)
>choice = models.CharField(max_length=200)
>votes = models.IntegerField()
> 
>   def __unicode__(self):
>return self.choice
> 
> Thanks
> ~abilondias
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-18 Thread Ivan Galic
Ok, I got it to work.

Since the exception said " 'Site'  matching query does not exist", and the docs 
said something about the SITE_ID describing the site in the django_site 
database table, I went ahead and took a look at my (sqlite) database. The 
django_site table was empty, so I added a row with id==1 (the same that I have 
in settings.py) and then it worked. 

However, I still don't understand what went wrong. Who should be responsible 
for putting that table row in the database? I ran syncdb several times (to make 
sure I didn't miss it :) ), but it didn't help.

Ivan

On May 18, 2011, at 8:34 AM, Gabriel Gunderson wrote:

> On Tue, May 17, 2011 at 11:53 AM, igalic <ivan.ga...@gmail.com> wrote:
>> I went through the first part of the tutorial without problems, but
>> when trying to turn on the admin app in tutorial 2, I got this error
>> page with the message stated in subject line.
>> 
>> Here's more info:
>> 
>> Django: latest version from the trunk
>> Python: 2.6.1
>> OS: OSX 10.6.7
>> 
>> Here's the info it gives me:
>> 
>> DoesNotExist at /admin/
>> Site matching query does not exist.
> 
> 
> It looks like it's related to the sites framework:
> http://docs.djangoproject.com/en/dev/ref/contrib/sites/
> 
> I'd have a look at what's in my settings file for SITE_ID and take it
> from there.
> http://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SITE_ID
> 
> Let us know if you don't figure it out.
> 
> 
> Best,
> Gabe
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem in Part2 of the tutorial "DoesNotExist at /admin/"

2011-05-18 Thread Ivan Galic

On May 18, 2011, at 8:34 AM, Gabriel Gunderson wrote:

> On Tue, May 17, 2011 at 11:53 AM, igalic <ivan.ga...@gmail.com> wrote:
>> I went through the first part of the tutorial without problems, but
>> when trying to turn on the admin app in tutorial 2, I got this error
>> page with the message stated in subject line.
>> 
>> Here's more info:
>> 
>> Django: latest version from the trunk
>> Python: 2.6.1
>> OS: OSX 10.6.7
>> 
>> Here's the info it gives me:
>> 
>> DoesNotExist at /admin/
>> Site matching query does not exist.
> 
> 
> It looks like it's related to the sites framework:
> http://docs.djangoproject.com/en/dev/ref/contrib/sites/
> 
> I'd have a look at what's in my settings file for SITE_ID and take it
> from there.
> http://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SITE_ID
> 
> Let us know if you don't figure it out.

Thanks; unfortunately I haven't been able to move much further along. 
The SITE_ID setting is set to 1, which was automatically generated. My project 
doesn't reference it anywhere. The docs say the default
is "not defined" so I tried deleting it, but then it gave me another error 
(complaining it wasn't defined). Setting it to 0 (a value I thought 
could be sensible) didn't work either. 
Checking the local variables in the exception stack trace, it seems the ID is 
passed properly (at the place where it crashes, in 

django/db/models/query.py in get

the "pk" parameter is 1, which is set at one point below in the stack from 
"sid" (which I assume is 
site_id). 

The code that crashes is this:

•  if self.query.can_filter():
• clone = clone.order_by()
• num = len(clone)
• if num == 1:
• return clone._result_cache[0]
• if not num:
• raise self.model.DoesNotExist("%s matching query does not 
exist."
• % self.model._meta.object_name) ...
• raise self.model.MultipleObjectsReturned("get() returned more 
than one %s -- it returned %s! Lookup parameters were %s"
• % (self.model._meta.object_name, num, kwargs))



In this case, 'num' is nil, and self.model._meta.object_name is 'Site'. 

That's all I've been able to dig out; I'd appreciate any further help. 

I'm surprised I ran into this problem because I was just strictly following the 
tutorial, and I've basically just added some 10 lines of code
to the project. I don't understand what could have gone wrong.

Thanks,
Ivan

> 
> 
> Best,
> Gabe
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django admin site and debug

2011-05-04 Thread Ivan
Try to replace your patern '^admin/' this '^admin/$', or swap
( r'^admin/', include( admin.site.urls ) )
and ( r'', include( 'role.company.urls' ) )

> my urlconf look like this
>
> from django.conf.urls.defaults import patterns, include
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns( '',
>     ( r'^admin/', include( admin.site.urls ) ),
>     ( r'', include( 'role.company.urls' ) ),
>  )
>
> and in the role.company.urls i dont put anything about debug or url
> that can override the admin ones

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How should I properly impliment HTTP(S) auth (REMOTE_AUTH) in django?

2011-02-08 Thread ivan sugiarto
greetings,
a year ago I had the same problem and did not found any solution, after that
i started to build my own HTTP(S) single sign on using PHP (but recently i
ported on the Django) with the work flow like this

login :
clients (consumer) check the credential server using hidden iframe
server (single sign on) check whether the browser has the session and check
whether the clients is on the database using hashed api key
if it has the session server send (via post ) user credential without
password (username, role, email etc)/but also i provided the username using
csv that can be modified to json
clients check if the request ip is from the server if yes then the post
parameters is accepted
servers redirects user to server (hidden iframe)
the clients created the session

you can check it on

https://github.com/ivansugi/django-single-sign-on--soekarno-

i hope it match your requirement

On Wed, Feb 9, 2011 at 8:37 AM, Sean W <whalens...@gmail.com> wrote:

> This is a re-post of my stack overflow question here
> http://stackoverflow.com/questions/4939908/how-should-i-properly-impliment-https-auth-remote-auth-in-django
>
>   Hi,
>
> I am in the planning phase a new project. I want to be able to control
> multiple relays from my android powered phone over the internet. I need to
> use an HTTP based server as a middleman between the phone and the relays.
> Django is my preferred platform because Python is my strongest skill set.
> This would not be a "web app" (with the exception of the admin interface for
> managing the user and their access to the relays). Rather, the server would
> simply provide an API in the form of HTTPS requests and JSON encoding.
> Though, I should note that I have never done any web development in my life,
> so I don't know best practices (yet). The authentication method should meet
> the following criteria:
>
>- Works over HTTPS (self-signed SSL)
>- Provides multi-factor authentication (in the form of something you
>have and something you know)
>- Be reasonably secure (Would be very difficult to fool, guess at. or
>otherwise bypass)
>- Is simple in implementation for the server operator and end user on
>the mobile client
>-
>
>Is lightweight in in terms of both CPU cycles and bandwidth
>
>I plan to use the following scheme to solve this:
>1. An administrator logs into the web interface, creates a user, and
>   sets up his/her permissions (including a username and a password chosen 
> by
>   the user).
>   2. The user starts the client, selects add server, and enters the
>   server URL and his/her credentials.
>   3. The client attempts to authenticate the the user via HTTP auth
>   (over SSL). If the authentication was successful, the server will 
> generate
>   an API key in the form of a UUID and sends it to the client. The client 
> will
>   save this key and use it in all API calls over HTTPS. HTTP auth is only 
> used
>   for the initial authentication process prior to reviving a key, as a 
> session
>   scheme would not be nessessary for this application. Right? The client 
> will
>   only work if the phone is configured to automatically lock with a PIN or
>   pattern after a short timeout. The server will only allow one key to be
>   generated per user, unless an administrator resets the key. Hence, 
> simple,
>   mobile, multifactor authentication.
>
> Is this sound from a security standpoint? Also, can anyone point me to an
> example of how to use the HTTP auth that is built into Django? From a Google
> search, I can find a lot of snipits witch hack the feature together. But,
> none of them implement HTTP auth in the wayit was added to Django in 
> 1.1<http://code.djangoproject.com/ticket/689>.
> The official documentation for REMOTE_AUTH can be found 
> here<http://docs.djangoproject.com/en/1.2/howto/auth-remote-user/>,
> but I am having difficulty understanding the documentation as I am very new
> to Django.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
ketika anda mentok, anda bisa memutar atau maju terus, tapi tidak mundur

Ivan Sugiarto Widodo, ST
Commander In Chief
PT Widodo Rekayasa Komputasi
http://ivan-sugi.blogspot.com
http://wirekom.co.id

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   3   4   5   >