Re: Problem with django in a ubuntu Server

2017-08-22 Thread James Schneider
On Aug 22, 2017 7:17 PM,  wrote:

Hello there, i have a problem with django, when i upload all my files and
run the  manager.py runserver  to an ubuntu server, it turns just to
localhost and the main page throws this...


It worked! Congratulations on your first Django-powered page.

Of course, you haven't actually done any work yet. Next, start your first
app by running python manage.py startapp [app_label].
You're seeing this message because you have DEBUG = True in your Django
settings file and you haven't configured any URLs. Get to work!


i need to upload a landing page.
Thanks



Have you gone through the tutorial yet? It covers all of the basics that
you need to get started.

https://docs.djangoproject.com/en/1.11/intro/tutorial01/

-James

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


Re: Deploying Django Tutorials or Guides - mod_wsgi, Apache, Linux

2017-08-22 Thread gerardo.palazuelos
hi,
You might want to check this link:
https://www.fullstackpython.com/deployment.html

I hopes this can guide you.
Regards,
Gerardo.


On Tuesday, August 22, 2017 at 2:32:17 PM UTC-6, pieceof...@gmail.com wrote:
>
> I should add Python 2.7, Django 1.11
>
>>
>>

-- 
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/2be52444-68a9-4f92-96b4-1cb456cc5b57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problem with django in a ubuntu Server

2017-08-22 Thread iquinones
Hello there, i have a problem with django, when i upload all my files and 
run the  manager.py runserver  to an ubuntu server, it turns just to 
localhost and the main page throws this...


It worked! Congratulations on your first Django-powered page. 

Of course, you haven't actually done any work yet. Next, start your first 
app by running python manage.py startapp [app_label]. 
You're seeing this message because you have DEBUG = True in your Django 
settings file and you haven't configured any URLs. Get to work! 


i need to upload a landing page.
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/42fe32fd-ee66-4124-a596-499c12657ddd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


is there any way to dump all sqlmigrations automatically ?

2017-08-22 Thread Victor Wang
use "sqlmigrate " is too ineffective  to get all sql script to setup new 
database . 

is there anyway to dump all "sqlmigrate" for all apps ?

-- 
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/b07a2a95-600b-42a2-b00b-c0f78b790cae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A lot of Problems with Migrating (conceptual)

2017-08-22 Thread James Schneider
On Tue, Aug 22, 2017 at 12:37 PM, Alexander Joseph <
alexander.v.jos...@gmail.com> wrote:

> Thanks for all the advice.
>
> One more question - could project structure be causing issues with
> migrations? I'm working on a large project and many apps in my project have
> several layers of "sub-apps". My structure looks something like this...
>

Possibly, especially if you're introducing any import loops. It's easy to
do. Trying to get the autodiscover mechanism for models to run through
nested apps can also be fun.



A few things about my structure - I read in "2 Scoops of Django" that, in
> general, if you have more than 5 models per model file then you should
> think about splitting the model up into different apps, rather than having
> long models files. And I structured it this way so that it would be a
> little easier to manage - instead of having all apps under the project
> folder, engineering apps would belong in the engineering folder, etc.
>
> Thanks again
>
>

It depends. Your structure will likely change throughout the life of your
project. Start with what you have now and mold accordingly. Loose coupling
is key, though, to make it easier to move things around.

Like I mentioned in your other thread, you need to redefine what you are
considering an 'app'. Your current definition is way too specific/narrow,
which is why you are ending up with so many. Almost certainly each product
does not need its own app. That's not to say you shouldn't break them
apart. I'm saying keep your 'apps' generalized (ie engineering, accounting,
etc.) and break up the models into importable Python modules with a
sensible structure. Using modules will alleviate much of the pain of the
app and model discovery process using the pattern I described in the other
thread. It also provides a mechanism for loose coupling, and keeps your
models in separate files/folders using any structure you'd like. Reducing
the number of apps also reduces the number of files present in your
project, since you only need a single apps.py for a larger app, rather than
managing 20 apps.py files for 20 smaller apps.

2SoD is an excellent resource, and in no way to do I claim to have a
modicum of the knowledge and experience that the authors do. I don't even
program for a living. I have a copy for 1.8. You will notice in the book
that they do not have separate apps for an ice cream cone vs. ice cream
sandwiches vs. toppings, even though these may be analogous to your
product_1, product_2, etc. It's hard to tell though, because I'm assuming
you generalized your structure, so I don't know if you are talking about
different ice cream-based treat types, or cars vs. rocket ships. The latter
would likely use separate apps because there would be little overlapping
workflows and logic, along with multiple models associated with each.

I'd recommend looking in to some introductory material on database
normalization, not so much for the mechanics, but rather more conceptually.
The way you would break things apart for normalization often coincides
neatly with the way you should break apart apps (and builds your model list
for you), somewhere around the 2nd normal form. Again, your structure will
likely change as you go, so use the loose coupling via the __init__.py
module imports as I've shown, and that should help with the transition.

-James

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


Re: 1.11: Value error on related user name during save of user model

2017-08-22 Thread James Schneider
On Tue, Aug 22, 2017 at 12:31 PM, Axel Rau  wrote:

> Thanks for taking the time to write such an extensive answer.
>

Thanks. I should really sleep more...


>
>
Some background info:
>
> This is a realtime operational database, for which I try to create a GUI
> with Django.
> The DB is fully normalized and multi-client.
>

I'll take your word that it's normalized, but I still think conceptually
that the username field is in the wrong spot and IMO is the primary cause
of this entire conversation. ;-)

As always, there may be a deeper context for the design choice outside the
scope of this thread. It probably isn't worth the time to debate because
what you are trying to do is supported AFAICT.



> To reduce the complexity, I have created a concept for shortcuts of model
> instances, which are used in list views or FK form fields.
>
> Each model has a __str__() method which returns such a shortcut (like the
> above Mailbox) for an instance.
>
> There are other concepts like
>   Model forms just to display data, or,
>

Why use a form simply to display data? I'm assuming just for the
form.as_table type shortcuts?


>   For the multi-client part, the PK of the current user is kept in the
> session along with some Q-expressions to qualify account dependent queries.
>

Assuming you are referring to the PK of the Mailbox instance containing the
username. If you make use of request.user or {{ user }} in the templates,
you can access the PK of the user by using request.user.localemail_id or {{
user.localemail_id }}, rather than keeping track of stuff in the session
(which the request middleware is already doing assuming you are using it).
Might be easier than trying to manage the session data. It's a fun trick
that Django doesn't make obvious:

https://docs.djangoproject.com/en/1.11/ref/models/querysets/#values

See the "A few subtleties that are worth mentioning:" section.

As a bonus, if you only need the PK of the related Mailbox object, using
the user.localemail_id will only return the PK value, and will not perform
an SQL lookup to return the entire Mailbox object just to retrieve the PK
like user.localemail.pk would. Comes in handy when trying to minimize
queries.



>
> My current problem with 1.11 is a model form for Account, which contains a
> FK field referencing Mailbox in which the above shortcut is displayed as a
> pop up (forms logic treats remote instance as text).
> I changed something else in the form and tried to save with the Mailbox
> field unchanged.
>
> It seems that forms logic does no longer manage to get the instance from
> its text representation.
>

I suppose that is the more succinct way to explain what I was trying to
say. As I mentioned, if the same code is working under 1.9, check the
release notes for 1.10 and 1.11 to make sure that they haven't deprecated a
feature you may have been taking advantage of. I "think" that jumping from
1.9 to 1.11 would skip the deprecation warnings shown in 1.10, and fully
drop those features in 1.11. It's hard to tell any more with the new
semantic versioning that Django is moving to. The docs have been updated to
match the new intended SemVer scheme, but are clear as mud as to how older
versions were treated.


>
> When I access a model instance, AFAIK my context determines the data type
> I get (string or model instance).
> Is this correct?
>
> If this was working under 1.9 (I'd be surprised if it was), then I would
> file this as a backward-incompatibility bug with the bug tracker. It’s
> possible that 1.9 did do the type/field conversion using some black magic,
> but with the information in your model, I don't know how it could have made
> that determination.
>
>
> I have just verified: It still works with 1.9. (-;
>

If nothing shows in the release notes, I'd recommend a bug report to have
the devs take a closer look.

>From a design perspective, the relation you presented seems backwards to
> me. I would think the Account model would hold the canonical username, and
> Mailbox would have the FK back to the Account. That design would not
> require the use of a username field as an FK, simplifying everything
> (authentication, forms, views, etc.). Your current design would implement
> excessive SQL JOIN's to pull relatively simple data on every request.
>
> Or, I could be completely wrong. :-D
>
>
> Perhaps, I should publish the project at github (it’s OSS anyway), to get
> more advice?
>
>
It might help, but I wouldn't bother with the effort unless you were either
already planning to do so, or someone asks specifically. I don't have time
to read my code, let alone yours. ;-)

-- 
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 dis

Re: Deploying Django Tutorials or Guides - mod_wsgi, Apache, Linux

2017-08-22 Thread pieceofkayk2718
I should add Python 2.7, Django 1.11

>
>

-- 
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/b3ed091d-5679-4710-a106-5a1065e38259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: A lot of Problems with Migrating (conceptual)

2017-08-22 Thread Alexander Joseph
Thanks for all the advice.

One more question - could project structure be causing issues with 
migrations? I'm working on a large project and many apps in my project have 
several layers of "sub-apps". My structure looks something like this...



my_project/
config/ 
docs/
accounting/
invoices/
__init__.py
admin.py
models.py
urls.py
views.py
purchase_orders/
__init__.py
admin.py
models.py
urls.py
views.py 
__init__.py
admin.py
models.py
urls.py
views.py
engineering/
products/
product1/
sub_product1/
__init__.py
admin.py
models.py
urls.py
views.py
__init__.py
admin.py
models.py
urls.py
views.py
product2/
__init__.py
admin.py
models.py
urls.py
views.py
__init__.py
admin.py
models.py
urls.py
views.py
requirements/
utility/


A few things about my structure - I read in "2 Scoops of Django" that, in 
general, if you have more than 5 models per model file then you should 
think about splitting the model up into different apps, rather than having 
long models files. And I structured it this way so that it would be a 
little easier to manage - instead of having all apps under the project 
folder, engineering apps would belong in the engineering folder, etc.

Thanks again




On Thursday, August 17, 2017 at 11:10:01 AM UTC-6, Alexander Joseph wrote:
>
> I'm pretty new to django and I've been having problems with 
> makemigrations/migrate and I wonder if Im doing things right.
>
> I'm using MySQL backend and after reading in the documentation a little it 
> sounds like Postgresql might make migrating more painless. Usually my 
> problems stem from changing table fields, adding new tables/models, and 
> migrating both on my development server and my production server 
> (PythonAnywhere)
>
> More than once I've had to drop my database, delete all my migrations, and 
> start over with initial migrations on the development server. This wont fly 
> for long on production though of course .. once I actually have users and 
> data.
>
> I'm wondering if I should switch to postgresql or if theres any further 
> resources that you might know of that would help me out? 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/d4cc32e5-c9c1-48d7-bb19-a6646800ce3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.11: Value error on related user name during save of user model

2017-08-22 Thread Axel Rau
Thanks for taking the time to write such an extensive answer.

> Am 21.08.2017 um 23:53 schrieb James Schneider :
> 
> 
> 
> On Mon, Aug 21, 2017 at 7:50 AM, Axel Rau  > wrote:
> While upgrading from 1.9 to 1.11, ForwardManyToOneDescriptor.__set__()
> tries to assign a string (description of the related instance) to the related 
> user name field
> of user model.
> 
> class AbstractEmailUser(AbstractBaseUser, PermissionsMixin, 
> FieldlistForDetailTemplateMixin):
> localemail = models.OneToOneField('Mailbox', verbose_name=_('Local 
> E-mail'),
> related_name='localemail', db_column='localemail',
> editable=('UR', 'UE', 'UL'))
> 
> objects = UserManager()
> 
> USERNAME_FIELD = 'localemail'
> REQUIRED_FIELDS = []
> 
> class Meta:
> abstract = True
> ordering = ['localemail']
> 
> def get_username(self):
>return getattr(self, self.USERNAME_FIELD)
> 
> class Mailbox(models.Model):
> id = models.AutoField(primary_key=True)
> localpart = models.CharField(_('Localpart'), max_length=40)
> localdomainfk = models.ForeignKey(Localdomain,  verbose_name=_('Domain'), 
> db_column='localdomainfk', editable=('AL',))
> …
> 
> def __str__(self):
> return self.localpart+ '@'+self.localdomainfk.name 
> 
> 
> 
> 
> 
>  
>   File "...python3.5/site-packages/django/forms/models.py", line 408, in 
> _post_clean
> self.instance.full_clean(exclude=exclude, validate_unique=False)
>   File "...python3.5/site-packages/django/db/models/base.py", line 1234, in 
> full_clean
> self.clean()
>   File "...python3.5/site-packages/django/contrib/auth/base_user.py", line 
> 77, in clean
> setattr(self, self.USERNAME_FIELD, 
> self.normalize_username(self.get_username()))
>   File 
> "...python3.5/site-packages/django/db/models/fields/related_descriptors.py", 
> line 216, in __set__
> self.field.remote_field.model._meta.object_name,
> ValueError: Cannot assign "'unp...@framailx.de '": 
> "Account.localemail" must be a "Mailbox" instance.
> [21/Aug/2017 16:08:37] "POST /admin/erdb/account/19/change/ HTTP/1.1" 500 
> 166385
> 
> Any help to resolve this appreciated,
> Axel
> 
> 
> You've set your USERNAME_FIELD to a field that is an FK to another table. 
> I've never seen that before, but apparently the docs say it is supported. To 
> be fair, that’s the extent of the documentation on how to utilize an FK as 
> the username field. 

Some background info:

This is a realtime operational database, for which I try to create a GUI with 
Django.
The DB is fully normalized and multi-client.
To reduce the complexity, I have created a concept for shortcuts of model 
instances, which are used in list views or FK form fields.

Each model has a __str__() method which returns such a shortcut (like the above 
Mailbox) for an instance.

There are other concepts like
  Model forms just to display data, or, 
  For the multi-client part, the PK of the current user is kept in the session 
along with some Q-expressions to qualify account dependent queries.

My current problem with 1.11 is a model form for Account, which contains a FK 
field referencing Mailbox in which the above shortcut is displayed as a pop up 
(forms logic treats remote instance as text).
I changed something else in the form and tried to save with the Mailbox field 
unchanged.

It seems that forms logic does no longer manage to get the instance from its 
text representation.

When I access a model instance, AFAIK my context determines the data type I get 
(string or model instance).
Is this correct?

> If this was working under 1.9 (I'd be surprised if it was), then I would file 
> this as a backward-incompatibility bug with the bug tracker. It’s possible 
> that 1.9 did do the type/field conversion using some black magic, but with 
> the information in your model, I don't know how it could have made that 
> determination. 

I have just verified: It still works with 1.9. (-;

> 
> From a design perspective, the relation you presented seems backwards to me. 
> I would think the Account model would hold the canonical username, and 
> Mailbox would have the FK back to the Account. That design would not require 
> the use of a username field as an FK, simplifying everything (authentication, 
> forms, views, etc.). Your current design would implement excessive SQL JOIN's 
> to pull relatively simple data on every request. 
> 
> Or, I could be completely wrong. :-D

Perhaps, I should publish the project at github (it’s OSS anyway), to get more 
advice?

Axel
---
PGP-Key:29E99DD6  ☀  computing @ chaos claudius

-- 
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.co

Deploying Django Tutorials or Guides - mod_wsgi, Apache, Linux

2017-08-22 Thread pieceofkayk2718
Does anyone have any good tutorials or guides on how to deploy a Django 
project using mod_wsgi, Apache, and Linux?  The documentation isn't really 
cutting it for my beginner self.
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/5f80d0bf-bbb9-491c-9066-ff36a6479a50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Questions About ModelForm

2017-08-22 Thread James Schneider
>
>
> Documents are uploaded and saved to the local drive through the admin
> portal. That works. The workflow is used to review those documents that
> have text in them (DOCUMENT_CATEGORY), and for a user to decide if they can
> be OCRed and the text saved in the text field of the DocumentOCR model, or
> if they need to be transcribed by the user into the text field. Some of the
> documents are hand written notes that have been scanned into a pdf.
>
> The first stage of the workflow is supposed to show a table with one
> document per row. The first cell has a radio button, and each succeeding
> cell has information from the fields in the Document and DocumentOCR
> tables. The user selects the document he/she wants to work on by clicking
> on the appropriate radio button.
>
> Is there something in the ModelForm class that will create this table, or
> do I have to create the HTML for this table. From my reading, I gather I
> need to put the database query for the data set for the table in the view
> and pass that to the form. Is that the appropriate way to do something like
> this?
>


There's a couple of ways to go about this.

What you are probably thinking of is a custom ModelForm using a ModelChoice
form field with a different widget such as RadioSelect. You may need to
override the 'option_template_name' with a custom template to get the table
layout you desire.

https://docs.djangoproject.com/en/1.11/ref/forms/fields/#modelchoicefield
https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#radioselect

Another option is to not use a form at all, but rather a standard ListView
(or similar view). Using a form requires having a series of radio buttons
and forcing the user to select one, then click Submit. Too many clicks,
especially if your users will do this a lot (you'd be surprised at the
amount of time saved for highly repetitive tasks like that). Using a
ListView, the docs could still be rendered in a table with all of the
information you mentioned, but they would simply click on the title of any
of the documents to go to an editing form (as an example, you can also have
a column with a link to the editing forms as well). Less clicking, and less
mucking with forms and validation. Everyone wins. Of course, you may have
other items in the form you are generating, so that may not be an option.

-James

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


Re: please help me about django error that encoding is wrong

2017-08-22 Thread James Schneider
>
>
> System check identified 1 issue (0 silenced).
> August 22, 2017 - 02:05:59
> Django version 1.11.4, using settings 'untitle7.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> Unhandled exception in thread started by  check_errors..wrapper at 0x03827030>
> Traceback (most recent call last):
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\utils\autoreload.py", line 228, in
> wrapper
> fn(*args, **kwargs)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\core\management\commands\runserver.py",
> line 149, in inner_run
> ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\core\servers\basehttp.py", line 164,
> in run
> httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\core\servers\basehttp.py", line 74,
> in __init__
> super(WSGIServer, self).__init__(*args, **kwargs)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\Lib\socketserver.py", line 453, in __init__
> self.server_bind()
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\Lib\wsgiref\simple_server.py", line 50, in server_bind
> HTTPServer.server_bind(self)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\Lib\http\server.py", line 138, in server_bind
> self.server_name = socket.getfqdn(host)
>   File 
> "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\socket.py",
> line 673, in getfqdn
> hostname, aliases, ipaddrs = gethostbyaddr(name)
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 0:
> invalid start byte
>


I'm going to take a stab in the dark. From the traceback, it appears Django
is trying to resolve the name of the host where you are running the
development server, but the byte string it is getting back from the system
calls querying the host name of your computer is not encoded using UTF-8
(or is getting a character string that is not being properly encoded),
hence the decode errors.

A quick Google found this SO post:
https://stackoverflow.com/questions/23109244/unicodedecodeerror-with-runserver

There are also a bunch of references to this (Still open from 2010) Python
bug: http://bugs.python.org/issue9377 (socket, PEP 383: Mishandling of
non-ASCII bytes in host/domain names)

Try changing the name of your computer to use only ASCII characters (which
should work around the encoding/decoding issues). If that works, I'm not
entirely sure what the long-term solution is, but that should at least
point you in the right direction when Googling.

-James

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


Re: Use separate apps or only one app in my project

2017-08-22 Thread ledzgio
I forgot to mention that each website accepts different data, this means 
that if I want to publish a certain content within an app, the field 
required by each website can vary.

On Tuesday, August 22, 2017 at 3:41:21 PM UTC+2, ledzgio wrote:
>
> I am a noob with Django and I am working on my first Django project where 
> I have to publish some kind of content within different websites, so 
> basically I have this app that allows me to publish some content on many 
> different websites.
>
> Now my question is, is it a good idea to make a separate Django app for 
> each website I want to integrate in the project? or it is better to have 
> only one app with everything inside? is it the right way to use apps?
>
> 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/b0433933-63e6-44e6-b38b-37d2fca547f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Use separate apps or only one app in my project

2017-08-22 Thread ledzgio
I am a noob with Django and I am working on my first Django project where I 
have to publish some kind of content within different websites, so 
basically I have this app that allows me to publish some content on many 
different websites.

Now my question is, is it a good idea to make a separate Django app for 
each website I want to integrate in the project? or it is better to have 
only one app with everything inside? is it the right way to use apps?

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/dbc1dc64-7ceb-4e6a-ac4a-81fa32fe9b86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: please help me about django error that encoding is wrong

2017-08-22 Thread Vijay Khemlani
What is the hostname of your machine? If you are using Windows then you can
execute "ipconfig /all" on a cmd prompt

On Mon, Aug 21, 2017 at 11:27 PM, 輝夜三日月  wrote:

>
> 
> just create a django project in Pycharm which was in a virtual environment
> ,while it send me a unsolved problem about following things:
>
>
>
> "C:\Program Files\JetBrains\PyCharm 2017.2.1\bin\runnerw.exe"
> C:\Users\Administrator\sample——venv\Scripts\python.exe
> C:/Users/Administrator/PycharmProjects/untitle7/manage.py runserver 8000
> Performing system checks...
>
> System check identified some issues:
>
> WARNINGS:
> ?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django
> 1.8 and the TEMPLATES dictionary takes precedence. You must put the values
> of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.
>
> System check identified 1 issue (0 silenced).
> August 22, 2017 - 02:05:59
> Django version 1.11.4, using settings 'untitle7.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> Unhandled exception in thread started by  check_errors..wrapper at 0x03827030>
> Traceback (most recent call last):
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\utils\autoreload.py", line 228, in
> wrapper
> fn(*args, **kwargs)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\core\management\commands\runserver.py",
> line 149, in inner_run
> ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\core\servers\basehttp.py", line 164,
> in run
> httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\lib\site-packages\django\core\servers\basehttp.py", line 74,
> in __init__
> super(WSGIServer, self).__init__(*args, **kwargs)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\Lib\socketserver.py", line 453, in __init__
> self.server_bind()
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\Lib\wsgiref\simple_server.py", line 50, in server_bind
> HTTPServer.server_bind(self)
>   File "C:\Users\Administrator\AppData\Local\Programs\Python\
> Python36-32\Lib\http\server.py", line 138, in server_bind
> self.server_name = socket.getfqdn(host)
>   File 
> "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\socket.py",
> line 673, in getfqdn
> hostname, aliases, ipaddrs = gethostbyaddr(name)
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 0:
> invalid start byte
>
>
>
> 
> just a empty project,I have done nothing but receive so many errors.I try
> to find some methods to solve it in starkflow or somewhere but,just find a
> unsolved question.
>
> --
> 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/a5580eb5-2b2b-4207-becb-65e183144f2d%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/CALn3ei0WZFSM9qicnxdPmG4JWQ1cM%2BXnvdChoJ1kx%2B3mg6zZAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


please help me about django error that encoding is wrong

2017-08-22 Thread 輝夜三日月



just create a django project in Pycharm which was in a virtual environment 
,while it send me a unsolved problem about following things:



"C:\Program Files\JetBrains\PyCharm 2017.2.1\bin\runnerw.exe" 
C:\Users\Administrator\sample——venv\Scripts\python.exe 
C:/Users/Administrator/PycharmProjects/untitle7/manage.py runserver 8000
Performing system checks...

System check identified some issues:

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 
1.8 and the TEMPLATES dictionary takes precedence. You must put the values 
of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.

System check identified 1 issue (0 silenced).
August 22, 2017 - 02:05:59
Django version 1.11.4, using settings 'untitle7.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by .wrapper at 0x03827030>
Traceback (most recent call last):
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\utils\autoreload.py",
 
line 228, in wrapper
fn(*args, **kwargs)
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\commands\runserver.py",
 
line 149, in inner_run
ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\servers\basehttp.py",
 
line 164, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\servers\basehttp.py",
 
line 74, in __init__
super(WSGIServer, self).__init__(*args, **kwargs)
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\socketserver.py",
 
line 453, in __init__
self.server_bind()
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\wsgiref\simple_server.py",
 
line 50, in server_bind
HTTPServer.server_bind(self)
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\http\server.py",
 
line 138, in server_bind
self.server_name = socket.getfqdn(host)
  File 
"C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Lib\socket.py",
 
line 673, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 0: 
invalid start byte



just a empty project,I have done nothing but receive so many errors.I try 
to find some methods to solve it in starkflow or somewhere but,just find a 
unsolved question.

-- 
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/a5580eb5-2b2b-4207-becb-65e183144f2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrate and use AdminLTE2 template as frontend separate from django admin backend

2017-08-22 Thread Óscar M . Lage

>
>
> Any suggestion on how to do it quickly?
>

What about django-cruds-adminlte?

https://github.com/oscarmlage/django-cruds-adminlte

-- 
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/d92ec10d-1ae9-461a-a179-10c354a755a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.