Re: django username and password error

2018-10-17 Thread mottaz hejaze
try this :
https://github.com/teddziuba/django-sslserver



On Wed, Oct 17, 2018 at 1:14 PM Joel  wrote:

> Yes, my server did support ssl. But on my local development environment it
> doesn't support ssl.
>
> On Wed, 17 Oct, 2018, 4:41 PM mottaz hejaze,  wrote:
>
>> does your server support SSL ? did you configure your server for SSL ?
>>
>> On Wed, Oct 17, 2018 at 12:10 PM Joel Mathew  wrote:
>>
>>> After attempting to redirect http to https by
>>> setting SECURE_SSL_REDIRECT to True and a few other changes, suddenly I
>>> found myself locked out of django login. It didnt accept my password, so I
>>> tried resetting it via manage.py passwd and manage.py changepassword. I
>>> even created a new superuser account and tried to login.
>>>
>>> I am unable to login to django admin site and to the custom login which
>>> used to work until yesterday night. I'm at a loss to think of what next to
>>> check. Any ideas?
>>>
>>>
>>> Joel G Mathew
>>>
>>> --
>>> 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/CAA%3Diw_-Md09MU-c7s2hHJ00zEdM0w4yf7hW4t1Cr24VeCEs8-g%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_-Md09MU-c7s2hHJ00zEdM0w4yf7hW4t1Cr24VeCEs8-g%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/CAHV4E-eC2uA7uDQWHm_A0Dh_%3D1txWdqD%2B2H1S4pMT7%3DDbn043w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHV4E-eC2uA7uDQWHm_A0Dh_%3D1txWdqD%2B2H1S4pMT7%3DDbn043w%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/CAA%3Diw_-pDy8usVQL6PFeEmNArTnGQxRfUKtfhyaU%2B9C_yuOwdw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA%3Diw_-pDy8usVQL6PFeEmNArTnGQxRfUKtfhyaU%2B9C_yuOwdw%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/CAHV4E-fXCwN%2BPh%2B2H2GTqnL-Y3S5EdEsb-2GW9UJUEN78PqjSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django username and password error

2018-10-17 Thread mottaz hejaze
does your server support SSL ? did you configure your server for SSL ?

On Wed, Oct 17, 2018 at 12:10 PM Joel Mathew  wrote:

> After attempting to redirect http to https by setting SECURE_SSL_REDIRECT
> to True and a few other changes, suddenly I found myself locked out of
> django login. It didnt accept my password, so I tried resetting it via
> manage.py passwd and manage.py changepassword. I even created a new
> superuser account and tried to login.
>
> I am unable to login to django admin site and to the custom login which
> used to work until yesterday night. I'm at a loss to think of what next to
> check. Any ideas?
>
>
> Joel G Mathew
>
> --
> 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/CAA%3Diw_-Md09MU-c7s2hHJ00zEdM0w4yf7hW4t1Cr24VeCEs8-g%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Help me to Generate CSV through Django View from database - and download the same

2018-10-16 Thread mottaz hejaze
import csvfrom django.http import HttpResponse
def some_view(request):
# Create the HttpResponse object with the appropriate CSV header.
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename="somefilename.csv"'

writer = csv.writer(response)
writer.writerow(['First row', 'Foo', 'Bar', 'Baz'])
writer.writerow(['Second row', 'A', 'B', 'C', '"Testing"', "Here's
a quote"])

return response


On Tue, Oct 16, 2018 at 9:39 AM Shareef 617  wrote:

> Help me to Generate CSV through Django View from database - and download
> the same
>
> --
> 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/d3faf615-5b41-4c5d-ad45-d233e1dbd62a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Best option for hosting django website

2018-10-08 Thread mottaz hejaze
If you are a biggener and don't know how to setup and configure a VPS , use
pythonanywhere 

or if you have a linux experience , use Digitalocean


اذا محتاج اي مساعدة .. راسلني .. اخوك معتز من مصر

-- 
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/CAHV4E-eh%2Bk%3DRGf%3D_n-2%3DBJRNfEv%2Bt70L5iPMTk93d32PAvY7Vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.9.8 with mysql 'Commands out of sync; you can't run this command now' exception

2018-09-23 Thread mottaz hejaze
try

latest_message = Message.objects.filter(example_field=1)[::-1].first()


On Mon, Sep 24, 2018 at 5:55 AM  wrote:

> I am a python developer and I am using Django 1.9.8 for my project.
> I am having a problem with MySQL like below:
>
> I have a model named 'Message' and sometimes when running this code, I got
> the exception 'Commands out of sync; you can't run this command now'
>
> latest_message = 
> Message.objects.order_by("-id").filter(example_field=1).first()
>
> can you point out to me why does it happen and how to fix it?
> thanks,
> Thanh Tran
>
> --
> 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/740fac2d-3399-45d3-bd96-54a76e7f2335%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How can I add more modules to a CORE in the backend so that I may create content pages please?

2018-09-09 Thread mottaz hejaze
do you want to share the news and events in catalog app ???

if this so , in your catalog app directory , in admin.py

from CATC_CORE.models import Event, News

admin.site.register(Event)
admin.site.register(News)

On Mon, Sep 10, 2018 at 12:47 AM KarmaFish  wrote:

> *How can I add more modules to a CORE in the backend so that I may create
> content pages please?*
>
>
> Please forgive I am new.
>
>
>
> --
> 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/90146419-2780-4cf8-8bc7-45cfd0c527bb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: A questionale developer had added exraneous code to image URLS that used to work. I would be gratefuldor your assitamce please?

2018-09-09 Thread mottaz hejaze
please share code ..

Is this image from admin panel or from website front ..

please share models.py , admin.py , views.py and forms.py




On Mon, Sep 10, 2018 at 12:47 AM KarmaFish  wrote:

> Hello we  had no issues uploaded images to our servers pointing toa n
> image name.
> But this Dev came in and changed the code.
> Whenever we upload a new image for a product, after save , we'd go back to
> find that the image name had an automatically generated code added to the
> jpg filename making the image blank.
>
> Where can I fix that please? Remove that superfluous random numbers please?
>
> Thank you in advance,
>
> [image: random.jpg]
>
> --
> 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/eb34f554-04c8-487a-a03b-020a48e0bd14%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: how-to style registration form?

2018-09-09 Thread mottaz hejaze
please full error message

On Mon, Sep 10, 2018 at 12:48 AM V O  wrote:

> i currently try to "style" my registration form. in General i get the
> concept behind it but not at that point:
>
>
> This is how it's intendet to be (and not working):
>
> class RegistrationForm(UserCreationForm):
>> username = forms.CharField(required=True, label='Username',
>> widget=forms.TextInput(attrs={'class': 'class-one-input-fields'}))
>> password1 = forms.CharField(required=True, label='Password',
>> widget=forms.PasswordInput(attrs={'class': 'class-one-input-fields'}))
>> password2 = forms.CharField(required=True, label='Password
>> confirmation', widget=forms.PasswordInput(attrs={'class':
>> 'class-one-input-fields'}))
>> pubpgp = forms.CharField(required=True, label='Public PGP Key',
>> widget=forms.Textarea(attrs={'class': 'class-two-input-fields'}))
>> captcha = CaptchaField()
>>
>> def save(self, commit=True):
>> username = super(RegistrationForm, self).save(commit=False)
>> username.pubpgp = self.cleaned_data['pubpgp']
>>
>> if commit:
>> username.save()
>>
>> return username
>
>
> views.py:
>
> def signup (request):
>> if request.method == 'POST':
>> form = RegistrationForm(request.POST)
>> if form.is_valid():
>> form.save()
>> messages.add_message(request, messages.INFO, "Thanks for
>> you registration, you are now able to login.")
>> return redirect(reverse('post_list'))
>> else:
>> form = RegistrationForm()
>>
>> args = {'form': form}
>> return render(request, 'registration/signup.html', args)
>
>
> The error i get is:
>
> > AttributeError: Manager isn't available; 'auth.User' has been swapped
>> > for 'accounts.User'
>
>
> in my settings.py i set:
>
> > AUTH_USER_MODEL = 'accounts.User'
>
>
> This is the current working state:
>
> class RegistrationForm(UserCreationForm):
>> user = forms.CharField(required=True)
>>
>> class Meta:
>> model = User
>> fields = (
>> 'user',
>> 'password1',
>> 'password2',
>> 'pubpgp'
>> )
>>
>> captcha = CaptchaField()
>>
>> def save(self, commit=True):
>> user = super(RegistrationForm, self).save(commit=False)
>> user.pubpgp = self.cleaned_data['pubpgp']
>>
>> if commit:
>> user.save()
>>
>> return user
>
>
> User model of accounts:
>
> #User Model Manager
>> class UserManager(BaseUserManager):
>> def create_user(self, user, password=None):
>> """
>> Creates and saves a User with the given username and password.
>> """
>> if not user:
>> raise ValueError('Error: The User you want to create must
>> have a username, try again')
>>
>> new_user = self.model(
>> user=self.model.normalize_username(user)
>> )
>>
>> new_user.set_password(password)
>> new_user.save(using=self._db)
>> return new_user
>>
>> def create_staffuser(self, user, password):
>> """
>> Creates and saves a staff user with the given username and
>> password.
>> """
>> new_user = self.create_user(
>> user,
>> password=password,
>> )
>> new_user.staff = True
>> new_user.save(using=self._db)
>> return new_user
>>
>> def create_superuser(self, user, password):
>> """
>> Creates and saves a superuser with the given username and
>> password.
>> """
>> new_user = self.create_user(
>> user,
>> password=password,
>> )
>> new_user.staff = True
>> new_user.admin = True
>> new_user.save(using=self._db)
>> return new_user
>>
>>
>> class User(AbstractBaseUser):
>>
>> #User fields
>> user =
>> models.CharField(verbose_name='username',max_length=30,unique=True)
>> bio = models.TextField(max_length=5000, blank=True, null=True)
>> pubpgp = models.TextField(blank=True, null=True)
>> avatar = fields.ImageField(upload_to='avatar', blank=True,
>> null=True, dependencies=[
>> FileDependency(processor=ImageProcessor(
>> format='JPEG', scale={'max_width': 350, 'max_height':
>> 350}))
>> ])
>>
>> #Account typs
>> active = models.BooleanField(default=True)
>> staff = models.BooleanField(default=False) # a admin user; non
>> super-user
>> admin = models.BooleanField(default=False) # a superuser
>> # notice the absence of a "Password field", that's built in.

Re: serve mp3 files without html5

2018-09-09 Thread mottaz hejaze
please give us more details

On Mon, Sep 10, 2018 at 12:48 AM Mustafa Ryad 
wrote:

> how can i play mp3 file without html5 tag
>
> --
> 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/375600eb-9717-4f80-b034-56d0f6763591%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: What is a standard practice to drop tables of an app in Django?

2018-09-09 Thread mottaz hejaze
make the attribute post_auther null = True , then make migrations



On Sat, Sep 8, 2018 at 6:21 PM Jae Pil Choi  wrote:

> I'm asking this on the official Django community after I asked on
> Stackoverflow because I still don't know what is the best practice for this
> particular action.
>
> (Original Question on Stackoverflow here
> :
> What is Django commend equivalent to Rails' $ rails db drop)
>
> My scenario goes as follow:
>
> 1. I create 2 model class objects, Post, Product in models.py
> 2. Post has 2 attributes: post_title, post_text. Product has its own but
> that's irrelevant.
> 3. I make migrations and migrate.
> 4. Then I go to /admin of my page and add some rows both on Post and
> Product.
>
> 5. Now I remember that I I forgot to add an attribute post_author on Post
> and adds it in models.py
> 6. If I make migrations, Django warns me that already existing rows needs
> default values since they don't have this new attributes.
> 7. I don't want any post without an author so I want to drop this existing
> rows and make it all again.
> 8. However, I don't want to lose any Product rows already created.
>
>
> Here's the question: How do I drop ONLY Post table leaving Product and my
> Superuser intact?
>
> Original Stackoverflow post suggests manually removing db.sqlite3 file and
> migrations files but I really don't think this is the way to go and there
> must be some best practice or commend for this since Django is already at
> 2.1.
>
> If not, I think there must be a good reason not to have one and I want to
> know why.
>
>
>
> --
> 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/a8170e3d-ae7f-4b59-9330-fef33fb9816d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Django for desktop app development

2018-09-09 Thread mottaz hejaze
Luc , man this framework Lino is very Cool ..

محمد عرفني يا هندسة انت عاوز تعمل ايه وربك ييسر اخوك معتز من مصر

On Sun, Sep 9, 2018 at 9:14 AM Luc Saffre  wrote:

> Hi Muhammad,
>
> we do write and maintain desktop applications for our customers using
> Django. But before feeling able to offer this we wrote Lino, a kind of
> "intrusive" Django application which replaces the Admin by a new
> desktop-like user interface (currently based on ExtJS). It also replaces
> the permissions system by a class-based approach. Because of its
> intrusiveness we consider it a framework based on Django. Our first
> production site went alive in January 2011. We believe that Lino has a
> bright future and should be used by other companies as well.
> Lino framework: http://lino-framework.org
> My company: https://saffre-rumma.net/
>
> Luc
>
> On 07.09.2018 15:16, Muhammad Dilshad Khaliq wrote:
>
> I am final year student of software engineering.My final year project is
> about fee management system where student submit fee online and
> administrator use this system for managing fee and scholarship of student
> and notifying them about their any issue.So can i  make web based
> application or desktop application for administration site and notify
> student through mobile application.?*Is it good idea to use Django for
> desktop application?*
> --
> 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/199c0ed7-ce95-42e4-b391-462a491c22fe%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/891bbd90-86a1-54f7-e8d2-88c06d2a39ee%40gmx.net
> 
> .
> 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/CAHV4E-cjsio2fThUeROrxn1MGmOdvx9NxZQRsWdg%3D8c3k4_zTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Convoluted setup information

2018-08-18 Thread mottaz hejaze
what is your operating system ?
what problems do you have

On Sat, Aug 18, 2018 at 7:44 PM,  wrote:

> Hi, I'm new to Django and I found the setup guide pretty useless. Had to
> refer to many articles on stackoverflow just to get basic django
> (+pip+python+virtualenv) installed.
> Why make it so complicated?
> Why not include screenshots?
>
> Also rather than pointing only to this group for help why not link to the
> best stackoverflow articles that cover the problems commonly faced by new
> users?
>
> --
> 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/025c7e3c-850f-439a-8b08-a3fdb5d44404%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Wrting rtl templates for my web site

2018-08-18 Thread mottaz hejaze
يا عم محمد ده شغل css ابعتلي الكود وانا اشوفه .. ده ملوش علاقه بالدجانجو

On Fri, 17 Aug 2018, 13:34 Mohamed El-sayed, <
mohamed.elsayed.abdel...@gmail.com> wrote:

> Hello Guys,
> I have a question related to rtl templates
> what i need is making a web site with heading rtl (Arabic language) and i
> don't know how to make it
> First i used the RTL boot strap version with out integrating with django
> just a normal HTML file and the output was as expected
>
> [image: Capture.PNG]
> Then when i integrated this page with django template the output is as
> following
>
> [image: Capture_1.PNG]
>
> Please advice me what shall i do to make it totally as expected as most of
> the out put written in arabic put with LTR heading.
>
> Thanks 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/34fa7d0f-34bc-48eb-9aed-bfeef3a56a09%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: changes in django appilcation

2018-08-16 Thread mottaz hejaze
You can use git

On Thu, 16 Aug 2018, 09:58 Kamal Sharma, 
wrote:

> Hey Django,
>
> I have deployed the django application on my production VPS, with the help
> of this tutorial
> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
>
> now it is working fine but i have made some changes in my local django
> environment so how can i change update it on my  production server.
>
> Please Help me
>
> Thanks
>
> Kamal Sharma
>
> --
> 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/CAHfh8PTgczzc2LpzxR1kiwyg9W2LETWiGv3x59kZBxqg8JAwqQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Live Streaming Video through WebCam

2018-08-01 Thread mottaz hejaze
this is awesome man ..

On Tue, 31 Jul 2018, 16:20 Pravin Yadav,  wrote:

> *Hello Everyone, I'm using the Live Streaming Video through WebCam. It's
> storing in .avi format. When i'm playing the Video. I'm not getting the
> audio of that video. I hope that opencv does not provide the audio
> features. Kindly let me know if you have any idea. Thanks,*
>
>
> *Please find the below code:---*
>
> import os.path
> import numpy as np
> import cv2, time
> import random
>
> def change_res(cap, width, height):
> cap.set(3, width)
> cap.set(4, height)
>
> #Standard Video Dimensions Sizes
> STD_DIMENSIONS = {
> '480p': (640, 480),
> '720p': (1280, 720),
> '1080p': (1920, 1080),
> '4k': (3840, 2160),
> }
>
> VIDEO_TYPE = {
> 'avi':cv2.VideoWriter_fourcc(*'XVID'),
> 'mp4':cv2.VideoWriter_fourcc(*'XVID'),
> }
>
> def get_video_type(filename):
> ext = os.path.splitext(filename),
> if ext in VIDEO_TYPE:
> return VIDEO_TYPE[ext]
> return VIDEO_TYPE['avi']
>
> def get_dims(cap, res='480p'):
> width, height = STD_DIMENSIONS['480p']
> if res in STD_DIMENSIONS:
> width, height = STD_DIMENSIONS[res]
> change_res(cap, width, height)
> return width, height
>
> #--START LIVE VIDEO--#
> random_id = random.randint(1,9)
> livevideo_name = str('livevideo_'+str(random_id)+'.avi')
> frames_per_second = 20.0  #..Frame Per Second
> my_res = '480p'  #..Frame Size
>
> # Capture video from camera
> livevideos = '/livevideos/'+livevideo_name
> cap = cv2.VideoCapture(-1)
> dims = get_dims(cap, res=my_res)
> video_type_cv2 = get_video_type(livevideos)
>
> # Define the codec and create VideoWriter object
> fourcc = cv2.VideoWriter_fourcc(*'XVID') # Be sure to use the lower case
> out = cv2.VideoWriter(livevideos, video_type_cv2, frames_per_second, dims)
> while(True):
> ret, frame = cap.read()
> if ret==True:
> frame = cv2.flip(frame,1)
> # Write the frame into the file
> out.write(frame)
> cv2.imshow('frame',frame)
> if cv2.waitKey(1) & 0xFF == ord('q'):
> break
> else:
> break
>
> # When everything done, release the video capture and video write objects
> cap.release()
> out.release()
> # Closes all the frames
> cv2.destroyAllWindows()
>
> --
> 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/CAEr6%3DdzZyO44sDLkd-HPoqh-LCuuvvnRiXDfEeXWZduCxBuw4g%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How to use multiple ForeignKeys

2018-07-31 Thread mottaz hejaze
put a foreign key in invoices model that points to vendor model .

On Tue, 31 Jul 2018, 00:38 Alexander Joseph, 
wrote:

> I'm building a Purchase Order app that uses a ForeignKey for Vendors. I
> want to be able to use another ForeignKey for invoices once a Vendor is
> selected. So the choices of Invoices would get filtered based on the users
> selection of the Vendor. How would I do this in the model? I assume I'd
> need ajax to load the invoices based on the Vendor in the template? 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/3c0e8bfb-30fb-467f-aa2f-58677e203480%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Django App plugins

2018-07-30 Thread mottaz hejaze
wow , i faced the [ static and preload problem ] of settings.py once .. you
cant govl around it becouse its how they designed django , you cant even
pass empty containers for any future values , or will be calculated from
the very next script after settings.py , you cant do that , there is no
such a lazy load in settings.py so dont try this way , think of another way
or you have to mess with django source code ..


one hack around is to load all the plugins once you create the project ,
but make them hidden or unaccessible untill the user want a certain
option-plugin so you make it visible for him

On Mon, 30 Jul 2018, 07:36 Melvyn Sopacua,  wrote:

> On zondag 29 juli 2018 23:14:34 CEST Christian González wrote:
> > On zondag 29 juli 2018 11:02:30 CEST Christian González wrote:
>
> > > There might also be another reason and that is that in the Python
> > > community, there's a good realisation that downloadable and instantly
> > > installable plugins for a web project without dev(ops) interference
> > > isn't necessarily a good thing.
> >
> > Mh, not really. Look at Owncloud/Nextcloud. Is PHP, but a good example
> > that this works.
>
> I have a good amount of experience with Magento, which has the same
> principle
> and dealt with all the downsides of it. But I personally don't know of any
> similar project within the Python community.
>
> Doesn't mean it doesn't exist, just not as wide spread and after having
> dealt
> with the security holes, low quality not performing code, layout breakers
> and
> what not - I can't say I'm surprised. Magento has invested quite a bit in
> ways
> to check code quality on everything that hits the store.
>
> Either way, keep in mind that you're not going to solve this *just* at the
> Django layer. You'll need some way to trigger the WSGI processor to load
> the
> new code in a safe manner and then run migrations. Good luck!
>
> --
> Melvyn Sopacua
>
>
> --
> 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/1637102.li6HjgoyNo%40fritzbook
> .
> 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/CAHV4E-fzyNP7gsLtZgYSWwX%2BeUxG3QKK7eaN0Kq6Q2UK0O9tbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django template cheat sheet or ebook

2018-07-30 Thread mottaz hejaze
i think docs are very good

On Mon, 30 Jul 2018, 13:41 , 
wrote:

> Hello,
>
> I have found a lot of example on the Django's CookBook, at this url :
> https://code.djangoproject.com/wiki/CookBook
>
> Le lundi 30 juillet 2018 05:44:44 UTC+2, aditya a écrit :
>>
>> Can anyone tell me where I can find Django template cheat sheet or ebook.
>>
>
> A quelle Vitesse surfez-vous ? Testez le Débit de votre Accès internet [Test
> Complet] 
>
> 
>
> --
> 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/2e09e0e4-e59e-42d2-b702-7567b77b6897%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Authentication (Login view)

2018-07-30 Thread mottaz hejaze
in your templates you make a check using {%  if
request.user.is_authenticated % } content to show {% else %} the login url
{% endif %}

On Mon, 30 Jul 2018, 13:41 SAD BOIII,  wrote:

> ?guys, how can i stop logged in users from accessing the log in page again
>
>
> 
>
> --
> 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/39c8091c-1e46-4bc5-8dee-b50804390467%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Django makemigration polls error

2018-07-25 Thread mottaz hejaze
just add 'polls' to the end of your installed apps in your settings.py

On Wed, 25 Jul 2018, 13:23 Okware Aldo,  wrote:

> Did you include Polls app in INCLUDE_APPS section in settings.
>
> On Wed, 25 Jul 2018, 06:34 Ashish Kumar,  wrote:
>
>> I am trying to follow the latest Django tutorial at the documentation
>> and I faced the following error when I enter python manage.py
>> makemigrations polls
>> Traceback (most recent call last): File "manage.py", line 15, in 
>> execute_from_command_line(sys.argv) File
>> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
>> line 371, in execute_from_command_line utility.execute() File
>> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
>> line 347, in execute django.setup() File
>> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\__init__.py",
>> line 24, in setup apps.populate(settings.INSTALLED_APPS) File
>> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py",
>> line 89, in populate app_config = AppConfig.create(entry) File
>> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py",
>> line 123, in create import_module(entry) File
>> "C:\Users\asus\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
>> line 126, in import_module return _bootstrap._gcd_import(name[level:],
>> package, level) File "", line 994, in
>> _gcd_import File "", line 971, in
>> _find_and_load File "", line 950, in
>> _find_and_load_unlocked ModuleNotFoundError: No module named
>> 'polls.apps.PollsConfigwebapp'; 'polls.apps' is not a package
>>
>> I'm new to Django. I had followed each steps properly and even 
>> re-checked.Experts
>> please assist.Regards
>>
>> --
>> 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/2f948227-37d7-491d-b589-939abeab557e%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMEZma__ocmfm8nu9XGvumt%3DXDWr8x7yMgaCz1WUoAzWksvgHw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Code vs Shell?

2018-07-23 Thread mottaz hejaze
python is not just web , python is very general and has many other usages ,
so you are developing but in a pythonic way , think of the shell as your
scratch paper ..

what if you want to learn a code snippet like querying the database with
filters , do you have to waste time build a complete app to learn that ?!

On Tue, 24 Jul 2018, 05:17 Mike Dewhirst,  wrote:

> On 24/07/2018 9:25 AM, roflcopterpaul wrote:
> > Hello, everyone!
> >
> > I am quite the scrub, having written a few super basic apps and
> > currently going through the Django tutorial. As I'm going through the
> > tutorial (creating a "polls" app), I've been perplexed by something
> > the whole time that I haven't been able to find an answer to -
> >
> > Why is much of the data the users see (i.e., the questions and answers
> > to the questions) written in the shell INSTEAD of simply being typed
> > up in the code/text editor? I'm new, so this is coming from a place of
> > ignorance, by why is that? It seems way more complicated and less
> > efficient.
>
> It is an education thing. Python is an interpreter which means it can
> interpret and execute code directly as well as read a script and execute
> from that.
>
> And you can enter data directly without needing to write/debug data
> entry code or skipping too far ahead of basic theory to get the Admin
> going.
>
> Typing stuff in and seeing the results demonstrates things actually
> working. If you believe, you don't need to do it.
>
> Typing it in directly gives you instant feedback and that's what a lot
> of people like. I've been using Python for a few years now and I still
> fire up the interpreter occasionally when I'm refreshing my memory about
> something I haven't used for a while. Or checking to prove something
> works as it should when results make me suspect I have gotten something
> wrong.
>
> YMMV
>
>
> >
> > Also, IS there a way to change up the code so everything can be
> > directly changed in the files themselves instead of in the shell?
> >
> > Thank you very much for any insight!
> > --
> > 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/00ef1cb4-3e87-4c3d-a5c6-8811408624de%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/django-users/00ef1cb4-3e87-4c3d-a5c6-8811408624de%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/f6c0044d-b4f7-1638-90f4-b00eea84c855%40dewhirst.com.au
> .
> 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/CAHV4E-cNjct5YYuwpRW1jg81D9PNb%3DQ1a0OkMyxz9xgetwBDEQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to automatically fill out an auto increment number in form field?

2018-07-23 Thread mottaz hejaze
you can use count() in views or models to count number of objects then add
the new record

On Tue, 24 Jul 2018, 02:55 Alexander Joseph, 
wrote:

> Thanks Michael and Gerald. With an auto key field or primary key field
> would users still be able to input their own value? And if so how would I
> be able to give it a default attribute in a form that shows what the next
> number should be, if the user decides to choose to use the auto increment?
> Thanks again
>
> On Mon, Jul 23, 2018, 6:36 PM Gerald Brown  wrote:
>
>> From
>> "https://docs.djangoproject.com/en/2.0/topics/db/models/#automatic-primary-key-fields;
>> ,
>> it has a further definition of automatic primary key fields.  In your model
>> just add "(primary_key=True)"  to po_number field.
>>
>> On Tuesday, 24 July, 2018 07:54 AM, Michael MacIntosh wrote:
>>
>> Hi,
>>
>> Aren't you looking for the AutoField?
>>
>> https://docs.djangoproject.com/en/2.0/ref/models/fields/#autofield
>>
>> It will automatically increment based on each record added to the table.
>>
>>
>> As an aside, the problem you are having is that in python, the first
>> argument to a class is a reference to the instance of that class.  In C
>> this is often called a context.  In C++ and Java it would be like the
>> `this` pointer.  So you wouldn't generally pass "self" to a class member.
>>
>> Hope that helps!
>>
>> On 7/23/2018 1:39 PM, Alexander Joseph wrote:
>>
>> Hello,
>>
>> I have a model ...
>>
>> class PurchaseOrder(models.Model):
>> po_number = models.IntegerField(unique=True)
>>
>>
>> and a function ...
>>
>> def get_po_number(self, *args, **kwargs):
>> if not self.id:
>> last_po = PurchaseOrder.objects.order_by('po_number').last()
>> if last_po:
>> last_po_num = last_po.po_number[-2:]
>> new_po_num = int(last_po_num) + 1
>> else:
>> new_po_num = '0001'
>> self.po_number = new_po_num
>> return self.po_number
>>
>>
>> what I'm trying to do is use the get_po_number() function to get a
>> default value for the po_number field in the model. However when I set the
>> default in the model like so...
>>
>> class PurchaseOrder(models.Model):
>> po_number = models.IntegerField(unique=True,
>> default=get_po_number(self))
>>
>> it says "NameError: name 'self' is not defined"
>>
>>
>> What am I doing wrong? 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/6183c81e-54b8-4779-9bf3-c8c9e734f248%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> This message has been scanned for viruses and dangerous content by
>> *E.F.A. Project* , and is believed to be
>> clean.
>> Click here to report this message as spam.
>> 
>>
>>
>> --
>> 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/945d5f35-e98b-b1f1-a527-32ff83687668%40linear-systems.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/wpq8f815GGE/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/a37859a4-3c35-6f19-6a9b-ef997361bcee%40gmail.com
>> 

Re: BEGIINER_ISSUE (FIRST DJANGO PROJECT): The install worked successfully! Congratulations! You are seeing this page because DEBUG=True is in your settings file and you have not configured any URLs.

2018-07-23 Thread mottaz hejaze
this is not an issue , please go to documentation and follow the tutorial

On Tue, 24 Jul 2018, 01:44 Vinko Sucur,  wrote:

> When i lounch my first djangoproject it always display the issue "The
> install worked successfully! Congratulations! You are seeing this page
> because DEBUG=True is in your settings file and you have not configured any
> URLs." (Look FIRTS DJANGO PROJECT.PGN)
>
> Please, how can I fix that problem, that is how to configure any URLs in
> my setting file.
>
> Thanks
>
> Vinko Sucur
>
> --
> 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/098a8104-7369-4fb5-a014-f9ca977d7079%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Server complete html Static App without apache server and without modifying html code

2018-07-23 Thread mottaz hejaze
i dont understand .. why you need backend anyway ?

On Mon, 23 Jul 2018, 23:21 archit mehta,  wrote:

>
> Hi,
>
> I have oraclejet frontend application and want to server that using
> django, I did it with flask but don't know how to do with django.
>
> Here is complete description of my problem Please go through it and
> suggest some solution.
>
>
> https://stackoverflow.com/questions/51484839/how-to-serve-complete-htmlapp-with-django-server-using-views-py
>
>
>
>
> Regards,
> Archit
>
> --
> 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/231f5a83-c3cf-4a3e-87c2-ecc378b08b97%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How can i require the user to login to see the view ?

2018-07-23 Thread mottaz hejaze
The login_required decorator¶

login_required(*redirect_field_name='next'*, *login_url=None*)[source]


As a shortcut, you can use the convenient login_required()

decorator:

from django.contrib.auth.decorators import login_required
@login_requireddef my_view(request):
...


On Tue, 24 Jul 2018, 01:44 Mostafa Alaa,  wrote:

> the view of  app
>
> from django.shortcuts import render
> from .models import Article
> from django.contrib.auth.decorators import login_required
> # Create your views here.
> def index(request):
> articles = Article.objects.all()
> return  render(request,'app/index.html',{'articles':articles})
>
>
>
> def detail(request,slug):
> articles = Article.objects.get(slug=slug)
> return render(request, 'app/detail.html', {'articles':articles})
>
>
>
> @login_required
> def create_article(request):
> return render(request,'app/create.html')
>
>
>
>
>
>
> the settings of login
>
> LOGIN_REDIRECT_URL = '/app/index/'
> LOGIN_URL = '/accounts/login/?next=/'
>
>
>
> --
> 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/a169e289-8fa7-4bb2-971e-c75b4978474b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Good up-to-date Django report builder addons

2018-07-22 Thread mottaz hejaze
gerald do you realy need a package to do this ,  couse i think its not that
hard to code by you ! i think there are time intervals functions in
datetime and in django timezone you can use ..

On Sun, 22 Jul 2018, 11:07 Gerald Brown,  wrote:

> Been there done that.
>
> It would not select a range of dates and the date had to be specified as
> 2018-07-22, not Now() or Today().
>
> I had 10 records that met the criteria but it only selected 2. Not very
> easy to use.
>
> Also very limited support, did NOT reply to my questions.
>
> Have you used it?  Did you have better results?
>
> Thanks.
>
>
> On Sunday, 22 July, 2018 04:49 PM, Melvyn Sopacua wrote:
> > On zondag 22 juli 2018 10:34:17 CEST Gerald Brown wrote:
> >> I went to that site but sorry to say was UNABLE to find anything I could
> >> use as most are OUTDATED, written in Python 2.? ,Alpha or Beta versions
> >> that have not been updated in many years.
> > You gave up too early. I don't know why it's ranked all the way on the
> right,
> > but this is defenitely stable and maintained and has a very good
> architecture:
> >
> > https://djangopackages.org/packages/p/django-report-builder/
> >
>
> --
> 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/df5cdd8d-741d-16a7-ff2e-e050cc823250%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Djando 2.0.7 image handling problem on production server

2018-07-21 Thread mottaz hejaze
thats why they invented virtualenv

On Sat, 21 Jul 2018, 19:36 Melvyn Sopacua,  wrote:

> On zaterdag 21 juli 2018 19:08:03 CEST Asif Khan wrote:
>
> > Oh dear I checked and found that Pillow was install in Python3.5 where as
>
> > production setup is for Python3.6 so Pillow was installed by pip3.5 but
> not
>
> > with pip3.6 which I have installed now.
>
>
>
> Have a look at pyenv . Relying on
> "versioned commands" goes wrong too often.
>
>
>
> --
>
> Melvyn Sopacua
>
> --
> 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/1932017.Pnh1MIuky5%40fritzbook
> 
> .
> 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/CAHV4E-eF%3D3XqH0gf-Y-V7FpsTgc3fN6FzaMkTh26OHuHm6Sy5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django extensions and thems such as worpress or other cms

2018-07-20 Thread mottaz hejaze
you can do it in 2 ways :

1- you can use django-cms .. a content managment based on django

https://www.django-cms.org/en/

2 - you can use django cookiecutter a ready for production complete django
installation

https://github.com/pydanny/cookiecutter-django

On Fri, 20 Jul 2018, 19:50 Mohsen Pahlevanzadeh, 
wrote:

>  Hello,
>
> I'm migrating to django from another framework, Really python is strong.
> Can I do upload a site rapidly such as wordpress? I need to use extensions
> and them? Is it possible in django?
>
> --mohsen
>
> --
> 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/d3997427-8781-436d-9072-8c034288fb07%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How to create dynamic form field? Django 2.0

2018-07-19 Thread mottaz hejaze
this is not a django stuff , this is frontend .. you can use jquery or
angularjs ..to hundle click event on the button and create the two fields
...

this website cant be done with django templates.. you need djangorest
framework with frontend javascript library

the django template way , you create a button that links to a separate form
.. the user enters tax name and value ,then submit , if he want to add more
, he will repeat the process

On Thu, 19 Jul 2018, 16:18 Django Lover,  wrote:

> This is hard for me understand can you please give some code. I am new in
> Django. PLEASE HELP ME
>
> On Thursday, July 19, 2018 at 7:26:29 PM UTC+5:30, C. Kirby wrote:
>>
>> https://docs.djangoproject.com/en/2.0/topics/forms/formsets/ to allow
>> for multiple instances of the same form type. Then you will need some
>> javascript to handle showing additional instances of the form when the
>> button is clicked
>>
>> On Thursday, July 19, 2018 at 9:29:51 AM UTC-4, Django Lover wrote:
>>>
>>> Here is the image of the form what is need when user click on "Add New
>>> Tax " two input (Tax name and Value ) should generate dynamically and with
>>> all field of the form.
>>>
>>> 
>>>
>>> 
>>> 
>>>
>> --
> 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/734e4c1c-ec9c-4627-93c8-5d2e692c9447%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: problem with instaling django

2018-07-17 Thread mottaz hejaze
first install python 3.6 not 3.7
second install virtualenv
third make a virtualenv and use pip inside it ..

On Wed, 18 Jul 2018, 01:36 Gerardo Palazuelos Guerrero, <
gerardo.palazue...@gmail.com> wrote:

> Hi,
> Is there any chance that you can use a Virtual Environment?
> At least in my experience, many issues happened to me because due to
> issues resolving the proper python version in my computer, until I started
> using a virtual environment per django project.
>
> I suggest you to check the django girls tutorial, yes, it really helped
> out in my beginnings.
>
> good luck,
>
>
>
>
> --
> Gerardo Palazuelos Guerrero
>
>
> On Tue, Jul 17, 2018 at 4:47 PM, Shay Hershko 
> wrote:
>
>> I tried and this is what showes up
>>>
>>>
>> 
>>
>> --
>> 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/e86d76f8-76b6-4903-ab43-ead289683b58%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ8iCyPZYxfArL5uCepO7Y9rpzc8cGk%3Dqu3zSXtB7-dMj%2BcqCw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Use an external REST API in django admin

2018-07-16 Thread mottaz hejaze
even REST API needs a database managments system like postgre or mysql

so the lowest layer is postgre or mysql or mongodb

the upper layer on top of any one of them , your backend REST API

read about DMS and REST API




On Mon, 16 Jul 2018, 20:44 Vijay Khemlani,  wrote:

> django rest framework would be your best bet
>
> http://www.django-rest-framework.org/
>
> On Mon, Jul 16, 2018 at 10:16 AM micka 
> wrote:
>
>> Hello,
>>
>> I wish I could use the data from an external API in the administration of
>> Django. I wish I could list, read, edit and create objects but instead
>> of using a postgres database, I would use a REST API.
>> Do you know a module to do it or resources that could help me?
>>
>> Thank you !
>>
>> --
>> 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/49ac56e6-a259-4fce-a8c2-3be2841021c6%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALn3ei2-cKCsnVpJ5b0QTDFPwbgChRcfx%3Db%2B-Wh-i8VFSO%3Dp_w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: multiple django websites

2018-07-16 Thread mottaz hejaze
thanks ryan and andreas . ill cjlheck that and see

On Mon, 16 Jul 2018, 18:10 Andréas Kühne, 
wrote:

> This is more of a webserver configuration thing than configuration of
> django.
>
> You can have multiple django instances running on the same server - just
> add the code in several directories - also with the virtualenvironments for
> each.
>
> Then you need to configure your webserver to point to the correct
> installations depending on the incoming address.
>
> For apache:
> https://www.metaltoad.com/blog/hosting-django-sites-apache
>
> For nginx:
>
> http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/
>
> These are examples that I was able to google within 5 minutes - You could
> start there and then expand on the configuration as needed. Even though the
> articles are a bit dated - I don't think there are severe differences on
> how to deploy django.
>
> Regards,
>
> Andréas
>
> 2018-07-16 15:18 GMT+02:00 mottaz hejaze :
>
>> ryan do you have a guide for this .. i found one but its outdated i think
>>
>> On Mon, 16 Jul 2018, 14:53 Ryan Nowakowski,  wrote:
>>
>>> Yes
>>>
>>> On July 16, 2018 6:50:37 AM CDT, mottaz hejaze 
>>> wrote:
>>>>
>>>>
>>>> hello friends ,
>>>>
>>>> is it possible to host multiple django websites on a single VPS ??
>>>>
>>>> i mean real production websites all go live in the same time from the
>>>> same VPS like digitalocean VPS
>>>>
>>>> thx all
>>>>
>>>> --
>>> 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/2656591E-B7AE-410C-9008-8FC0C76B7DF3%40fattuba.com
>>> <https://groups.google.com/d/msgid/django-users/2656591E-B7AE-410C-9008-8FC0C76B7DF3%40fattuba.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/CAHV4E-e1vOkXNpi-kiFs%2B6Z2SGXfmzWNp137OYVsPB4dZmZ52Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAHV4E-e1vOkXNpi-kiFs%2B6Z2SGXfmzWNp137OYVsPB4dZmZ52Q%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/CAK4qSCdvJPESQ8ZqjMWDV4_J9dzRWHdC36FuopxFRdzZTNJkjg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4qSCdvJPESQ8ZqjMWDV4_J9dzRWHdC36FuopxFRdzZTNJkjg%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/CAHV4E-eGNmswruxjTig0Yc%3Dnm%3DLDatnp4mJBjP2i-ieu2DRwKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: multiple django websites

2018-07-16 Thread mottaz hejaze
ryan do you have a guide for this .. i found one but its outdated i think

On Mon, 16 Jul 2018, 14:53 Ryan Nowakowski,  wrote:

> Yes
>
> On July 16, 2018 6:50:37 AM CDT, mottaz hejaze 
> wrote:
>>
>>
>> hello friends ,
>>
>> is it possible to host multiple django websites on a single VPS ??
>>
>> i mean real production websites all go live in the same time from the
>> same VPS like digitalocean VPS
>>
>> thx all
>>
>> --
> 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/2656591E-B7AE-410C-9008-8FC0C76B7DF3%40fattuba.com
> <https://groups.google.com/d/msgid/django-users/2656591E-B7AE-410C-9008-8FC0C76B7DF3%40fattuba.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/CAHV4E-e1vOkXNpi-kiFs%2B6Z2SGXfmzWNp137OYVsPB4dZmZ52Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin CSS Not Working in Opera or UC Browser

2018-07-16 Thread mottaz hejaze
if it worked with Explorer , it should work with all browsers !!

On Mon, 16 Jul 2018, 14:15 Jason,  wrote:

> If this works in standard browsers like chrome, firefox, or IE/Edge, then
> my guess is Opera and UC are doing non-standard things which break
> rendering and/or requests.  So I'd suggest you look for those specific
> browser issues since this doesn't seem like a Django issue at all.
>
> On Sunday, July 15, 2018 at 9:05:28 PM UTC-4, Gerald Brown wrote:
>>
>> One thing I noticed in your settings file is that you are missing a comma
>> (,) at the end of your last application in the settings file.
>>
>> On Monday, 16 July, 2018 08:54 AM, Kayode Oladipo wrote:
>>
>> I recently sent in a query concerning my faulty admin css which loaded
>> previously until an upgrade to v.2.0.5.
>> I assumed the upgrade was responsible for this, so i downgraded back to
>> my previous version (2.0.2) but there was no change. I have uninstalled and
>> tried all fixes I know all to no avail.
>> The admin css is still not loading in the above mentioned browsers but is
>> loading in Internet Explorer (which I do not want to use).
>>
>> I would appreciate any assistance.
>> Attached is the settings file from my project.
>>
>> Cheers from Nigeria.
>> --
>> 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/CA%2BARzD_qF1treWg%2Bf4xz76S-DNRZ6%3DVTexBTTJBXTp4E%3DcVy5A%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c7ecc754-9e49-4465-824e-b7c4aecf60e6%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


multiple django websites

2018-07-16 Thread mottaz hejaze
hello friends ,

is it possible to host multiple django websites on a single VPS ??

i mean real production websites all go live in the same time from the same
VPS like digitalocean VPS

thx all

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


Re: how-to-fix-the-field-error-issue-in-django

2018-07-16 Thread mottaz hejaze
i dont use class based views , but in function based views , my url would
be like this

urls.py

path(' ', views.list , name='list'),
path('', views.detail , name='detail')

views.py

def list(request):
...


def detail(request, id)
...






On Mon, 16 Jul 2018, 13:37 gomathi subramanian,  wrote:

> Hi Django people,
>
> Kindly help me to resolve this issue.
>
>
> https://stackoverflow.com/questions/51336451/how-to-fix-the-field-error-issue-in-django
>
> Thanks,
> Gomathi Subramanian
>
> --
> 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/4ded4ca3-e8eb-4e4a-9d2a-f563bdfdc6ea%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Django "pub_date" error

2018-07-16 Thread mottaz hejaze
i dont know .. did you import the Question Class from models.py ??

On Mon, 16 Jul 2018, 05:25 Dylan Reinhold,  wrote:

> Without your code no one can help you (they will just be guessing). Post
> your models.py and the exact traceback error.
>
>
> On Sun, Jul 15, 2018 at 7:52 PM, Daniel Tobi Onipe <
> dexterousgur...@gmail.com> wrote:
>
>> I wrote it exactly as it is in the tutorial...
>>
>> On Mon, Jul 16, 2018, 02:56 afj afj  wrote:
>>
>>> probably if you would show us the code you've written it would be better.
>>>
>>> On Monday, July 16, 2018 at 2:37:31 AM UTC+3, Daniel Tobi Onipe wrote:

 Hi guys. My name is Daniel. I've been having issues with the "pub_date"
 part of the tutorial. It keeps popping up a traceback error saying
 "pub_date is an invalid keyword argument for this function"... What should
 I do? Thanks 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/75a202b2-b883-406e-be29-07be8f6bace9%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAE5gE5StD0e5X2BD8p%3DBw_fCzwyAk7YSGY_tw0VbV0g0wAqMGg%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHtg44AQ8q6KcSgYpgSsdO4_W6p0L%3DXeSe%2Bun26mStbQs2MinA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


multiple django websites

2018-07-16 Thread mottaz hejaze
hello friends ,

is it possible to host multiple django websites on a single VPS ??

i mean real production websites all go live in the same time from the same
VPS like digitalocean VPS

thx all

-- 
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/CAHV4E-cLW_yQQdpsGqvMv1gqU4keKoRKKRLOv-S1C%2BPXsF6WDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How is MySQL syntax for a table changed if I had a ManyToManyField?

2018-07-14 Thread mottaz hejaze
for many to many relationships between two tables .. you can make a third
table that only contains the id fields ftom both tables , then you can make
a third model for this table

On Fri, 13 Jul 2018, 22:24 ,  wrote:

> I tried for hours to get django's migrate/makemigrations function work but
> miserably couldn't so I created my tables in MySQL. Now I'm trying to add a
> ManyToManyField between 2 models but am not sure how the MySQL syntax is
> supposed to look like.
>
> This is my current code:
>
> from django.db import models
>
> class Publication(models.Model):
> title = models.CharField(max_length=30)
>
> class Article(models.Model):
> headline = models.CharField(max_length=100)
>
> and I can create a table as follows in MySQL:
>
> CREATE TABLE publication (
> title varchar(30)
> );
> CREATE TABLE Article (
> headline varchar(100),
> );
>
> I need to add the ManyToManyField like so:
> class Article(models.Model):
> headline = models.CharField(max_length=100)
> *publications = models.ManyToManyField(Publication)*
>
> I'm really running low on time, could someone assist me with what the
> MySQL code is supposed to look like? I will be permanently in your debt.
>
> --
> 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/6f546243-23f0-4760-806b-9fff01d2afd7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Upgrading Django

2018-07-13 Thread mottaz hejaze
please share your settings.py . maybe you need to add or edit some
middleware in settings.py

On Fri, 13 Jul 2018, 14:36 Ghiath ghanem,  wrote:

> I'm working on small project, (Automatic Calender for the near future
> events from Tweets).
> I have upgraded to Python 3.4.3, and Now i would like to upgrade Django
> from 1.5.11 to 2.0.7.
> Almost everything went well until  i got this error:
> ?: (admin.E402) 'django.contrib.auth.context_processors.auth' must be in
> TEMPLATES in order to use the admin application.
> can anyone help me?
>
>
> --
> 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/2ee31f9a-7858-49fe-832b-f3595af67e75%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Weighing Scale & TCP IP connectivity

2018-07-13 Thread mottaz hejaze
you dont need sockets , you can make the weight program scan inputs every n
seconds .. or you can program it to be an event hundler to any  change in
unputs

start with weight program , design it the code it . test untill you
satisfied .. now you can do the connection with backend in many ways ..

you can make your program connect to the same database that your django has
access to it

you can record in csv or json files and send them to django as Tom
mentioned maybe try to use django rest for hundling json requests and
responses

also you can make the program embedded in your backend django as a module
or a script



On Thu, 12 Jul 2018, 21:09 Thomas G Lockhart, 
wrote:

> You can use Django REST framework to get data into Django and a separate
> Python (or other) program to feed it in. Have the Python program connect to
> the scale and use whatever mechanisms are required there to get your data.
>
> If the scale has a browser interface, then use urllib to read a page and
> then use BeautifulSoup to rummage through it and pick out the weight etc.
> Then push it using json into your REST endpoint.
>
> hth
>
> - Tom
>
>
> On Jul 11, 2018, at 11:26 PM, ERICK OMONDI AYARA 
> wrote:
>
> Hello, I would like to capture weight from a weighing scale using
> TCP/Ethernet cable into a django app. If anyone can advice on how to use
> sockets or any other means to make this work, will be appreciated. Regards
>
> --
> 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/ee33e49e-67d5-491a-a113-09fbd5290d56%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/FEBBB7C6-7CF7-4E11-9372-ED957E4AD0DF%40gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Weighing Scale & TCP IP connectivity

2018-07-13 Thread mottaz hejaze
check this

https://raspberrypi.stackexchange.com/questions/70476/tcp-communication-raspberry-pi-and-pc-via-ethernet


On Fri, 13 Jul 2018, 11:08 mottaz hejaze,  wrote:

> you dont need sockets , you can make the weight program scan inputs every
> n seconds .. or you can program it to be an event hundler to any  change in
> unputs
>
> start with weight program , design it the code it . test untill you
> satisfied .. now you can do the connection with backend in many ways ..
>
> you can make your program connect to the same database that your django
> has access to it
>
> you can record in csv or json files and send them to django as Tom
> mentioned maybe try to use django rest for hundling json requests and
> responses
>
> also you can make the program embedded in your backend django as a module
> or a script
>
>
>
> On Thu, 12 Jul 2018, 21:09 Thomas G Lockhart, 
> wrote:
>
>> You can use Django REST framework to get data into Django and a separate
>> Python (or other) program to feed it in. Have the Python program connect to
>> the scale and use whatever mechanisms are required there to get your data.
>>
>> If the scale has a browser interface, then use urllib to read a page and
>> then use BeautifulSoup to rummage through it and pick out the weight etc.
>> Then push it using json into your REST endpoint.
>>
>> hth
>>
>> - Tom
>>
>>
>> On Jul 11, 2018, at 11:26 PM, ERICK OMONDI AYARA 
>> wrote:
>>
>> Hello, I would like to capture weight from a weighing scale using
>> TCP/Ethernet cable into a django app. If anyone can advice on how to use
>> sockets or any other means to make this work, will be appreciated. Regards
>>
>> --
>> 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/ee33e49e-67d5-491a-a113-09fbd5290d56%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/ee33e49e-67d5-491a-a113-09fbd5290d56%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/FEBBB7C6-7CF7-4E11-9372-ED957E4AD0DF%40gmail.com
>> <https://groups.google.com/d/msgid/django-users/FEBBB7C6-7CF7-4E11-9372-ED957E4AD0DF%40gmail.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/CAHV4E-dWPk4OxNekqyk-fBLJBHRk5TU9pV%2BnzOrfrj8_Soh3jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the best route to take to build a general CMS using Django?

2018-07-11 Thread mottaz hejaze
i think we can all use google mark . thanks for the good knowledge

On Thu, 12 Jul 2018, 02:48 Mark Phillips, 
wrote:

>
> https://www.google.com/search?q=What+is+the+best+route+to+take+to+build+a+general+CMS+using+Django%3F=What+is+the+best+route+to+take+to+build+a+general+CMS+using+Django%3F=chrome..69i57j69i60.948j0j9=chrome=UTF-8
>
> On Wed, Jul 11, 2018 at 5:21 PM, afj afj  wrote:
>
>> ---
>>
>> --
>> 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/9b74041c-b869-49c7-a5a0-836bdcd9aad1%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEqej2Piz7gnoKvgYTaP1Wjx9Y1Ud0-ecre-DMpGSD3SwBBs3A%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Is it possible to create models inside a database model

2018-07-11 Thread mottaz hejaze
you cant make models inside models becouse you cant make tables inside
tables ... a model is a database table

aditya the easiest way is to redesign your model and make it of 15 fields
..each field will upload to a specific folder inside the media folder


another way . is to make a one image field and another char field . and
pass a choices to it . the choices will be a tuple with subfolder name
inside media folder . the make the path inside the image field dynamic
comming from that tuple of choices ..

i didn't make something similar but you can give it a try

On Wed, 11 Jul 2018, 13:09 mottaz hejaze,  wrote:

> for alexander .. you can make three models .. one for orders .. one for
> items .. and one for orderedItems .. the orderedItems model will have
> relations to  both models items and  orders
>
> On Tue, 10 Jul 2018, 21:19 aditya gupta, 
> wrote:
>
>> Well I was thinking is that instead of using related_name is there any
>> other way I can write and call my images inside css lightbox for the slide
>> show.
>>
>> On Wed, Jul 11, 2018, 12:42 AM Alexander Joseph <
>> alexander.v.jos...@gmail.com> wrote:
>>
>>> Oh ok I see. The related_name is what you use to access the specific
>>> field in the template so it needs to be unique to the model field. When you
>>> use the ForeignKey field type it uses the primaryKey of the related
>>> database models automatically so you dont need to worry about actually
>>> telling it which field to use to relate to in a RDBMS sense.
>>>
>>> On Tuesday, July 10, 2018 at 11:30:00 AM UTC-6, aditya wrote:
>>>>
>>>> I am using CBVs in model.py file and FBVs in views.py file.
>>>> As in image :-
>>>>
>>>> On Tue, Jul 10, 2018, 10:29 PM Alexander Joseph 
>>>> wrote:
>>>>
>>>>> Also- this is assuming you're using CBVs, if youre just using FBVs its
>>>>> probably even easier on the view side, the model side would be the same
>>>>>
>>>>> On Tuesday, July 10, 2018 at 10:23:51 AM UTC-6, Alexander Joseph wrote:
>>>>>>
>>>>>> Good question - I'm looking for a similar solution myself. My
>>>>>> application is a purchase order app so that a purchase order has details
>>>>>> about the purchase order but also has an unspecified number of objects 
>>>>>> that
>>>>>> belong to it (purchase items).
>>>>>> The only way I can think this MIGHT work is making a model for each,
>>>>>> including a foreignKey to relate the puchase items back to the purchase
>>>>>> order, and possibly putting both in the same
>>>>>> CreateView/DetailView/UpdateView/etc. (if this is possible). I'll keep 
>>>>>> you
>>>>>> updated if I find any better solutions though
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tuesday, July 10, 2018 at 9:26:55 AM UTC-6, aditya wrote:
>>>>>>>
>>>>>>> I have created a model Named Gallery and set upload path to media
>>>>>>> folder and in that folder I have 15 more folders with different images.
>>>>>>> Now I want to access each folder and images present inside it using
>>>>>>> database.
>>>>>>> My question is :
>>>>>>> Is it possible to create 15 model inside an model and if possible,
>>>>>>> then How to access them in my Html file? If not then what should I do to
>>>>>>> show them in my Html file ?
>>>>>>
>>>>>> --
>>>>> 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/10f8139f-ecd3-44d2-a7a6-9b6e7e2329ae%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/10f8139f-ecd3-44d2-a7a6-9b6e7e2329ae%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>> You receiv

Re: Is it possible to create models inside a database model

2018-07-11 Thread mottaz hejaze
for alexander .. you can make three models .. one for orders .. one for
items .. and one for orderedItems .. the orderedItems model will have
relations to  both models items and  orders

On Tue, 10 Jul 2018, 21:19 aditya gupta,  wrote:

> Well I was thinking is that instead of using related_name is there any
> other way I can write and call my images inside css lightbox for the slide
> show.
>
> On Wed, Jul 11, 2018, 12:42 AM Alexander Joseph <
> alexander.v.jos...@gmail.com> wrote:
>
>> Oh ok I see. The related_name is what you use to access the specific
>> field in the template so it needs to be unique to the model field. When you
>> use the ForeignKey field type it uses the primaryKey of the related
>> database models automatically so you dont need to worry about actually
>> telling it which field to use to relate to in a RDBMS sense.
>>
>> On Tuesday, July 10, 2018 at 11:30:00 AM UTC-6, aditya wrote:
>>>
>>> I am using CBVs in model.py file and FBVs in views.py file.
>>> As in image :-
>>>
>>> On Tue, Jul 10, 2018, 10:29 PM Alexander Joseph 
>>> wrote:
>>>
 Also- this is assuming you're using CBVs, if youre just using FBVs its
 probably even easier on the view side, the model side would be the same

 On Tuesday, July 10, 2018 at 10:23:51 AM UTC-6, Alexander Joseph wrote:
>
> Good question - I'm looking for a similar solution myself. My
> application is a purchase order app so that a purchase order has details
> about the purchase order but also has an unspecified number of objects 
> that
> belong to it (purchase items).
> The only way I can think this MIGHT work is making a model for each,
> including a foreignKey to relate the puchase items back to the purchase
> order, and possibly putting both in the same
> CreateView/DetailView/UpdateView/etc. (if this is possible). I'll keep you
> updated if I find any better solutions though
>
>
>
>
> On Tuesday, July 10, 2018 at 9:26:55 AM UTC-6, aditya wrote:
>>
>> I have created a model Named Gallery and set upload path to media
>> folder and in that folder I have 15 more folders with different images.
>> Now I want to access each folder and images present inside it using
>> database.
>> My question is :
>> Is it possible to create 15 model inside an model and if possible,
>> then How to access them in my Html file? If not then what should I do to
>> show them in my Html file ?
>
> --
 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/10f8139f-ecd3-44d2-a7a6-9b6e7e2329ae%40googlegroups.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/17af2e69-1756-4156-99ce-20f01cf3aa67%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKXtCfCVg09iyi7ZYpe6SVQ0R40%3D1DZEH4-C0%3Df-CDZsR0B3Wg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, 

Re: Using multiple keyword arguments with reverse()

2018-07-09 Thread mottaz hejaze
def my_view(request):
...
return redirect('some-view-name', foo='bar')

-- 
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/9767f941-e871-46df-ad9e-554252f554bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: facebook python script

2018-07-09 Thread mottaz hejaze
i think you gonna need to scrap the page first . then use requests library

On Mon, 9 Jul 2018, 20:17 Ahmad,  wrote:

> Thank you very much dear. It will help alot me.
>
> On Monday, July 9, 2018 at 10:46:34 PM UTC+5, Ahmad wrote:
>>
>> Hello everyone, I hope all of you will be fine.
>>
>> I want a script to download facebook video (SD or HD) using python.
>>
>> if anyone has already please send me
>>
>> or if you have any other material which can help me.
>>
>> Waiting for you reply. 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/1fc1f9ee-b1b6-40fe-a80b-d1c0b09a15a5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: django template rendering performance

2018-07-09 Thread mottaz hejaze
i dont think so . rendering templates , though rendering templates us a
matter of the web server then users browsers

On Tue, 10 Jul 2018, 00:56 Masoud Sadri,  wrote:

> Hi,
> when rendering django(v 1.11) templates, is there any performance
> difference between python 2.7 and 3.5?
>
> 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/71ea0ed5-e182-4bcb-9ec6-64970f04f351%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: ValueError: Attempted relative import in non-package

2018-07-08 Thread mottaz hejaze
make sure that __init__.py file exists and not deleted 

-- 
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/0a4c9983-6e56-4d5d-a9fe-9f17df54700e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using multiple keyword arguments with reverse()

2018-07-08 Thread mottaz hejaze
try to use url('view function name' x y)

-- 
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/aacc5351-f69a-459e-b94b-10310afc5397%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help

2018-07-08 Thread mottaz hejaze
push the code to git repository 

-- 
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/37c8b679-dbb5-4f22-b826-fd83363cda23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.