Re: New Django Developer

2023-02-03 Thread adeyinka newton
You can change the upload path of Django Froala Editor to Cloudinary by
using Cloudinary's upload API. Here is an example of how to do this:

Sign up for a Cloudinary account and get your cloud name, API key, and API
secret.

Install the Cloudinary Python library:

settings.py:
===
pip install cloudinary

Add the following settings in your Django settings file:


import os
import cloudinary
import cloudinary.uploader

CLOUDINARY_CLOUD_NAME = "your_cloud_name"
CLOUDINARY_API_KEY = "your_api_key"
CLOUDINARY_API_SECRET = "your_api_secret"

cloudinary.config(
  cloud_name = CLOUDINARY_CLOUD_NAME,
  api_key = CLOUDINARY_API_KEY,
  api_secret = CLOUDINARY_API_SECRET
)



In your Froala Editor view,
use the Cloudinary library to upload the image and return the URL to Froala
Editor.
Here is an example view:


from django.http import JsonResponse
import cloudinary
import cloudinary.uploader

def froala_upload(request):
if request.method == 'POST' and request.FILES.get('file'):
try:
response = cloudinary.uploader.upload(request.FILES['file'])
return JsonResponse({
'link': response['secure_url']
})
except Exception as e:
return JsonResponse({
'error': str(e)
})
return JsonResponse({
'error': 'Invalid request'
})



5.

Add the URL for the Froala upload view in your URL configuration:


from django.urls import path
from .views import froala_upload

urlpatterns = [
path('froala_upload/', froala_upload, name='froala_upload'),
]



6.
In the Froala Editor options, set the imageUploadURL to the URL of your
upload view.
 Here is an example:


$('#froala-editor').froalaEditor({
  imageUploadURL: '/froala_upload/'
});

On Fri, Feb 3, 2023 at 3:58 AM Israel Akinoso  wrote:

> Can we collaborate on one together?
> It'll boost us both :)
>
> On Wednesday, February 1, 2023 at 4:03:40 PM UTC+1 vinodr...@gmail.com
> wrote:
>
>> Hi All, I am recently complete *Django course* with *small projects*,
>> can any one help me to find *real world projects* to master Django,
>> i have basic knowledge about *UI technologies.*
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e674df39-8626-4403-b294-95ce4f843d57n%40googlegroups.com
> 
> .
>

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


Re: New Django Developer

2023-02-03 Thread Israel Akinoso
Can we collaborate on one together?
It'll boost us both :)

On Wednesday, February 1, 2023 at 4:03:40 PM UTC+1 vinodr...@gmail.com 
wrote:

> Hi All, I am recently complete *Django course* with *small projects*, 
> can any one help me to find *real world projects* to master Django,
> i have basic knowledge about *UI technologies.*
>
>

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


New Django Developer

2023-02-01 Thread Vinod Raygonda
Hi All, I am recently complete *Django course* with *small projects*, 
can any one help me to find *real world projects* to master Django,
i have basic knowledge about *UI technologies.*

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


Re: Top 10 tips to a new Django developer. correct approach?

2010-01-15 Thread fordprefect
I think it depends on requirements; not everything has to be a
reusable app ! For example, if you have a number of interdependent
apps as part of a larger system,and breaking them up makes no sense,
housing them under a single package is good practice.

What you should avoid is using the same name as your *project*, i.e.
the directory where you have your manage.py and settings.py.  That
makes it hard to redeploy, not just reuse.

On Jan 15, 11:30 am, Sebastian Pawlus 
wrote:
> Hi
>
> I've found something like "Top 10 tips to a new Django developer"
>
> http://blog.dpeepul.com/2009/08/31/top-10-tips-to-a-new-django-develo...
>
> I'm really blasted by first point "Don’t put project name  in the imports".
> is this point correct? Django site and core 
> developershttp://github.com/jacobian/cheeserater/blob/master/urls.pyhttp://code.djangoproject.com/browser/djangoproject.com/django_website/
>
> break that rule.
>
> x_O
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.




Re: Top 10 tips to a new Django developer. correct approach?

2010-01-15 Thread Mike Ramirez
On Friday 15 January 2010 03:52:16 Sebastian Pawlus wrote:
> I see but i thing there is more than my personal preference.
> 
> http://docs.djangoproject.com/en/dev/howto/deployment/modpython/
> 
> 
> 
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonOption django.root /mysite
> PythonDebug On
> *PythonPath "['/path/to/project'] + sys.path"*
> 
> 
> If I'm using project path, this bottom is going to produce errors. I'm
> really curious about that '/path/to/project' is that project is project
> where the settings.py file is, or is this only wrapper for
> /path/to/project/mysite/settings.py. (where the mysite is really a project
> in django meaning)
> 
> It's a bit unclear for me.
> 

'/path/to/project' is just a path to the projects parent directory, where 
mysite.settings can be imported. This is the basic minimum you need to get 
your porject running. I normally add two paths to my PythonPath setting,

PythonPath "['/path/to/project/parent', '/path/to/project/parent/mysite'] + 
sys.path"

The first one is to the mysite's parent directory so importing mysite.settings 
doesn't fail, the second path is the path to the actual project directory 
putting project specific apps into the Python path, so I can import them 
directly. There is also, if your apps files all live in the same directory, 
like:

mysite/
app1/
__init__.py
models.py
views.py
forms.py

In views.py you can do `from models import MyModel` python by default will 
always search the current directory (in this case where views.py lives) for 
the module name, models not being a global name, makes this safe. 

I think what you're really unclear on is how the PythonPath setting works, 
which case you should read up on it in the Python Docs[1],

Mike

[1] http://docs.python.org/using/cmdline.html#envvar-PYTHONPATH

-- 
Actresses will happen in the best regulated families.
-- Addison Mizner and Oliver Herford, "The Entirely
New Cynic's Calendar", 1905


signature.asc
Description: This is a digitally signed message part.


Re: Top 10 tips to a new Django developer. correct approach?

2010-01-15 Thread Sebastian Pawlus
I see but i thing there is more than my personal preference.

http://docs.djangoproject.com/en/dev/howto/deployment/modpython/



SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonDebug On
*PythonPath "['/path/to/project'] + sys.path"*


If I'm using project path, this bottom is going to produce errors. I'm
really curious about that '/path/to/project' is that project is project
where the settings.py file is, or is this only wrapper for
/path/to/project/mysite/settings.py. (where the mysite is really a project
in django meaning)

It's a bit unclear for me.


On Fri, Jan 15, 2010 at 12:34 PM, Dougal Matthews wrote:

> If you want your app to be shipped individually and re-used then you
> shouldn't use the project name. If you make a reusable app and release it
> then I want to use it, I don't want to have to include the project
> namespace, i just want the app.
>
> However, its your shipping the project as a whole then it doesn't really
> matter and its then its just down to personal preference really.
>
> Dougal
>
> 2010/1/15 Sebastian Pawlus 
>
>> Hi
>>
>> I've found something like "Top 10 tips to a new Django developer"
>>
>> http://blog.dpeepul.com/2009/08/31/top-10-tips-to-a-new-django-developer/
>>
>> I'm really blasted by first point "Don’t put project name  in the
>> imports". is this point correct? Django site and core developers
>> http://github.com/jacobian/cheeserater/blob/master/urls.py
>> http://code.djangoproject.com/browser/djangoproject.com/django_website/
>>
>> break that rule.
>>
>> x_O
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Re: Top 10 tips to a new Django developer. correct approach?

2010-01-15 Thread Dougal Matthews
If you want your app to be shipped individually and re-used then you
shouldn't use the project name. If you make a reusable app and release it
then I want to use it, I don't want to have to include the project
namespace, i just want the app.

However, its your shipping the project as a whole then it doesn't really
matter and its then its just down to personal preference really.

Dougal

2010/1/15 Sebastian Pawlus 

> Hi
>
> I've found something like "Top 10 tips to a new Django developer"
>
> http://blog.dpeepul.com/2009/08/31/top-10-tips-to-a-new-django-developer/
>
> I'm really blasted by first point "Don’t put project name  in the imports".
> is this point correct? Django site and core developers
> http://github.com/jacobian/cheeserater/blob/master/urls.py
> http://code.djangoproject.com/browser/djangoproject.com/django_website/
>
> break that rule.
>
> x_O
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



Top 10 tips to a new Django developer. correct approach?

2010-01-15 Thread Sebastian Pawlus
Hi

I've found something like "Top 10 tips to a new Django developer"

http://blog.dpeepul.com/2009/08/31/top-10-tips-to-a-new-django-developer/

I'm really blasted by first point "Don’t put project name  in the imports".
is this point correct? Django site and core developers
http://github.com/jacobian/cheeserater/blob/master/urls.py
http://code.djangoproject.com/browser/djangoproject.com/django_website/

break that rule.

x_O
-- 

You received this message because you are subscribed to the Google Groups "Django users" group.

To post to this group, send email to django-us...@googlegroups.com.

To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.