Re: Django Produces Python?

2017-03-26 Thread Melvyn Sopacua
On Sunday 26 March 2017 00:46:28 Ed Sutherland wrote: > Wow. I had thought Django as an assistant to build python projects. If > I need the framework along with whatever language, it seems like > immense code-bloat. What, then, is the purpose of using frameworks? This article[1] sums it up

Channels - logout not resetting message.user value on new WebSocket connections

2017-03-26 Thread Sergio Diaz
Hello, I'm trying out Channels in Django 1.11 and set up a few consumers, looking like this: @channel_session_user_from_http def ws_connect(message, slug): if message.user.is_authenticated(): message.reply_channel.send({"accept": True}) else:

Re: Django Produces Python?

2017-03-26 Thread Andréas Kühne
If you want managed hosting, all you have to do is ask if they can host django. You normally install django in a virtualenvironment - so as long as they allow virtual environments you are probably good to go. Most managed servers that can install python work with Django - Django is a pretty well

Re: AdminURLFieldWidget question

2017-03-26 Thread Mike Dewhirst
Declaring myAdminURLFieldWidget outside the ModelAdmin class is the answer! On 26/03/2017 6:32 PM, Mike Dewhirst wrote: How can I manipulate the link in an Admin URLField so it uses the normal HTML hyperlink attributes? I have a substance with ingredients in a self m2m relationship and I

Re: Testing client's force_login method doesn't seem to be logging in.

2017-03-26 Thread Quentin Fulsher
Actually I just fixed it, You have to save the model after you set the password. On Sunday, March 26, 2017 at 2:35:08 PM UTC-7, Quentin Fulsher wrote: > > I'm trying to write a test case for the viewing permissions on a certain > webpage. I'm trying to get the client to force_login as a user to

Testing client's force_login method doesn't seem to be logging in.

2017-03-26 Thread Quentin Fulsher
I'm trying to write a test case for the viewing permissions on a certain webpage. I'm trying to get the client to force_login as a user to test if they can get the view or not. The issue is that my client doesn't seem to be logged in. No matter who I try to login as (There are a few different

Re: Channels - logout not resetting message.user value on new WebSocket connections

2017-03-26 Thread Andrew Godwin
This isn't a known issue, but I'll need more debugging info to know if it's Channels or not. Couple of checks: - The way to reject a socket connection is "close": True, not "accept": False; try changing to that - What is the value of message.user and message.reply_channel on each of a a)

Re: GeoDjango

2017-03-26 Thread Alex Mandel
I'll add that you could also use Geonode http://geonode.org/ which is a Django front-end to a Geoserver instance. I've also run Tilestache directly on GeoDjango tables stored in Postgis to generate TMS style services. Enjoy, Alex PS: GeoDjango has it's own mailing list. On 03/20/2017 01:05 AM,

Django tutorial HTTP Error 404

2017-03-26 Thread Paweł Balawender
Hi I'm a Django newbie on Windows and try to follow its official tutorial . I've done everything - as I think - completely fine, but at the last step I get a 404 Error, more precisely, that: Page not found (404) Request Method: GET

Re: Django tutorial HTTP Error 404

2017-03-26 Thread Melvyn Sopacua
On Sunday 26 March 2017 07:41:06 Paweł Balawender wrote: > I'm a Django newbie on Windows and try to follow its official tutorial > . I've done > everything - as I think - completely fine Almost. You're told to test runserver *before*

Re: Django tutorial HTTP Error 404

2017-03-26 Thread ludovic coues
This might be the most often asked question on this mailing list. I'm pretty sure the code is perfectly fine, but you missed a little step in the tutorial. The third line of the error message is saying you opened http://127.0.0.1:8000/ The "Write your first view" chapter finish with "Go to

Re: django allauth and AdminSite reverse()

2017-03-26 Thread Melvyn Sopacua
On Sunday 26 March 2017 09:11:25 Narnik Gamarnik wrote: > Hello. > > There is a task to create one entry point for different groups of > users in Django, and after successfully passing authorization, > redirect to the required page. > > There are three different routes: Yes, and the 4th is

Re: How to create a new user with django rest framework and custom user model

2017-03-26 Thread Andréas Kühne
I think you have a few errors in your code. In views.py you write: User.objects.create_user( serialized.save() ) serialized.save() is probably calling User.objects.create - which you shouldn't do. If you want to create a user the way you are doing you will need to

How to create a new user with django rest framework and custom user model

2017-03-26 Thread Aamu Padi
I have a custom user model and I am using django-rest-framework to create API models.py: class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField( unique=True, max_length=254, ) first_name = models.CharField(max_length=15) last_name =

Re: Django Produces Python?

2017-03-26 Thread Ed Sutherland
I now understand the purpose and worth of Django. What, then, are the questions I need to ask potential hosts? I'm leaning toward Linode, but would also like affordable managed hosting. On Sun, 26 Mar 2017 04:16:52 -0400 Lachlan Musicman

django allauth and AdminSite reverse()

2017-03-26 Thread Narnik Gamarnik
Hello. There is a task to create one entry point for different groups of users in Django, and after successfully passing authorization, redirect to the required page. There are three different routes: Urlpatterns = [ Url (r '^ django-admin /', include (admin.site.urls)), Url (r '^

Re: Django Produces Python?

2017-03-26 Thread Lachlan Musicman
If you take James' answer and expand it a little, take a look at a Python micro-framework like Pylons http://pylonsproject.org/ It's smaller than Django and is a useful tool for a different type of website. For instance take Authentication and Authorization - logins. Not every site needs one.

Re: Django Produces Python?

2017-03-26 Thread Antonis Christofides
You can think of Django as just a library. We call it a "framework" because it defines a whole way of working. Likewise, the Python standard library calls unittest a "framework" and this is consistent, because unittest also defines a whole way of working. But the difference between a framework and

AdminURLFieldWidget question

2017-03-26 Thread Mike Dewhirst
How can I manipulate the link in an Admin URLField so it uses the normal HTML hyperlink attributes? I have a substance with ingredients in a self m2m relationship and I want the ingredients displayed to carry a link to open themself in another substance page. IOW, I want to use the